From cPanel server we can check MySQL process list with the different ways.As we all know for most of the production servers it is necessary to check MySQL process list for monitoring the currently running queries and to discovering queries that slow down the website loading speed.
From command line we can check MySQL process list with the following ways:
Go to MySQL by using the following command:
mysql
After that enter the command:
show processlist;
mysql> show processlist;
+——–+————–+———–+————–+———+——+——-+——————+
| Id | User | Host | db | Command | Time | State | Info |
+——–+————–+———–+————–+———+——+——-+——————+
| 7605 | eximstats | localhost | eximstats | Sleep | 296 | | NULL |
| 218382 | modsec | localhost | modsec | Sleep | 4181 | | NULL |
| 219303 | leechprotect | localhost | leechprotect | Sleep | 3926 | | NULL |
| 219552 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+——–+————–+———–+————–+———+——+——-+——————+
4 rows in set (0.00 sec)
Another way from the command line to check the result of process list during a specific interval of time is as follows:
mysqladmin -i 4 processlist
It will display as:
—————+
| Id | User | Host | db | Command | Time | State | Info |
+——–+————–+———–+————–+———+——+——-+——————+
| 7605 | eximstats | localhost | eximstats | Sleep | 196 |
| 218382 | modsec | localhost | modsec | Sleep | 4081 |
| 219303 | leechprotect | localhost | leechprotect | Sleep | 3826 |
| 219544 | root | localhost | | Query | 0 | | show processlist |
+——–+————–+———–+————–+———+——+——-+——————+