14

I have a need to throttle the bandwidth usage, similar to how some ISPs do it, so that after a couple of seconds, it throttles down the speed.

18

What you're looking for is called Traffic Shaping. The best source of information for it (that I know of) is Linux Advanced Routing and Traffic Control. It's a little bit dated, but still has a ton of good information. If you google for Linux Traffic Shaping, you can find some scripts and tools to make the traffic shaping configuration a little bit easier.

The specific commands you will use, unless you find a tool or script to do the work for you, are tc and/or tcng. I also want to warn you that traffic shaping can get very complicated if you haven't done it before, particularly if you're trying to do it by hand.

Additionally, also remember that you can only reliably control the speed of data that you are sending out.

You might also want to check out these similar serverfault questions:

  • I should have mentioned it in my original answer, but another common term for this (although it includes a little more) is QoS (Quality of Service). It's another good term to watch for when trying to manage traffic. – Christopher Cashell Aug 29 '12 at 21:53
0

We use tc.bash (link) for traffic control, in combination with IPTables. Its done the trick for everything we've needed it for so far.

(Tested on CentOS 4 and 5, and should work with any flavor of linux with tc and iptables.)

0

For Ubuntu, try wondershaper.

http://ubuntu-snippets.blogspot.com/2008/07/easy-network-traffic-shaping-on-your.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.