我的服务器出现了性能问题,加载速度很慢,页面无法加载等,因此我通过 SSH 登录后运行了“top”命令。我注意到,当实际上没有人访问网站时,CPU 一直处于 40% 左右的波动中。我还有其他(性能低得多的)服务器,其静态心率在 1-5% 之间,所以我知道出了问题。我登录 MySQL,启用常规日志记录,我发现:
event_time Descending 1 user_host thread_id server_id command_type argument
2014-09-20 04:35:07 [root] @ localhost [] 46833 0 Connect root@localhost on
2014-09-20 04:35:07 [root] @ localhost [] 46834 0 Connect root@localhost on
2014-09-20 04:35:04 [root] @ localhost [] 46832 0 Connect root@localhost on
2014-09-20 04:35:03 [root] @ localhost [] 46829 0 Connect root@localhost on
2014-09-20 04:35:03 [root] @ localhost [] 46830 0 Connect root@localhost on
2014-09-20 04:35:03 [root] @ localhost [] 46831 0 Connect root@localhost on
2014-09-20 04:34:58 [root] @ localhost [] 46828 0 Connect root@localhost on
2014-09-20 04:34:57 [root] @ localhost [] 46827 0 Connect root@localhost on
2014-09-20 04:34:48 [root] @ localhost [] 46826 0 Connect root@localhost on
2014-09-20 04:34:41 [root] @ localhost [] 46823 0 Connect root@localhost on
2014-09-20 04:34:41 [root] @ localhost [] 46824 0 Connect root@localhost on
2014-09-20 04:34:41 [root] @ localhost [] 46825 0 Connect root@localhost on
2014-09-20 04:34:39 [root] @ localhost [] 46822 0 Connect root@localhost on
2014-09-20 04:34:37 [root] @ localhost [] 46821 0 Connect root@localhost on
2014-09-20 04:34:36 [root] @ localhost [] 46820 0 Connect root@localhost on
2014-09-20 04:34:33 [root] @ localhost [] 46819 0 Connect root@localhost on
2014-09-20 04:34:30 [root] @ localhost [] 46818 0 Connect root@localhost on
2014-09-20 04:34:29 [root] @ localhost [] 46815 0 Connect root@localhost on
2014-09-20 04:34:29 [root] @ localhost [] 46816 0 Connect root@localhost on
mySQL 每分钟要处理大约 100 个“连接”命令。我确信这就是导致我的性能问题的原因。但我的问题是我不知道这些命令来自哪里,也不知道如何追踪来源。有什么想法吗?
答案1
受到暴力攻击或只是卡在连接循环中,更可能是由于您安装了有缺陷的应用程序,您最近安装了什么?