我正在使用 RHEL 或 CentOS。我只想知道如何限制并发/同时连接数。
让我们说:
- 我有一个流媒体服务器
- (根据服务器性能)我希望我的服务器一次严格只为 100 个查看者提供服务。 (只有 100 位观众可以从我的服务器观看/下载)
请问有可能吗?如何实现?
最佳答案
查看 iptables 速率限制功能:
http://codingfreak.blogspot.com/2010/01/iptables-rate-limit-incoming.html
iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --hitcount 50 -j DROP
关于Linux : How to LIMIT incoming (concurrent) connection COUNT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18605010/