Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently mysql started loading very high cpu. the process is like that:

/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/vps.err --open-files-limit=8192 --pid-file=/var/lib/mysql/ --socket=/var/lib/mysql/mysql.sock --port=3306

Is there a way to find out which mysql user/database is currently behind that process?

share|improve this question
You won't get that sort of data from the process listings. You will need to use the MySQL Administrator (end of life) or the MySQL workbench to see which user/database is is executing queries during the high CPU loads. – Tim Jan 21 '12 at 13:57
up vote 0 down vote accepted

Use mytop to determine what threads are exhausting your cpu.

If mytop is not an option, use mysqladmin to show the processlist, and look for threads that is running slow transactions:

share|improve this answer
the point is that they are not slow. all the queries on a page take max 0.01 seconds to load. i just don't know why so much cpu is used – develroot Jan 21 '12 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.