Linux下高并发socket最大连接数所受的各种限制


Linux下高并发socket最大连接数所受的各种限制

http://www.cnblogs.com/dasn/articles/5566001.html

1
2
3
4
5
6
vim /etc/security/limits.conf

* soft nofile 1048576
* hard nofile 1048576
@root soft nofile 1048576
@root hard nofile 1048576
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
vim /etc/sysctl.conf

net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.core.somaxconn = 262144
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2