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.

  • Changing /proc/sys/kernel/core_pattern file inside docker container
  • Persist Data files in docker container
  • Docker container has no TMPDIR environmental variable
  • Why i've got “550 Cannot establish SSL session” error when i sending mail from codeIgniter framework with server mail?
  • Database Fails to Start - Host Directory as a Data Volume
  • Dockerode works with node, but not via Webpack
  • Could not run mvc 6 on Docker
  • dockercloud haproxy with more than one service on different ports
  • Memory discrepancy between Kubernetes Dashboard and actual usage
  • Best way to distribute a docker container to people with varying technical backgrounds [closed]
  • kubectl get pods - kubectl get pods - STATUS ImagePullBackOff
  • How to “start over” with Docker?
  • 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.