I noticed that when I am running applications such BitTorrent all the other applications have trouble accessing the network.
I am sure it would be possible to limit BitTorrent's network usage but what I really want is to be able to set priorities to applications (or protocols) accessing the network. For example, let's say I put max priority for the browser (or http) and then, no matter how much bandwidth was using at the time, the http packets would always go through.
Is this possible? Is there an application for Ubuntu to do this or a way to configure this on Ubuntu directly?
Best Answer
Wondershaper
If it's not too simple for your use case I suggest you give
wondershaper
a try.It's available as a debian/ubuntu package, just run
sudo apt-get install wondershaper
to install it. Betweenwondershaper
and usingtc
directly, trust me, you want wondershaper. At one time I usedtc
extensively and while quite powerful, it's not a joy to use.Starting and configuration of Wondershaper
Close all programs and other browser pages. Then check your speed at http://speedtest.net
Syntax: wondershaper [network interface] [down speed kbit/s] [up speed kbit/s]
Example for 8/1M (mbit/s) ADSL connection:
If you want to clear wondershaper queues (disabling traffic shaping):
Syntax: wondershaper clear [network interface]
Starting wondershaper automatically when OS starts
This can be done by editing the file
/etc/network/interfaces
Before:
After:
Notice this is just an example. Actual settings might differ a bit in your system. For example, in your system the network interface might be eth0 instead of eth2.
To find your network device execute:
ifconfig
or see connection information of network manager.Source: http://www.mdash.net/traffic-shaping-using-wondershaper