Do you have any cron jobs or does the application has any re-indexing jobs that it runs regularily?

And when you get it the next time, run the SHOW PROCESSLIST command and read thru _all_ the rows. Or better yet post them her also in an attachment. And please make it a text file since it is a much easier format to filter.

Because you have something that is taking a lot of CPU and it isn't the amount of processes since most of them was waiting for opening a table, I think that it is just a secondary effect since they can't open the table they want to and then the mysql threads are delayed and that is when they start to pile up.

Comment

Yes, there are some cronjobs, but they just insert some rows (up to 100 rows per run, usually about 20-50 rows) to database and exit. I'll check these cronjobs, but they are really simple - a few lines of code to insert several rows of data.