解决netstat中TIME_WAIT过多的问题

调节内核参数:
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 30

如果,你的服务器,和所有可能的客户,都不处于NAT环境,还可以打开
net.ipv4.tcp_tw_recycle = 1

这里要注意一点,普通公网的机器不能起用回收,否则会导致问题。
参考:
http://zhangle.is-a-geek.org/2010/11/tcp_tw_recycle%E5%92%8Cnat/

Leave a Reply

Your email address will not be published. Required fields are marked *