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.

  • Docker containers handling more load
  • Docker hangs when starting jdubois/jhipster container in OS X
  • Docker set ipaddress and start services
  • Can Docker containers run in Windows IoT Core
  • Can I pass environment variables to a Docker container using Cockpit?
  • What is the optimal way to store data-files for testing using travis-ci + Docker?
  • How to remove all data from a Docker Registry from cli?
  • Lite virtualization of processes
  • Docker image extending the mysql image isn't running the initdb scripts
  • Unable to connect to an ibmnode:latest-based container with putty over ssh
  • Docker containers - DNS issue
  • generate a self signed certificate in 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.