The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPU Usage spike

Discussion in 'General Discussion' started by labahost, Dec 20, 2007.

  1. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  2. salubrium

    salubrium Member

    Joined:
    Jun 11, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  3. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
Loading...

Share This Page