100% cpu utilization

This is a discussion on 100% cpu utilization within the Linux Programming forums, part of the Platform Specific Boards category; My server program seems to cap out at 50% CPU usage. I'm not sure if it's a linux thing or ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    2,503

    100% cpu utilization

    My server program seems to cap out at 50% CPU usage. I'm not sure if it's a linux thing or a MySQL thing. is there any way to force it to use more of the CPU? I have two dell poweredge 6850's with four dual core xeons, and I'm seeing that no matter what I do, I can't get the CPU usage to get above 50%. Is it possible that MySQL has some sort of limit on its CPU usage? perhaps I need to change a system setting to allow a user to use more than 50% of the CPU.

    this is killing performance on my production servers, so any and all help would be greatly appreciated.

    thanks in advance.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Perhaps you have limited the parallel threads to 4? That would explain why you only get 50% usage - half of your hardware threads would be unused.

    Or it may simply be that you've hit an I/O bottleneck. Databases are generally I/O-bound, so all that computing power might simply go to waste because the CPUs are waiting for the hard disk.

    You'll have to do some profiling.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    2,503
    Quote Originally Posted by CornedBee View Post
    Perhaps you have limited the parallel threads to 4? That would explain why you only get 50% usage - half of your hardware threads would be unused.
    where would I check for the parallel threads setting?

    Quote Originally Posted by CornedBee View Post
    Or it may simply be that you've hit an I/O bottleneck. Databases are generally I/O-bound, so all that computing power might simply go to waste because the CPUs are waiting for the hard disk.

    You'll have to do some profiling.
    the servers have 16GB of RAM, and the whole database is less than 100MB. I'll admit that some of my queries are probably not the most efficient in the world, but with that much memory, it should be no problem to cache the entire database and run from memory, updating the disk file periodically.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Well, you could run top and set it to display the CPU loads individually. Man top to find out how. That would be the first step.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    2,503
    I did that, and it was quite enlightening, but also, I optimized a few of my sql queries, which made significant improvements to performance. we'll see what happens this afternoon at our normal peak usage time.

  6. #6
    Registered User
    Join Date
    May 2008
    Posts
    1
    I found this page randomly, searching for an articla by Raymond Chen on CPU usage.

    Surely not...?
    http://blogs.msdn.com/oldnewthing/ar...02/499389.aspx

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Anonymous17 View Post
    I found this page randomly, searching for an articla by Raymond Chen on CPU usage.

    Surely not...?
    http://blogs.msdn.com/oldnewthing/ar...02/499389.aspx
    I'm not sure what you are saying "Surely not" about?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pthread question
    By quantt in forum Linux Programming
    Replies: 7
    Last Post: 04-07-2009, 01:21 AM
  2. questions on multiple thread programming
    By lehe in forum C Programming
    Replies: 11
    Last Post: 03-27-2009, 07:44 AM
  3. Upgrading my old CPU (for another old one!)
    By foxman in forum Tech Board
    Replies: 16
    Last Post: 01-11-2008, 04:41 PM
  4. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 05:57 PM
  5. CPU temp
    By PING in forum Tech Board
    Replies: 5
    Last Post: 01-28-2006, 05:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21