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

My website is being very slow or non-responsive. A quick look at the top command shows me something like this:

1709 mysql     20   0  828m  432m 5584 S 382.6  5.4   7414:24 mysqld

The rest of the processes are way below those values. Obviously MySQL is having some issues. How can I check what is actually going on and why does it take so many resources?


share|improve this question
up vote 2 down vote accepted

Run show processlist in the mysql console to get a list of the currently-running queries. Look for ones which have been running for a while, to see what they're doing. Chances are there's a few queries doing monster amounts of work (usually due to poor indexes).

share|improve this answer
Thanks that helped :) – 6bytes Nov 25 '09 at 17:41

Apart from womble's answer (which point to optimizing your queries); for those that find 382.6% CPU usage puzzling, note that MySQL is a multithreaded server. It probably was running 4 threads full-tilt, almost monopolizing 4 cores (i'm sure it can do even more in a big enough machine). Pressing 'H' on top shows each thread separately.

share|improve this answer

You should also have a look at the slow log of mysql, if it is enabled.

share|improve this answer
Yes I did check that and found out that the file is over 200MB of never seen data. I have a lot of optimizing to do now. – 6bytes Nov 26 '09 at 15:37

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.