Internet speed prioritization in containers

How can I prioritize a container with regards to internet speed? Let’s assume I’ve got two podman (docker) containers and both upload stuff.

Reasoning

My upload bandwidth is limited. One container needs to reliably upload stuff and the other doesn’t. Thus, I want to prioritize one container over the over in order to deliver content in this container reliably.

Example

Syncthing can sync over a long time period but jellyfin can’t.

  • GravitySpoiledOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    thx. docker-tc as suggested below does probably this. I’d like to prioritize, not only limiting.

    • sudneo@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      8 months ago

      Yeah ultimately every container has it’s own veth interface, so you can do shaping using tc on those.

      Edit: I had a look at docker-tc. It does what you want, BUT. Unless your use case is complex, I would really think twice about running a tool written in bash which has access to the docker socket (I.e. trivial node escape) and runs with NET_ADMIN capability.

      That’s a lot of power to do something you can also do with a few lines of code executed after you start the container. Again, provided that your use case is not complex.