我的网站用户发现有时服务器性能不像以前那样(基本上他们说通常立即加载的页面现在可能需要 3 秒以上)。这会发生 15-30 分钟,然后服务器再次响应。
今天,就在发生这种情况时,一位用户警告了我。我有时间以 root 身份运行几个命令,这就是我发现的:
root@[redacted]:~# netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr
22 185.25.18.43
4 79.153.178.230
3 83.45.74.248
2 83.59.9.137
1 77.89.254.178
1 77.89.252.156
1 77.89.252.149
1 209.85.160.41
root@[redacted]:~# netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'
root@[redacted]@~# netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
1 142.166.98.36
1 180.76.5.194
1 79.151.200.177 …Run Code Online (Sandbox Code Playgroud)