mysqladmin processlist -uroot -ppassword
Показывает список активных процессов mysql. Ищем медленные, думаем в чём причина.
+-------+---------+-----------+---------+---------+------+----------------+------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+---------+-----------+---------+---------+------+----------------+------------------------------------------------------------------------------------------+
| 26396 | user | localhost | project | Sleep | 85 | | |
| 26590 | user | localhost | project | Sleep | 57 | | |
| 26655 | user | localhost | project | Sleep | 183 | | |
| 26701 | user | localhost | project | Sleep | 184 | | |
| 26730 | user | localhost | project | Sleep | 20 | | |
| 26746 | user | localhost | project | Query | 6 | Sorting result | SELECT * ......
Смотрим запросы, оптимизируем, исправляем.