How can I rate limit network traffic on a docker container

前端 未结 2 719
有刺的猬
有刺的猬 2021-02-10 12:19

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

2条回答
  •  伪装坚强ぢ
    2021-02-10 12:55

    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.

提交回复
热议问题