sh-3.2# scripts]# netstat -an|awk '/tcp/ {++S[$NF]}END {for (a in S) print a,S[a]}'
TIME_WAIT
ESTABLISHED
LISTEN
sh-3.2# scripts]# cat /etc/sysctl.conf|awk '/net.ipv4.tcp_syncookies|net.ipv4.tcp_tw_reuse|net.ipv4.tcp_tw_recycle|net.ipv4.tcp_fin_timeout/'
net.ipv4.tcp_syncookies =
可见上面的/proc/sys/net/ipv4相关参数并没有设置:
修改如下:
[root@Salt85 scripts]# cat /etc/sysctl.conf|awk '/net.ipv4.tcp_syncookies|net.ipv4.tcp_tw_reuse|net.ipv4.tcp_tw_recycle|net.ipv4.tcp_fin_timeout/'
net.ipv4.tcp_syncookies =
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_fin_timeout =
[root@Salt85 scripts]# netstat -an|awk '/tcp/ {++S[$NF]}END {for (a in S) print a,S[a]}'
TIME_WAIT
ESTABLISHED
LISTEN
解决TIME_WAITE过多的问题