problem:
So many TIME_WAIT connection in server.
SocketsUsageWarning: Active: 2570; TIME_WAIT: 2507; Usage: 97%
tcp 0 0 10.xxx.xxx.xxx:80 10.xx.xx.xx:25270 TIME_WAIT
tcp 0 0 10.xxx.xxx.xxx:80 10.xx.xx.xx:52659 TIME_WAIT
tcp 0 0 10.xxx.xxx.xxx:80 10.xx.xx.xx:52915 TIME_WAIT
tcp 0 0 10.xxx.xxx.xxx:80 10.xxx.xx.xx:5040 TIME_WAIT
Solution:
[root@aaa1 ~]#vi /etc/sysctl
增 加或修改net.ipv4.tcp_tw值:
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
使内核参数生效:
[root@aaa1 ~]# sysctl -p
[root@aaa1 ~]# sysctl -a|grep net.ipv4.tcp_tw
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/223555/viewspace-705875/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/223555/viewspace-705875/