1

I'm using the "standard" way that I found everywhere on the internet (including ServerFault) to try and limit the bandwidth of a process, using cgroups & tc.

What I see in practice is that the limits I set through tc will be about 10 times more in practice, see this screenshot:

enter image description here

I set rate and ceil to 100kbit (NOT 100kbps), so I expect to see my wget below to show about 10 kilobytes per second. Instead I see 500kBps.

If I update my htp rate to 100kbps (100 kilobytes per second) I see my rate shoot up to 10 Megabytes/second, which is 100 times more:

tc class change dev ens3 classid 1:1 htb rate 100kbps

# the curl in the other terminal now shoots up to 9.6MB/s
image.iso.1    53%[================>                ] 346,72M  **9,48MB/s**    tps 49s

I don't understand why this is not coherent with my htb configuration. Do you have any idea on what I'm doing wrong?

1 Answer 1

2
+100

With tc, you are shaping the upload speed. With wget, you are testing the download speed. In your test, you are the shaping the TCP ACK sent by your client, so we can conclude that the ratio data / ack is 1:100 in your case.

You can shape the download speed by redirecting with tc the ingress flows to an ifb interface and shaping on it. Here you have an example on how to do it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .