Finding Mysql CPU Increase

Discussion in 'MySQL' started by xxclixxx, Oct 12, 2007.

  1. #1
    Hi

    I run a website where at any given time there are up to 180 people viewing a new page every 10 seconds. Everything is super fast. Oh wait, except today!

    Today I have about 100 people surfing, and MySQL keeps spiking.. up to 78% CPU. I have dual core dual processors, so it's not crashing the server.

    I'm using mytop and watching the queries, and it seems to be nothing unusual. Nothing in the slow query logs.

    Where do I go from here? It makes no sense why it's using so much CPU when it's showing no active processes...

    Thanks!
     
    xxclixxx, Oct 12, 2007 IP
  2. ste.richards

    ste.richards Guest

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is the SQL server running on a *nix platform?
     
    ste.richards, Oct 14, 2007 IP
  3. ste.richards

    ste.richards Guest

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Also to add it may be worth adding column indexing to your tables if not already.
     
    ste.richards, Oct 14, 2007 IP
  4. nwilkens

    nwilkens Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    You may want to check out: http://www.mnxsolutions.com/blog/mysql/mysql-performance-tuning.html
     
    nwilkens, Oct 14, 2007 IP
  5. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #5
    Could be due to a possible DDOS attack, spammer/hacker, or PHP overload; try rebooting your server and see if it helps.
     
    EGS, Oct 14, 2007 IP
  6. upl8t

    upl8t Peon

    Messages:
    80
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Another thing to suggest is to watch the process list. See if theirs a couple queries that are taking too long, if so explain them, see what the problem is and try to speed them up.

    It may also be a problem with your locking, if certain queries are taking a long time and locking a table, then other queries are getting locked while waiting for that one, that might have an affect on your performance, which would get worse as you add users.

    Hrmm, should have read more before I started writing. Didn't notice you were using mytop.

    So how is the performance of the website? Aside from the high CPU util. is it actually affecting the performance of the site? Is it running sluggish?

    When it's running at 78% cpu their are no processes running on the server? If so then I would check the log files for connections to the server, see if you're getting an usual number of tcp-ip connections. Could be someone DOSing you as suggested, or trying to brute force their way in possibly.
     
    upl8t, Oct 22, 2007 IP