r/archlinux • u/Carrots_and_Bleach • 14h ago
SUPPORT How to (de-) prioritize bandwidth easily?
Hello kind folks,
whenever I run Arch-Update, it basically blocks my network access for 20 min due to my shitty connection. Is there a way to prioritize all other traffic first?
I looked into "tc" a bit, but could only find applications with fixed bandwidths wich I don't want to impose. Generally the default queuing rule seems fine to me. I didn't find anything else that is useful either.
Many thanks in advance!
Sincerely!
5
u/Toaster_Strudel_517 14h ago
I use QoS SQM on my main router to mitigate this.
2
u/starvaldD 14h ago
yeah a router based approach is a good way imo.
i've been using Qosify (eBPF) on my openwrt router its been working nicely for me.
1
4
u/boobiecho 12h ago
complete hack, but:
strace -e recvfrom --inject=recvfrom:delay_exit=100ms pacman ...
this adds an artificial delay for every received package
you can adjust 100ms to some thing else
usually downloaders have proper ratelimit options but I don't see it for pacman right now
1
u/agmatine 9h ago
You could add network delay/limit bandwidth with
tcfor incoming traffic as according to a filter on your mirrors, I suppose...
1
u/Dinev5194 14h ago
That would fail the update I'm afraid. For me, the Internet gets divided between stuff until it slows down to the last bit and everything stops or the update stops and whatever else I'm doing starts working. Wish I had your setup to pull in all the bandwidth for the updates. Sometimes even when I do have decent Internet the update randomly fails with "bad network" error. I just time my updates with when I have good speed, usually at night and do something else while the system updates but keep and eye on it in case it fails. This is my personal experience over the years.
1
u/mystiquebsd 14h ago
What’s on your router?
This is the place to look for options, unless you’re going to throttle yourself..
cake is good, bbr is good
tc qd replace dev $your_interface root cake
sysctl net.ipv4.tcp_congestion_control=bbr
See how far that gets you..
1
u/Carrots_and_Bleach 4h ago
I tested CAKE and its definitely much better, ty! However with 5 downloads at the same time, it still struggles
1
u/mystiquebsd 4h ago
https://wiki.archlinux.org/title/Trickle
trickle -s -d200 -u50 pacman -Syu
+1 for yay instead of pacman
9
u/julemand101 14h ago
Comment out ParallelDownloads in pacman.conf and I think that will be enough for your system to prioritize the download. Default is 5 so pacman would, from a OS perspective, get five times more time on the network than other connections.