What's going on inside your MySQL server?

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.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Kai 'Oswald' Seidler writes about his life as co-founder of Apache Friends, creator of XAMPP, and technology evangelist for web tier products at Sun Microsystems.

Search

Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today