How to limit egress traffic of a docker network with `tc tbf`
Asked Answered
P

0

6

I would like to limit the egress bandwidth of a docker network to 1Mbps. The bridge interface is docker0. I am using tc tbf:

tc qdisc add dev docker0 root handle 1: tbf rate 1000 kbit minburst 1000 burst 10000 limit 30000

The command does not have any effect on the docker0 interface, whereas it perfectly works if it is applied on Docker container's veth on the host (as already reported by this post).

I don't understand what the difference between veth and docker0 is. Moreover, I believe that it is not a routing problem since the container egress traffic has to go first to the veth interface and then through the Docker bridge interface docker0 accordingly to this picture:

docker network example

Thanks.

Pianissimo answered 17/2, 2017 at 13:45 Comment(2)
are you aware of github.com/shivacherukuri/Docker-Network-Bandwidth ?Arteriole
Thanks. I was not aware of this project. It seems that it uses tc htc under the hood. Unfortunately, I need to use tc tbf because I need also to limit the link queue size, not just the bandwidth.Pianissimo

© 2022 - 2024 — McMap. All rights reserved.