快速清除TIME_WAIT连接
/etc/sysctl.conf中
net.ipv4.tcp_max_tw_buckets = 5000
限制了大小,超过即回收
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
设置这两项可减少time_wait占用
/sbin/sysctl -p
生效
/etc/sysctl.conf中
net.ipv4.tcp_max_tw_buckets = 5000
限制了大小,超过即回收
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
设置这两项可减少time_wait占用
/sbin/sysctl -p
生效
netstat -n|awk ‘/^tcp/{++S[$NF]}END{for (key in S) print key,S[key]}’ 查看各状态连接数分布