Re: Loadavg calculation

From: Pavel Machek (pavel@suse.cz)
Date: Mon Nov 06 2000 - 17:39:57 EST


Hi!

> > I'm working a project a work that is using Linux to run some very
> > math-intensive calculations. One of the things we do is use the 1-minute
> > loadavg to determine how busy the machine is and can we fire off another
> > program to do more calculations. However, there's a problem with that.
> >
> > Because it's a 1 minute load average, there's quite a bit of lag time from
> > when 1 program finishes until the loadavg goes down below a threshold for
> > our control mechanism to fire off another program.
> >
> > Let me give an example (all on a 1-cpu PC)
> >
> > HH:MM:SS
> > 00:00:00 fire off 4 programs
> > 00:01:00 loadavg goes up to 4
> > 00:01:30 3 of the 4 programs finish loadavg still at 4
> > 00:02:20 load avg goes down to 1, below our threshold
> > 00:02:21 we fire off 3 more programs.
> >
> > We'd like to reduce that almost 50 second lag time. Is it possible, in
> > user-space, to duplicate the loadavg calculation period, say to a 15
> > second load average, using the information in /proc?

pavel@bug:~$ cat /proc/loadavg
0.00 0.00 0.00 2/46 395
pavel@bug:~$

The three values of 0.00 are loadavg averaged over different
time. Select the right one and you are done.
                                                                Pavel

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
-
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 : Wed Nov 15 2000 - 21:00:17 EST