CaffeineAddict
Well-Known Member
When you download some large file such as big ISO or for instance seeding or downloading torrents, you may notice how browsing the internet is so stuck it takes some time until a web page is fully loaded, or watching videos is so slow all you see is spinning circle all the time.
Sometimes the problem is so horrible you can literary do nothing but to temporarily pause downloading or slowing down torrents.
Well no longer because here is why that's happening and how to fix it:
First show current
Let's say your interface used for download is called
From this output it's visible the
Suppose download packets are marked "X" and your web-browsing packets are marked "Y", packets go from left to right (that is from
A solution is to change
You can do it temporarily with
Then run
This change will persist until reboot or until you change
If you're using
Sample output
Then make the change for the connection you want to modify, in this sample it's called "MyWifi":
This one will persist reboots and will stay until you manually change it to some other queuing discipline.
After this change your driver queue will no longer be [Y X X X X X X...] but instead you'll have as many queues as needed to reduce traffic delay, so now it will turn into:
IP stack -> [ X X X X X X...] -> NIC controller
IP stack -> [Y] -> NIC controller
Meaning both types of packets have equal share of network resources.
You can now download big files and do torrenting as much as you like without suffering with web browsing, watching videos and maybe even playing online multiplayer games while you download.
Sometimes the problem is so horrible you can literary do nothing but to temporarily pause downloading or slowing down torrents.
Well no longer because here is why that's happening and how to fix it:
First show current
qdisc
for your NIC that's used for download:
Bash:
ip link
Let's say your interface used for download is called
wlan0
the output might look like this:
Bash:
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
From this output it's visible the
qdisc
value which says noqueue
, what this means is that packets which are most numerous (from download) will waste up driver queue, and your other packets like video streaming or web browsing will have to wait in queue for prolonged time making normal internet use horrible.Suppose download packets are marked "X" and your web-browsing packets are marked "Y", packets go from left to right (that is from
TCP/IP
stack toward NIC
controller and vice versa, then the driver queue will look like [Y X X X X X X...], as you can see Y packet has to wait until all X packets are transmitted, that's why web browsing and watching video sucks.A solution is to change
qdisc
to fq_codel
which stands for "Fair Queuing, Controlled Delay".You can do it temporarily with
tc
command as follows (assuming your NIC is called wlan0
):
Bash:
sudo tc qdisc add dev wlan0 root fq_codel
Then run
ip link
again to confirm the change.This change will persist until reboot or until you change
qdics
to something else.If you're using
NetworkManager
and want to make this setting permanent to persist reboots then:
Bash:
# List connections
nmcli connection show
Sample output
Bash:
NAME UUID TYPE DEVICE
MyWifi 5120ec15-0c1e-4252-8f2e-905eb533be30 wifi wlan0
... etc
Then make the change for the connection you want to modify, in this sample it's called "MyWifi":
Bash:
nmcli connection modify MyWifi tc.qdiscs 'root fq_codel'
This one will persist reboots and will stay until you manually change it to some other queuing discipline.
After this change your driver queue will no longer be [Y X X X X X X...] but instead you'll have as many queues as needed to reduce traffic delay, so now it will turn into:
IP stack -> [ X X X X X X...] -> NIC controller
IP stack -> [Y] -> NIC controller
Meaning both types of packets have equal share of network resources.
You can now download big files and do torrenting as much as you like without suffering with web browsing, watching videos and maybe even playing online multiplayer games while you download.
Last edited: