Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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/vps27.pid --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
add comment

1 Answer 1

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: http://dev.mysql.com/doc/refman/5.5/en/thread-information.html

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
add comment

Your Answer

 
discard

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.