mysql占用了380%的cpu怎么解决?

2w2cym1i  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(296)

从昨天开始,我的cpu已经消耗了超过300%的cpu,不管访问量是增加还是减少,cpu使用率都是一样的。我在digitalocean的nginx Ubuntu18.02中。我对nginx是全新的,我可以按照digitalocean网站提供的教程来设置我的服务器。
我已经跑了大约一个月了,一切都很顺利,但是昨天mysql突然开始消耗所有的cpu,我在谷歌上搜索甚至阅读了一些堆栈解决方案,但是似乎没有什么能帮助我理解如何修复它。他们说我们应该尝试运行这个或那个,但是如何实际使用从运行这些命令得到的结果从来没有解释过。例如,我遵循了这个mysql提供的解决方案cpu使用率高,但新手很难遵循我运行的
显示进程列表;
得到了很多这样的结果

| Id      | User          | Host      | db        | Command | Time | State             | Info                                                                                                         |
+---------+---------------+-----------+-----------+---------+------+-------------------+------------------------------------------------------------------------------------------------------+
| 5015945 | root          | localhost | NULL      | Query   |    0 | starting          | SHOW PROCESSLIST                                                                                     |
| 5026029 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026036 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

026038 | wordpressuser | localhost | wordpress | Query   |    0 | Sending to client | SELECT SQL_CACHE *

| 5026039 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026041 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

| 5026047 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

| 5026048 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

| 5026049 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

| 5026050 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026051 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT SQL_CACHE *

| 5026052 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026053 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026054 | wordpressuser | localhost | wordpress | Query   |    0 | init              | SELECT tr.object_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_ta |
| 5026055 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026056 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026057 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026058 | wordpressuser | localhost | wordpress | Sleep   |    0 |                   | NULL                                                                                                 |
| 5026059 | wordpressuser | localhost | wordpress | Query   |    0 | Sending data      | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (101,50,67,288,74,103,330,107 |
+---------+---------------+-----------+-----------+---------+------+-------------------+------------------------------------------------------------------------------------------------------+"

但是,如何确切地验证是哪个导致了这个问题呢?可能有其他人引起了问题,但我如何确定它?
请给我一些指导,提供一些教程链接,指导我从头到尾通过这个过程吗?
谢谢您。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题