Results 1 to 3 of 3

Thread: mysql CPU spikes? are they normal?

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    61

    Default mysql CPU spikes? are they normal?

    on our server (PIV 2GHz, redhat 9, 1GB RAM), when I browse my one website and watch top in shell, mysqld takes up 99.9% of the CPU on some of the queries (sure only for a very brief moment but still, let me continue).

    I have the same website (same coding, same database, same php version, same mysql version) installed locally on OS X here (a 1GHz G4 powerbook), and out of curiosity, I ran my local site and top in terminal as well. under OS X, the same queries that were taking 99.9% CPU on our server, were only taking ~1% CPU , topping off occasionally at ~3-4% CPU.

    Now we just recently got the server, and at the time I ran this test, I am the only one on my server using a site with mySQL. Now I know the OSes here are a bit different, and the CPU arcitecture is far different as well, but surely these 2 system are not so far different that a mySQL query will eat up 99.9% CPU on redHat but only ~1% on my Mac under basically the same conditions??

    Is this normal for mysqld to spike 99.9% CPU on x86 machines and/or OSes? If so then i guess nothing much I can do, though I don't really like it (guess I could pray for the day I can afford an XServe)

  2. #2
    Member
    Join Date
    Jan 2004
    Location
    fort wayne
    Posts
    5

    Default

    There are a LOT of configuration settings in the system and mysql(and even things like Apache) that can affect this. They are probably different. ALSO, a cache filled with non-relevant data will take MUCH longer, and be more CPU intensive than one with data it can use, or that is empty.

    TWO LARGE TABLES A and B(on a just booted machine withe plenty of cache)

    select * from A (moderate) (load cache while reading)
    select * from B (slow)(manage cache and load while reading)
    select * from A (slow)(")
    select * from A (fast)(select from cache)

    Steve

  3. #3
    Member
    Join Date
    Dec 2001
    Posts
    1,558

    Default

    You may want to look into opomizing your my.cnf if you haven't done so already, or if you have, you may want to look into tweaking it a little further. There are other things to look at as well but I'd end up writting a book about it. There are a lot of sources of information out there, just google it up.
    Beau Henderson

Similar Threads

  1. After 11.25 upgrade to 11.28 huge cpu spikes
    By MakeHosting in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 02-09-2011, 11:39 PM
  2. Replies: 26
    Last Post: 11-24-2010, 01:34 PM
  3. is 8% cpu load daily whm cpanel report normal?
    By jacksony in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 01-30-2006, 12:28 PM
  4. crazy cpu spikes all day long
    By Secret Agent in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 04-13-2005, 08:16 PM
  5. CPU Spikes
    By WestBend in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 09-09-2004, 08:02 PM