Score:1

Using cgroup & tc in linux seems to NOT apply exactly my rates: 10x discrepancy

bd flag

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?

Score:2
us flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.