Unix/Linux Go Back    


Infrastructure Monitoring Forum for Nagios, Zabbix and other network monitoring and management tools.

Multiple Processors and Load Average

Infrastructure Monitoring


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-08-2013
indiansoil indiansoil is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 13 September 2013, 8:25 AM EDT
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Multiple Processors and Load Average

The following information shows that there are in total 4 Processors on this machine:


Code:
$ grep -i name /proc/cpuinfo
model name      : Dual-Core AMD Opteron(tm) Processor 2218
model name      : Dual-Core AMD Opteron(tm) Processor 2218
model name      : Dual-Core AMD Opteron(tm) Processor 2218
model name      : Dual-Core AMD Opteron(tm) Processor 2218

Does the command top reveal this information clearly?


Code:
$ top -b -n 1 | head
top - 08:52:40 up 1516 days, 16:57,  2 users,  load average: 1.12, 1.26, 1.32
Tasks:  97 total,   1 running,  96 sleeping,   0 stopped,   0 zombie
Cpu(s): 18.2%us,  3.4%sy,  0.0%ni, 77.9%id,  0.3%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:  32967244k total, 32844284k used,   122960k free,   216240k buffers
Swap:  2096472k total,   105872k used,  1990600k free,  2005636k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
25437 root      23   0 22.7g  22g 9272 S 142.9 70.6  42140:15 java

Besides, the load average is:
1.12, 1.26, 1.32
over 1 which means over 100% CPU utilization. But what I understand is if there are 4 processors then the value of 1 would mean only 25% CPU utilization in total. Is this correct?

Next, the top command shows that the following java process is utilizing 142.9% of the CPU resource:


Code:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
25437 root      23   0 22.7g  22g 9272 S 142.9 70.6  42140:15 java

Is this value relative to the total capacity of the CPU (with all its 4 processors)?

Can you please help me make it clear to myself what those things (4 processors, load average, 142.9 %CPU for Java) are showing exactly? How do they relate to each other?
Sponsored Links
    #2  
Old Unix and Linux 08-08-2013
Smiling Dragon's Unix or Linux Image
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
 
Join Date: Nov 2007
Last Activity: 27 July 2017, 4:23 PM EDT
Location: New Zealand
Posts: 1,060
Thanks: 25
Thanked 29 Times in 28 Posts
"Load average" in top is actually the run queue average length.
Over 1 means on average things are waiting on the cpu, below 1 means on average no-one has to wait. Don't confuse this with %cpu - it's not like that.

The bold summary line show percentages should always be across all the cores, but can get confused if you have the wrong version of top, so always add them up to check you get 100 the first time you use top on a new machine to check this.

As for process %cpu, that depends on your version of top - if it's compiled for your arcihtecture properly, it understands and the % is how much of one CPU is beign used (so more than 100% would require multithreading across multiple cores).

To complicate matters further, a system running at 100% cpu might not be terrible if your shceduler is beign smart - it could well be that you've got a bunch of low priority things in the background that get a bunch of work done while the system is idel, then throtle back when you need it - ie sitting at 100% you might still find that your CPU hungry command you want to run goes just fine and the cpu load happily stays at 100% during and after. It's often a waste of time to monitor CPU percentages overall.
Better is to look at:
* overall wait % ("wa") - you don't want that to get very high or it indicates something is thrashing in swap or disk.
* run queue length

In your java example:

Code:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
25437 root      23   0 22.7g  22g 9272 S 142.9 70.6  42140:15 java

Its saying that you have a Priority 23 task, (lower numbers get priority on CPU time) using 70.6% of your free memory and 142.9% of one CPU (ie it's multithreaded and is using about 1.5 Cores).

Last edited by Smiling Dragon; 08-08-2013 at 10:34 PM.. Reason: added the java example breakdown.
The Following User Says Thank You to Smiling Dragon For This Useful Post:
figaro (08-11-2013)
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with load average? robo UNIX for Dummies Questions & Answers 9 09-26-2011 02:08 PM
Please Help me in my load average black-code UNIX for Dummies Questions & Answers 3 04-07-2009 11:20 PM
Replicate CPU load to other processors in server vaibhav.kanchan UNIX for Advanced & Expert Users 3 02-24-2009 07:53 AM
Load Average Heathe_Kyle UNIX for Dummies Questions & Answers 3 10-24-2006 03:57 PM
load average gfhgfnhhn UNIX for Advanced & Expert Users 0 09-12-2006 11:49 AM



All times are GMT -4. The time now is 02:11 PM.