LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-17-2012, 12:37 PM   #1
sparkey
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Rep: Reputation: 0
CPU usage not balanced over all cores


Hi,

Please tell me if the below is normal? I am running apache2 on a webserver but i cant get ubuntu to sort the load on the different cpu cores. As stated below it preferes to but everything on cpu0 but i would rather have it balanced over all the cores.

I am running Ubuntu 12.04 on ESXi 5.0.

Code:
Linux 3.2.0-23-generic (Server)  2012-09-17      _x86_64_        (12 CPU)

19:34:00     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
19:34:00     all    0,62    0,00    0,21    0,00    0,00    0,08    0,00    0,00   99,09
19:34:00       0    6,05    0,00    0,87    0,00    0,00    0,99    0,00    0,00   92,08
19:34:00       1    0,37    0,00    0,23    0,00    0,00    0,00    0,00    0,00   99,39
19:34:00       2    0,14    0,00    0,07    0,00    0,00    0,00    0,00    0,00   99,79
19:34:00       3    0,05    0,00    0,01    0,00    0,00    0,00    0,00    0,00   99,94
19:34:00       4    0,03    0,00    0,01    0,00    0,00    0,00    0,00    0,00   99,96
19:34:00       5    0,02    0,00    0,01    0,00    0,00    0,00    0,00    0,00   99,97
19:34:00       6    0,02    0,00    0,02    0,00    0,00    0,00    0,00    0,00   99,96
19:34:00       7    0,57    0,04    1,02    0,01    0,00    0,00    0,00    0,00   98,35
19:34:00       8    0,03    0,00    0,06    0,00    0,00    0,00    0,00    0,00   99,91
19:34:00       9    0,06    0,00    0,11    0,00    0,00    0,00    0,00    0,00   99,82
19:34:00      10    0,01    0,00    0,01    0,00    0,00    0,00    0,00    0,00   99,98
19:34:00      11    0,05    0,00    0,09    0,00    0,00    0,00    0,00    0,00   99,86
Here is also a printscreen of the htop command.
http://tinypic.com/r/35jh1g7/6

Best regards

Last edited by sparkey; 09-17-2012 at 12:42 PM.
 
Old 09-17-2012, 02:07 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,985

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
In my experience, that is completely normal.
 
Old 09-17-2012, 02:59 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sparkey View Post
i would rather have it balanced over all the cores.
Why?

When the CPU load is so light that one core is more than you need, why do you care how that load is distributed?
 
Old 09-17-2012, 03:44 PM   #4
sparkey
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Sometimes it spikes 100% on one core and almost anything on the others. When that happens i experience lag on the website.
 
Old 09-17-2012, 03:55 PM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sparkey View Post
When that happens i experience lag on the website.
Correlation does not imply causation.

You have lots of apache2 processes (probably too many). It is very unlikely that anything is restricting the apache2 processes to one core or restricting the work to one apache2 process.

So when the system is lagging, it is very likely that either the internet access bandwidth or the disk drive is the limiting factor and the CPU is not a limiting factor.

Under those conditions, one core might be near 100% usage. But that does not imply that having one core near 100% usage caused the lag.

Last edited by johnsfine; 09-17-2012 at 04:01 PM.
 
Old 09-17-2012, 04:32 PM   #6
sparkey
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnsfine View Post
Correlation does not imply causation.

You have lots of apache2 processes (probably too many). It is very unlikely that anything is restricting the apache2 processes to one core or restricting the work to one apache2 process.

So when the system is lagging, it is very likely that either the internet access bandwidth or the disk drive is the limiting factor and the CPU is not a limiting factor.

Under those conditions, one core might be near 100% usage. But that does not imply that having one core near 100% usage caused the lag.
No i do not have too many processes running. We also have the latest HP ProLiant DL360 Gen8 with lots of resources to go with. The server is also hooked up to dual 1Gbit/s WAN and SAS2 15k RPM in RAID10 running so the chance of my hardware being to crappy is below zero.

I see what you mean but it can't be a coincidence that when it spikes i can see one core being 100% due to the other being close to 0%.
 
Old 09-17-2012, 08:09 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Not all programs are fully smp let alone ones that can support more than 4 cores.
This may include drivers too so that any part of any operation could be limited to a single core.


Just curious, you only have one guest OS on esxi?

Last edited by jefro; 09-17-2012 at 08:59 PM.
 
Old 09-18-2012, 05:04 AM   #8
sparkey
LQ Newbie
 
Registered: Nov 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
Not all programs are fully smp let alone ones that can support more than 4 cores.
This may include drivers too so that any part of any operation could be limited to a single core.


Just curious, you only have one guest OS on esxi?
Okay i see thanks. I see activity though on the other cores but not from apache it seems.

I am running only one more VM atm with near to 0 load atm due to that it has not yet been put in production.
 
Old 09-18-2012, 05:20 AM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I'm sorry if this has already been looked at (I'm far from knowledgeable abut these things) but could this be caused by Apache MPM settings?
http://httpd.apache.org/docs/2.2/mpm.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU cores usage mikes88 Solaris / OpenSolaris 7 03-20-2012 05:44 PM
[SOLVED] Are all of my CPU-cores working? Weapon S Linux - Hardware 6 02-04-2012 09:32 AM
Software and CPU Cores DIGITAL39 Linux - Software 8 10-10-2007 02:47 AM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration