在其中一台服务器上,我将 mysqld 作为从属数据库运行。
mysqld 当前的 CPU 使用率为 175%。
以下是 SHOW PROCESSLIST 的结果;
+----------+-------------+-----------+---------+---------+---------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----------+-------------+-----------+---------+---------+---------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| 109029 | system user | | NULL | Connect | 2346123 | Waiting for master to send event | NULL |
| 109030 | system user | | NULL | Connect | 0 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL |
| 12944426 | root | localhost | NULL | Query | 0 | NULL | SHOW PROCESSLIST |
| 12944443 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944445 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944463 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944466 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944467 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944469 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944470 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944471 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944476 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944479 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944482 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944484 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944485 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944488 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944490 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944491 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944492 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944493 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944495 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944496 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944498 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944499 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944501 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944502 | mdpipub | localhost | mdpipub | Query | 0 | Sending data | SELECT DISTINCT(article_id) FROM authors WHERE CONCAT(
firstname,
|
| 12944503 | mdpipub | localhost | mdpipub | Sleep | 0 | | NULL |
| 12944504 | mdpipub | localhost | mdpipub | Query | 0 | Sending data | SELECT DISTINCT(article_id) FROM authors WHERE CONCAT(
firstname,
|
+----------+-------------+-----------+---------+---------+---------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
答案1
这是因为有 2 个潜在的繁重 SELECT 查询正在运行。然后,所有线程的负载加在一起用于主进程,可能会显示超过 100%。
答案2
我资助了这个问题。有人不断执行网站上的搜索功能,对我的服务器进行了攻击。我刚刚封禁了这个 IP,目前一切正常。