今晚发现网站很慢
使用netstat -ant 发现大量的TIME_WAIT
html
使用命令web
[root@web ~]# netstat -ant|awk -F [:f" "]+ '/TIME_WAIT/ {print $6,$8}'|sort|uniq -c|sort -rn|head -n10 //筛选 2万多条
tcp
[root@web ~]# iptables -I INPUT -s 120.55.197.167 -j DROP //防火墙添加一条规则 禁止ide
为了不大量的TIME_WAIT网站
[root@web ]# echo "net.ipv4.tcp_fin_timeout = 30" >> /etc/sysctl.conf //此操做修改timeout为30秒
[root@web ~]# /sbin/sysctl -p //让参数生效htm
过一会,time_wait 逐渐减小 ,网站恢复正常。
参考文章:http://blog.sina.com.cn/s/blog_8e5d24890102w9yi.htmlblog