X
  • MySQL
    September 21, 2009

What's going on inside your MySQL server?

Guest Author

Your MySQL server is under heavy load or refuses any new connections because MySQL runs out of available threads. Ever wondered why?

For me the easiest way to get a first and very helpful real-time insight in what is happening in your database server is to use the show processlist statement:

mysql> show processlist;
+--------+---------+-----------+-------------+----------------+------+--------------------+------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+--------+---------+-----------+-------------+----------------+------+--------------------+------------------------------------------------------------------+
| 426144 | DELAYED | localhost | statistics | Delayed insert | 170 | Waiting for INSERT | |
| 431669 | root | localhost | NULL | Query | 0 | NULL | show processlist |
| 431677 | mantis | localhost | mantis | Query | 0 | Sending data | SELECT \* FROM mantis_custom_field_table WHERE id='3' |
+--------+---------+-----------+-------------+----------------+------+--------------------+------------------------------------------------------------------+
3 rows in set (0.00 sec)

Only the first 100 characters of a statement are shown in the Info column. If you really need more information simply call show full processlist to get the whole complete statement information.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha