Multiple Processors and Load Average

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring Multiple Processors and Load Average
# 1  
Old 08-08-2013
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?
# 2  
Old 08-08-2013
"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 11:34 PM.. Reason: added the java example breakdown.
This User Gave Thanks to Smiling Dragon For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with load average?

how load average is calculated and what exactly is it difference between cpu% and load average (9 Replies)
Discussion started by: robo
9 Replies

2. Solaris

Load Average and Lwps

NPROC USERNAME SWAP RSS MEMORY TIME CPU 320 oracle 23G 22G 69% 582:55:11 85% 47 root 148M 101M 0.3% 99:29:40 0.3% 53 rafmsdb 38M 60M 0.2% 0:46:17 0.1% 1 smmsp 1296K 5440K 0.0% 0:00:08 0.0% 7 daemon ... (2 Replies)
Discussion started by: snjksh
2 Replies

3. UNIX for Advanced & Expert Users

Load average in UNIX

Hi , I am using 48 CPU sunOS server at my work. The application has facility to check the current load average before starting a new process to control the load. Right now it is configured as 48. So it does mean that each CPU can take maximum one proces and no processe is waiting. ... (2 Replies)
Discussion started by: kumaran_5555
2 Replies

4. UNIX for Dummies Questions & Answers

Load Average threshold

What should be the threshold for load average of a quad core processor? What constitutes "good" and "bad" load average values? (2 Replies)
Discussion started by: proactiveaditya
2 Replies

5. UNIX for Dummies Questions & Answers

Please Help me in my load average

Hello AlL,.. I want from experts to help me as my load average is increased and i dont know where is the problem !! this is my top result : root@a4s # top top - 11:30:38 up 40 min, 1 user, load average: 3.06, 2.49, 4.66 Mem: 8168788k total, 2889596k used, 5279192k free, 47792k... (3 Replies)
Discussion started by: black-code
3 Replies

6. UNIX for Advanced & Expert Users

Replicate CPU load to other processors in server

Hi Folks, We have 6 processors in our sun server. I do see that CPU usage by one of the processor is always more than 70-80% and for remaining 5 processors, its only 20%. Is there a way to delegate the excess CPU load on one of the processors in server to other processors in same server? Is... (3 Replies)
Discussion started by: vaibhav.kanchan
3 Replies

7. Solaris

load average query.

Hi, i have installed solaris 10 on t-5120 sparc enterprise. I am little surprised to see load average of 2 or around on this OS. when checked with ps command following process is using highest CPU. looks like it is running for long time and does not want to stop, but I do not know... (5 Replies)
Discussion started by: upengan78
5 Replies

8. Shell Programming and Scripting

Determening load average.

Hi, I'm new to shell scripting. I need to make a script to add on to my cronjobs. The script must get the value of load average from my server and if its greater than 10 it should stop my apache service. I cant find a way to get the value of load average in integer type to do the check. Any... (4 Replies)
Discussion started by: jibsonline
4 Replies

9. UNIX for Dummies Questions & Answers

Load Average

Hello all, I have a question about load averages. I've read the man pages for the uptime and w command for two or three different flavors of Unix (Red Hat, Tru64, Solaris). All of them agree that in the output of the 2 aforementioned commands, you are given the load average for the box, but... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

10. UNIX for Advanced & Expert Users

load average

we have an unix system which has load average normally about 20. but while i am running a particular unix batch which performs heavy operations on filesystem and database average load reduces to 15. how can we explain this situation? while running that batch idle cpu time is about %60-65... (0 Replies)
Discussion started by: gfhgfnhhn
0 Replies
Login or Register to Ask a Question