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

From time to time load on my server (centos 4)jumps to 15 or more. I need to discover what process causes this high load on server. It there any script which can handle this for me ? I think its caused by mysql so even to discover the sql query would be great help.

share|improve this question

High server load typically caused by disk I/O. There are some ways to identify which process is waiting for disk I/O:

  • iotop
  • top -b -i -n 10
  • atop and press D
  • htop -> F2 to add 2 columns IO_RBYTES and IO_WBYTES, then F6 to sort
  • ...

You should especially pay attention to the processes in D state (uninterruptible sleep):

watch "ps -eo pid,user,state,command | awk '\$3 == /D/ { print \$0 }'"
share|improve this answer

look for something with a long runtime.

then EXPLAIN to see if it's making full table scans, generating temp tables, etc.

Otherwise, you can use something like the free version of Jet ( )


share|improve this answer
Another tool to look at is Innotop ( a top clone for MySQL. Also check out the Percona Toolkit ( – slillibri Sep 29 '11 at 18:32

If it is the case that mysql is the cause of the high load, then Mysql supports a slow_query_log argument, and once enabled it will log any particularly slow queries to a file;

The slow query log consists of SQL statements that took more than long_query_time seconds to execute and required at least min_examined_row_limit rows to be examined. The minimum and default values of long_query_time are 0 and 10, respectively.

share|improve this answer

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.