单台百万并发

1.设置

/etc/security/limits.conf

单台百万并发_第1张图片

/etc/sysctl.conf

单台百万并发_第2张图片

linux 修改端口范围

echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range

客户端

net.ipv4.tcp_mem = 262144 524288 786432
net.ipv4.tcp_wmem = 1024 1024 2048
net.ipv4.tcp_rmem = 1024 1024 2048
fs.file-max = 1048576
net.ipv4.tcp_max_orphans = 16384

服务端

net.ipv4.tcp_mem = 252144 524288 786432
net.ipv4.tcp_wmem = 1024 1024 2048
net.ipv4.tcp_rmem = 1024 1024 2048 
fs.file-max = 1048576
net.nf_conntrack_max = 1048576
net.netfilter.nf_conntrack_tcp_timeout_established = 1200

sudo modprobe ip_conntrack

然后sysctl -p

其他命令:

dmesg

 

内核参数调优socket:http://www.360doc.com/content/14/0606/16/3300331_384326124.shtml

你可能感兴趣的:(Linux)