Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于单机lhttp服务器的websocket最大连接数 #25

Open
yinjiaoyuan opened this issue Apr 9, 2018 · 3 comments
Open

关于单机lhttp服务器的websocket最大连接数 #25

yinjiaoyuan opened this issue Apr 9, 2018 · 3 comments

Comments

@yinjiaoyuan
Copy link
Contributor

单机lhttp服务器的websocket最大连接数我按照https://www.jianshu.com/p/e0b52dc702d6的步骤优化系统的参数进行测试只有51322个,使用的服务器是dell 730xd,32g内存,测试软件使用https://github.com/changhu2013/websocket_bench。我想做到单机支撑10万个以上的websocket连接数,请问哪里可以再优化?谢谢。

@fanux
Copy link
Owner

fanux commented Apr 10, 2018

系统最大连接数限制了没?

@yinjiaoyuan
Copy link
Contributor Author

修改如下:
echo "net.ipv4.tcp_mem = 786432 2097152 3145728">> /etc/sysctl.conf
echo 1100000 > /proc/sys/fs/file-max
echo "fs.nr_open=1100000" >> /etc/sysctl.conf
sysctl -p
修改/etc/security/limits.conf:

  • soft  nofile 1100000
    
  • hard nofile 1100000
    

@yinjiaoyuan
Copy link
Contributor Author

而且在达到51322个连接后客户端继续创建连接的话会服务器出现所有连接都断开的问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants