When my MySQL server is getting overloaded what I run is mytop
; which gives me a complete breakdown of all the queries executing on the server. This is especially useful because it makes it easy to sort by long running queries which are usually the culprit.
However, if you don't have mytop
you can do the following:
SHOW FULL PROCESSLIST;
will give you a dump of all running queries on the server.
- Once you determine the query you can run
EXPLAIN EXTENDED
on that query.
- If it's InnoDB you can run
SHOW ENGINE INNODB STATUS
to get a full report on the status of InnoDB as well as any errors.
- If its a large table make sure the indexes are up to date.
Whatever you do, do not restart the server as it's just going to occur again in the future.