Comment on How to prioritize a container with regards to internet speed
sudneo@lemmy.world 8 months ago
Cgroups have the ability to limit TCP and total network bandwidth. I don’t know from the top of my mind whether this can be configured at runtime (I.e. via docker run), but you can specifcy at runtime the cgroup parent to use. This means you can pre-create the cgroup, set the limits and start the container with that parent cgroup.
You can also run some hook script after launch that adds the PID to a cgroup every time the container is launched, or possibly use tc.
I am not aware of the ability to only limit uplink bandwidth, but I have not researched this.
GravitySpoiled@lemmy.ml 8 months ago
thx. docker-tc as suggested below does probably this. I’d like to prioritize, not only limiting.
sudneo@lemmy.world 8 months ago
Yeah ultimately every container has it’s own veth interface, so you can do shaping using tc on those.