100万并发设置
端口65535原理
接收连接数和发起连接数是2个概念
IPV4和IPV6
接收连接数取决于单个进程能打开的文件个数,比如要支持100万并发,系统设置方面需要如下设置
在/etc/sysctl.conf中添加如下配置:fs.file-max = 1048576
net.ipv4.ip_local_port_range = 1024 65535net.ipv4.tcp_mem = 786432 2097152 3145728net.ipv4.tcp_rmem = 4096 4096 16777216net.ipv4.tcp_wmem = 4096 4096 16777216net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1在/etc/security/limits.conf中添加如下配置:* soft nofile 1048576
* hard nofile 1048576