labahost

Well-Known Member
May 4, 2004
56
0
156
Today we had CPU usage spike of more than 80% and top -b showed only few processes using just less than 3% with the only abnormality being mysql using more than 40% of RAM.
PHP sites started to break because they couldn't connect to database.
I've restarted mysql and everything went smooth as it was before.
But the question is what was it? How can I find what account caused it? What you usually do about such things?
 

salubrium

Member
Jun 11, 2003
14
0
151
Sydney
cPanel Access Level
Root Administrator
If it's a one off, I would probably let it go and just log the date, time and what happened to give me some info in case it happened again. If it happens again I would spend more time trying to figure out what happened.

In the meantime, to be prepare in case it happens again and seems it's at the mysql end rather than Apache, you may want to familiarise yourself with "top" for mysql:

http://mtop.sourceforge.net/mtop.html

and / or learn a little about the > SHOW PROCESSLIST; command from mysqladmin tool and possibly start logging slow queries in mysql via slow_query_log:

http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
 

labahost

Well-Known Member
May 4, 2004
56
0
156
Thank you very much, I'll investigate it.

BTW: Munin showed during that time a lot of iowaits, what may be the cause of it?