There is a type of query called a "slow query" which is much like it sounds: queries that take a long time to execute. In some cases, these queries are legitimately long but in the vast majority of cases a slow query indicates some poorly written code or a lack of resources on the server causing MySQL to become I/O bound.
In either case, if you're seeing mysql spikes then a very, very good place to start is by identifying your slow queries.
I'm not enough of a MySQL guru to pull this off of the top of my head, but in short you want to:
- Turn on slow query logging (it is off by default in most distributions)
- Let it run for a bit
- Look at the log to see what queries are your culprits
I'm not even going to attempt to pull instructions off the top of my head, but you can start with this link:
And if this link expires or becomes otherwise useless, the phrase to search for is something like 'log mysql slow queries'.
Once you have them logging, you are well on your way to sorting them out.