[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting CPU load (from /proc/?)



On Thu, 28 Sep 2000 at 07:48:01 +1200, C. Falconer wrote:
> At 04:39 PM 9/27/00 +0100, you wrote:
> >You could try 'vmstat 1', which will poll every second. Ignoring the
> >first line, which is an "up to the time vmstat was started" figure, the
> >last field in each line is the percentage of time the CPU is idle.
> >
> >I can't speak for how accurate it is, but it seems to be fairly
> >reliable.
> 
> Rememebr heisenberg's uncertanty principle - you can't measure an attribute 
> of the system without affecting the system attribute you are measuring.

If quantum theory affects Linux to a degree where a userspace process
can measure its effects then I shall be quite scared. :)

> Running vmstat means there is a running process - which means the machine 
> might never be idle enough to suspend

While telling me about the existence of vmstat, somebody at work said
that it excluded itself from its measurements. This might be rubbish,
though, as I've never actually looked at the code ...

> Just chucking a crescent in the gears :)

*grin*,

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: