High MySQL load

From GigaTux Wiki
Revision as of 11:34, 29 October 2012 by Cocodude (talk | contribs) (→mytop)
Jump to navigation Jump to search

Verify that MySQL is causing high load

If you notice high load on a cPanel server, it's worth running atop -dl to see whether it could be MySQL performing a lot of reads and writes to the database. If it looks like a likely culprit, then it's worth investigating what user queries are performing.

Real time MySQL monitoring

mytop

mytop will show what MySQL is doing in real time. The most useful mode is accessed by pressing Q which is the real time query mode. Press i to hide inactive connections. mytop can be started by running mytop -d mysql with a -s flag to specify the refresh delay.

innotop

A useful program called innotop (installed in /root on cPanel servers) can be used to see InnoDB MySQL queries in realtime. You can run this command with the -d flag to specify how often it should update.