If it's not too simple for your use case I suggest you give
wondershaper a try.
An easy to use traffic shaping script
that provides these improvements: *
Low latency for interactive traffic
(and pings) at all times * Allow
websurfing at reasonable speeds while
uploading / downloading * Make sure
uploads don't hurt downloads * Make
sure downloads don't hurt uploads .
It does this by: * Limiting upload
speed slightly, to eliminate queues
* Limiting download speed, while allowing bursts, to eliminate queues
* Interactive traffic skips the queue * ACKs and tiny packets skip the queue
It's available as a debian/ubuntu package, just run
sudo apt-get install wondershaper to install it. Between
wondershaper and using
tc directly, trust me, you want wondershaper. At one time I used
tc 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:
wondershaper eth0 6700 800
If you want to clear wondershaper queues (disabling traffic shaping):
Syntax: wondershaper clear [network interface]
wondershaper clear eth0
Starting wondershaper automatically when OS starts
This can be done by editing the file
iface lo inet loopback
iface eth0 inet dhcp
up /sbin/wondershaper eth0 6700 800
down /sbin/wondershaper clear eth0
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.