How can I rate limit network traffic on a docker container

I want to setup a docker container for a peer 2 peer app. This app doesn’t have app level rate limiting so I’m attempting to set a limit at the container level. I would like to rate limit outgoing and incoming connections on all ports but the one used by the app’s web UI.

  • Is it possible to use Kubernetes for Gitlab build runners and how?
  • Docker, nginx and several sites on one server
  • Unable to start a Docker container through Remote Docker Java API
  • Unable to use *build* object in docker-compose
  • Running iPython Notebook in Docker container on Amazon EC2 instance
  • How do to use fluentD to parse multi-line docker logs?
  • Docker Daemon connected to socket on :2375
  • “docker-compose up” fails with error
  • How to push container to Google Container Registry (unable to create repository)
  • Installing cron via apt-get fails in a docker ubuntu:12.04 container from permissions problems
  • How can I run docker container without entering into container
  • Scripting Docker, Not Connected After Running Script?
  • One Solution collect form web for “How can I rate limit network traffic on a docker container”

    You could use the iptables limits module. For example, you could add a rule to the PREROUTING table using the options “-m limit –limit 10/s” to limit a particular port to receive only 10 connections per second.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.