Maximum concurrent Socket.IO connections

前端 未结 5 1888
旧时难觅i
旧时难觅i 2020-11-29 15:23

This question has been asked previously but not recently and not with a clear answer.

Using Socket.io, is there a maximum number of concurrent connections that one c

5条回答
  •  不知归路
    2020-11-29 15:38

    For +300k concurrent connection:

    Set these variables in /etc/sysctl.conf:

    fs.file-max = 10000000 
    fs.nr_open = 10000000
    

    Also, change these variables in /etc/security/limits.conf:

    * soft nofile 10000000
    * hard nofile 10000000
    root soft nofile 10000000
    root hard nofile 10000000
    

    And finally, increase TCP buffers in /etc/sysctl.conf, too:

    net.ipv4.tcp_mem = 786432 1697152 1945728
    net.ipv4.tcp_rmem = 4096 4096 16777216
    net.ipv4.tcp_wmem = 4096 4096 16777216
    

    for more information please refer to https://www.linangran.com/?p=547

提交回复
热议问题