Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 10 down vote accepted

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:

share|improve this answer
    
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

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.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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