I am using TC Linux HTB to limit traffic bandwidths in the egress interface.
For it, I've set the following instructions on a linux container:
tc qdisc add dev eth2 root handle 1: htb default 12
tc class add dev eth2 parent 1: classid 1:1 htb rate 100mbit ceil 100mbit
tc class add dev eth2 parent 1:1 classid 1:10 htb rate 40mbit ceil 100mbit
tc class add dev eth2 parent 1:1 classid 1:12 htb rate 1bps ceil 100mbit
Without configure any filter, when I realize an iperf3 with a throughput of 200M that passes the container, the traffic goes through the default queue (12). However, instead of having 100 Mbps as set, I obtained 73-75 Mbps.
Why this can occur?
If HTB is overlimiting traffic bandwidth, it means that the allocated bandwidth for a particular class or queue is insufficient to handle the incoming traffic. This issue can be addressed by adjusting the HTB configuration to allocate more bandwidth or prioritize critical traffic. https://serverfault.com/questions/254535/traffic-shaping-on-linux-with-htb-weird-results