LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-30-2013, 03:08 AM   #1
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
CPU Load Average


Code:
echo -ne "Total Number of Processors: " ; grep -c processor /proc/cpuinfo ; uptime 


Total Number of Processors: 32
  09:01:10 up 232 days, 13:56, 8 users, load average: 5.10, 4.10, 3.89
The last 1 Minute's Load Avg. is: 15.9375%

Is that correct?

I mean, if the value looked 32, the CPU Load would be 100%.

I want to set an alert which is fired when the CPU Load is 90% or more. Based upon the above statistics, what should be the formula for this purpose? Am I correct in my calculation and understanding above?
 
Old 09-30-2013, 04:28 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by devUnix View Post
Code:
Total Number of Processors: 32
  09:01:10 up 232 days, 13:56, 8 users, load average: 5.10, 4.10, 3.89
The last 1 Minute's Load Avg. is: 15.9375%

Is that correct?
Nope. The 1 minute loadavg is 5.10 as reported - it's an average, not a percentage, and the number of CPUs (real or hiper-threaded) is not taken into consideration.
Quote:
I mean, if the value looked 32, the CPU Load would be 100%.
Nope.

Have a read of this - it's now getting quite old, but still mainly correct/relevant. What you are attempting to do can't be properly done using just the uptime numbers. "top" calculates CPU% for you, and /proc/stat has the runnable count which is probably a better metric.
 
1 members found this post helpful.
  


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
CPU load average alert linuxandtsm Linux - Newbie 6 05-10-2012 04:15 PM
Linux CPU load average kdelover Linux - Newbie 6 03-02-2011 12:40 PM
Get load average for cpu core chamila1986 Linux - General 6 05-19-2010 05:40 AM
load average and cpu usage too high, why could i do? v_fone Linux - Newbie 5 07-02-2009 03:17 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 - Server

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