服务端高并发

http://www.blogjava.net/yongboy/archive/2013/05/13/399203.html    100万并发设置

http://blog.csdn.net/longhumen1214/article/category/1438633      端口65535原理

接收连接数和发起连接数是2个概念

IPV4和IPV6

 

接收连接数取决于单个进程能打开的文件个数,比如要支持100万并发,系统设置方面需要如下设置
在/etc/sysctl.conf中添加如下配置:

fs.file-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_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
在/etc/security/limits.conf中添加如下配置:

* soft nofile 1048576
* hard nofile 1048576

你可能感兴趣的:(高并发)