网站CPU使用100%打不开偶尔出现502 太多TIME_WAIT进程怎么办?

1G1H的VPS,网站流量基本差不多在5万IP左右,WP搭建的,一直没问题就最近开始网站卡死,或者报错502,特别是我登陆后台操作后,直接打不开网站了。

进程里面全是如下报警:

协议 本地地址 远程地址 状态 进程 PID
tcp 192.45.217.65:80 183.21.241.26:42642 TIME_WAIT python null
tcp 192.45.217.65:80 113.81.161.89:28648 TIME_WAIT python null
tcp 192.45.217.65:80 122.136.105.123:56818 TIME_WAIT python null
tcp 192.45.217.65:80 121.239.70.214:50585 TIME_WAIT python null
tcp 192.45.217.65:80 121.239.37.200:33758 TIME_WAIT python null
tcp 192.45.217.65:80 106.85.245.188:5626 TIME_WAIT python null
tcp 192.45.217.65:80 122.136.105.123:56814 TIME_WAIT python null
tcp 192.45.217.65:80 175.44.207.222:11169 TIME_WAIT python null
tcp 192.45.217.65:80 106.47.247.152:30541 TIME_WAIT python null
tcp 192.45.217.65:80 110.187.222.158:35648 TIME_WAIT python null
tcp 192.45.217.65:80 222.209.12.181:7491 TIME_WAIT python null
tcp 192.45.217.65:80 211.138.116.185:29226 TIME_WAIT python null
tcp 192.45.217.65:80 223.104.95.65:23647 TIME_WAIT python null
tcp 192.45.217.65:80 153.0.4.27:50148 TIME_WAIT python null
tcp 192.45.217.65:80 171.106.61.59:29444 TIME_WAIT python null
tcp 192.45.217.65:80 121.239.70.214:60782 TIME_WAIT python null
tcp 192.45.217.65:80 110.187.222.158:35584 TIME_WAIT python null
tcp 192.45.217.65:80 27.201.236.227:48207 TIME_WAIT python null
tcp 192.45.217.65:80 66.249.79.76:59062 TIME_WAIT python null
tcp 192.45.217.65:80 1.195.24.3:48572 TIME_WAIT python null
tcp 192.45.217.65:80 124.152.132.168:32362 TIME_WAIT python null

百度了TIME_WAIT解决方法,也加了代码:

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30

没有效果,仍然出现无法打开现象。

求大神们帮忙看看怎么回事?

阅读 2.5k
1 个回答

查查数据库, 看看有没有慢查询? 你上面的有127.0.0.1:3306的,应是MySQL的连接吧
下面都是python的连接? 为什么两端都是127.0.0.1? 是代理?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题