[LA-discussions] [TECH] Processes MySQL |
[ Thread Index |
Date Index
| More linuxarverne.org/discussions Archives
]
Bonjour,
Savez-vous comment débugguer des requêtes MySQL ?
Je dois avoir une mauvaise requête qui reste plantée là, à attendre.
J'ai fais quelques recherches, pour trouver la commande "show
processlist". Puis "kill <id de la requete>".
Ça marche, mais je ne sais pas comment corriger la cause.
Ci-dessous un exemple. Il m'a suffit de tuer la requête la plus ancienne
pour que toutes les autres disparaissent.
La colonne "Info" ne donne que NULL et pas la requête causant ça :-/
Merci
Yann.
mysql> show processlist;
+---------+---------+-----------+------------+---------+-------+-------+------------------+
| Id | User | Host | db | Command | Time | State |
Info |
+---------+---------+-----------+------------+---------+-------+-------+------------------+
| 1707338 | cochard | localhost | cochard_cf | Sleep | 95966 | |
NULL |
| 1834667 | cochard | localhost | cochard_cf | Sleep | 49154 | |
NULL |
| 1834876 | cochard | localhost | cochard_cf | Sleep | 49034 | |
NULL |
| 1847515 | cochard | localhost | cochard_cf | Sleep | 43719 | |
NULL |
| 1847551 | cochard | localhost | cochard_cf | Sleep | 43699 | |
NULL |
| 1922996 | cochard | localhost | cochard_cf | Sleep | 15638 | |
NULL |
| 1924127 | cochard | localhost | cochard_cf | Sleep | 15322 | |
NULL |
| 1931998 | cochard | localhost | cochard_cf | Sleep | 12977 | |
NULL |
| 1932001 | cochard | localhost | cochard_cf | Sleep | 12977 | |
NULL |
| 1932148 | cochard | localhost | cochard_cf | Sleep | 12938 | |
NULL |
| 1944183 | cochard | localhost | cochard_cf | Sleep | 9196 | |
NULL |
| 1944551 | cochard | localhost | cochard_cf | Sleep | 9083 | |
NULL |
| 1951423 | cochard | localhost | cochard_cf | Sleep | 7259 | |
NULL |
| 1953484 | cochard | localhost | cochard_cf | Sleep | 6795 | |
NULL |
| 1954164 | cochard | localhost | cochard_cf | Sleep | 6586 | |
NULL |
| 1956080 | cochard | localhost | cochard_cf | Sleep | 6134 | |
NULL |
| 1957072 | cochard | localhost | cochard_cf | Sleep | 5879 | |
NULL |
| 1966624 | cochard | localhost | cochard_cf | Sleep | 3856 | |
NULL |
| 1984833 | cochard | localhost | NULL | Query | 0 | NULL |
show processlist |
| 1984857 | cochard | localhost | cochard_cf | Sleep | 0 | |
NULL |
+---------+---------+-----------+------------+---------+-------+-------+------------------+
20 rows in set (0.00 sec)
mysql> kill 1707338;
Query OK, 0 rows affected (0.00 sec)
mysql> show processlist;
+---------+---------+-----------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info
|
+---------+---------+-----------+------+---------+------+-------+------------------+
| 1984833 | cochard | localhost | NULL | Query | 0 | NULL | show
processlist |
+---------+---------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)
---
Liste de discussions de LinuxArverne
http://wiki.linuxarverne.org/listes_de_diffusion