Score:0

High CPU from 1 process that's MYSQLD, but no abnormal queries while doing SHOW FULL PROCESSLIST

fk flag

I have an issue where 2 processes take 99% of the CPU, but that leaves me the mysqld process that takes 600% of the CPU and a set of php-fpm processes that takes no more than 25% of the CPU according to top (2 process alive and 603 processes sleeping, one of them is the mysqld and the other seems to be a php-fpm, so it's not coming from too many clients), so I am wondering what might cause the high CPU usage, because doing SHOW FULL PROCESSLIST gives me nothing but a few SELECT commands like 2 or 3, and nothing out of ordinary, how do I find out what's wrong? I was told it's the rsync process, but the rsync process should only take a lot of IO and no CPU usage, and the issue is that CPU is at 99% when there's only 2 process, and doing SHOW FULL PROCESSLIST doesn't reveal why the CPU usage is so high, so how do you debug this? Is there a command that allows you to check past MYSQL queries, because I was told if there's a dump to MYSQL it won't necessary appear when I run SHOW FULL PROCESSLIST, so I am wondering if there's a way to check all of the queries that were completed recently instead.

Michael Hampton avatar
cz flag
Check the slow query log.
ua flag
When you find the naughty query via the slowlog, use stackoverflow.com to ask for optimization help.
Wilson Hauck avatar
jp flag
Consider posting to pastebin.com TEXT results of A) htop and B) SHOW FULL PROCESSLIST; so we can see your available information. This url may convince you to avoid DIRECT rsync use - https://www.sitepoint.com/community/t/backup-mysql-with-rsync/61927 and last, 603 sleeping processes when your server is essentially idle is a clue someone is not using CLOSE to end the connection when done with processing. Please post your code that CONNects, PROCESSESS and CLOSES the connection into pastebin.com and share the links.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.