TCP最大连接数(somaxconn)

#查看
cat /proc/sys/net/core/somaxconn
修改/etc/sysctl.conf
net.core.somaxconn = 4096

#TCP连接立即回收、回用(recycle、reuse)
net.ipv4.tcp_tw_reuse = 1  
#net.ipv4.tcp_tw_recycle = 1 #4.1以后的内核废弃此参数

#关闭Tcp洪水抵御功能
net.ipv4.tcp_syncookies = 0

重新载入sysctl -p 
重启

当前TCP time wait查看

netstat 
#系统配置
sysctl -a |grep time|grep wait
sysctl -a |grep net.ipv4.tcp_tw