Re: Loadavg calculation

From: bert hubert (ahu@ds9a.nl)
Date: Sun Nov 05 2000 - 09:01:55 EST


On Sun, Nov 05, 2000 at 07:55:40AM -0500, bobyetman@att.net wrote:

> The other option we looked at, besides using loadavg, was using idle pct%,
> but if I read the source for top right, involves reading the entire
> process table to calculate clock ticks used and then figuring out how many
> weren't used.

Snoop the source of vmstat, it measures the amount of programs in the run
queue, which is how the load average is calculated. You do need to average
this data in order for it to be useful.

You might also follow /proc/uptime, which gives the number of jiffies the
system has been up, and how many jiffies have been spent by the idle task.
If you take the derivative if the idle jiffies, you get the percentage idle
time.

You might also try to measure directly how much time is spent in the idle
task (0).

Regards,

bert hubert

-- 
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Nov 07 2000 - 21:00:17 EST