netty-socketio icon indicating copy to clipboard operation
netty-socketio copied to clipboard

how to config the server in order to support more than 30000 connections in one server?

Open jmbkeyes opened this issue 4 years ago • 2 comments

how to config the server in order to support more than 30000 connections(e.g. 40000)? I do as the following steps, and try to test the max connections. but with no good luck, only 30734 connections are established.

  1. deploy netty-socketio 1.7.19 on centos7.
  2. modify the file /etc/security/limits.conf (add following lines to the file)
    •            hard    nofile          1048576
      
    •            soft    nofile          1048576
      
  3. modify the file /etc/sysctl.conf(add the following lines)

fs.file-max=1048576 fs.nr_open=1048576 #net.ipv4.netfilter.ip_conntrack_max = 1048576 net.nf_conntrack_max = 1048576 net.ipv4.ip_local_port_range= 1024 65535 net.ipv4.tcp_mem= 786432 2097152 3145728 net.ipv4.tcp_rmem= 4096 4096 16777216 net.ipv4.tcp_wmem= 4096 4096 16777216 net.ipv4.tcp_max_orphans= 131072 net.core.somaxconn = 10240 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_syncookies = 0 net.core.netdev_max_backlog = 41960 net.ipv4.tcp_max_tw_buckets = 300000 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1

  1. use jmeter websocket request/response samper to do test on two machines. image

jmbkeyes avatar Jun 30 '21 09:06 jmbkeyes

SocketIo 相关资讯可参考 https://www.gaojunjun.com/topic/2

gaojunjun2016 avatar Jul 07 '21 08:07 gaojunjun2016

@gaojunjun2016 我问的是一个netty-socketio实例貌似只支持30000多点的websocket连接,可以通过什么配置提高连接数?你发的跟问的好像跟问题无关。

jmbkeyes avatar Jul 08 '21 02:07 jmbkeyes