LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2011, 01:09 AM   #1
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
Linux CPU load average


Hey,

I have a small query regarding the load averages on a multi-core machines.

If a single core machine has load avg of 1,does it mean that CPU utilization is 100 %?

For a dual core,does a load of 2.0 mean ,the cpu utilization is 100 % or 50 %?

my machine specs are:
Code:
grep -i siblings /proc/cpuinfo
siblings        : 2
So,what would the loadavg of 1,2,4 in percentages should be ?

my calculation is
Code:
cores  loadavg   cpu %
  1       1        100 
  2       1         50
  4       1         25
Is the calculation right?

Thanks !
 
Old 03-02-2011, 01:33 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Almost. Linux includes processes in I/O wait, so CPU utilization doesn't map directly to load. A system can have a low CPU utilization and still have a high load in this case. See the Wikipedia description.
 
Old 03-02-2011, 02:26 AM   #3
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
From wikipedia
Quote:
For example, one can interpret a load average of "1.73 0.50 7.98" on a single-CPU system as:

* during the last minute, the CPU was overloaded by 73% (1 CPU with 1.73 runnable processes, so that 0.73 processes had to wait for a turn)
* during the last 5 minutes, the CPU was underloaded 50% (no processes had to wait for a turn)
* during the last 15 minutes, the CPU was overloaded 698% (1 CPU with 7.98 runnable processes, so that 6.98 processes had to wait for a turn)
If i apply "1.73 0.50 7.98" on dual core machine does it mean:

-for last minute the cpu was overloaded by 73% i.e 73/2 = 36% per proc ?
-for last 5 minute the cpu was under loaded by 50% i.e 50/2 = 25% per proc ?
 
Old 03-02-2011, 09:31 AM   #4
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Quote:
Originally Posted by kdelover View Post

my calculation is
Code:
cores  loadavg   cpu %
  1       1        100 
  2       1         50
  4       1         25
Is the calculation right?

Thanks !
Your calculation seems correct.

1 core and 1 loadavg means 100% CPU utilization.
For 2 cores the loadavg has to be 2 to mean 100% CPU utilization.

A loadavg of .75 should signal the System Admin to look into it before the system/server gets worse- a proactive action.

A loadavg of .9 and above means critical state and requires immediate action to be taken to prevent a system crash! Well, the system may not crash at all but a lot of jobs can fail to run. I have seen it practially. Once I was working for a client and the server's loadavg reached so much hight that even "clear" would fail to run.
 
Old 03-02-2011, 11:46 AM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Quote:
Originally Posted by kdelover View Post
If i apply "1.73 0.50 7.98" on dual core machine does it mean:

-for last minute the cpu was overloaded by 73% i.e 73/2 = 36% per proc ?
-for last 5 minute the cpu was under loaded by 50% i.e 50/2 = 25% per proc ?
Assuming no I/O wait, that would be correct. However, if you have many processes in wait, the CPU will likely be low while the load is high. Examples from Wikipedia include a slow I/O device or NFS mount.

The better way to think of load on Linux is as a measure of system response time. The higher the number, the less responsive. If you want a measure of CPU load exclusively, use top or sar.

Last edited by macemoneta; 03-02-2011 at 11:47 AM.
 
Old 03-02-2011, 12:18 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Dodgy software can place threads (incorrectly) in uninterrupable sleep, and drive the load way past 100 - with no (response) effect on anything. Apache for example.

loadavg, like %wa, is a barely useful metric. Especially when it's not properly understood, and interpreted in relation to the specific computing environment involved.
 
Old 03-02-2011, 12:40 PM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
To clarify, the response time I was referring to is process response time (how quickly processes are being serviced), not interactive response. You're correct that interactive response may not be impacted at all, even with a high load.
 
  


Reply



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
Get load average for cpu core chamila1986 Linux - General 6 05-19-2010 05:40 AM
How can I get the system's cpu Load Average by c. davyzhang Programming 12 08-03-2007 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 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