How do I throttle or limit the rate of the outbound traffic of my Linode?

Linode Staff

I want to limit the rate of outbound traffic to 20 Mbps instead of the current maximum rate of 1000 Mbps. Can Linode do this for me? If not, can I do it myself?

3 Replies

Linode Staff

Linode can't limit your traffic below the maximum rate of your Linode plan. However, you can accomplish this yourself.

Linux has a powerful built-in tool called tc (traffic control) that will allow you set rules to limit the rate of outbound traffic from your Linode.

tc is bundled with iproute — to make sure it’s installed, enter sudo apt-get install iproute or sudo apt-get install iproute2.

You may also need to be logged in as root to run tc, which you can do with the command su - root.

Once you have tc installed, you can set a token buffer filter (TBF) to limit outbound traffic to 20 Mbps with the following command:

tc qdisc add dev eth0 root tbf rate rate 20mbit burst 20kb lat 400.0ms

You can remove the TBF with the following command:

tc qdisc del dev eth0 root

For more information on how TBF with tc works, including the meaning of the different parameters in the command, you can refer to this handy synopsis, or this more comprehensive guide.

After successfully Installing tc and while limiting outbound traffic to 20MB it got following error on centos 6.

Illegal "rate"

Linode Staff

Hello,

I did some digging around online to see if anyone else had encountered this, and I found a github page that talks about running into an illegal "rate" error. This page is geared toward Ubuntu, but the principles should still apply:

Illegal "rate" when running tcset

I hope that helps!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct