*BSD News Article 9791


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6510 ; Sun, 10 Jan 93 11:19:07 EST
Xref: sserve comp.unix.questions:30166 comp.unix.internals:5503 comp.unix.bsd:9848
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!mcsun!sun4nl!tuegate.tue.nl!svin09!wsinis07!debra
From: debra@wsinis07.info.win.tue.nl (Paul De Bra)
Newsgroups: comp.unix.questions,comp.unix.internals,comp.unix.bsd
Subject: Re: definition of avenrun
Message-ID: <4965@svin09.info.win.tue.nl>
Date: 12 Jan 93 16:25:49 GMT
References: <1993Jan12.001127.25486@jpl-devvax.jpl.nasa.gov>
Sender: news@svin09.info.win.tue.nl
Reply-To: debra@info.win.tue.nl
Followup-To: comp.unix.questions
Organization: Eindhoven University of Technology, the Netherlands
Lines: 24

In article <1993Jan12.001127.25486@jpl-devvax.jpl.nasa.gov> kaleb@swat (Kaleb Keithley) writes:
>...
>forward enough, but what seems to be lacking is a clear explanation of the 
>kernel variable "avenrun".  (Actually, three variables -- on SunOS, three
>"scaled integers", on others, three doubles.)
>
>This variable seems well enough known, as it's used in X11's xload too.

I believe this variable contains the average number of jobs in the run queue,
meaning the average number of jobs that are ready to run. (It's been a long
time since i looked at the source, but i believe it is an array of 3 numbers,
representing the average over 3 different time intervals, maybe something like
the last 1, 5 and 20 minutes, but i'm not sure about these intervals.)

One way to detect this meaning is to have a number, say 5, of small infinite
loops running in parallel, and watch the numbers slowly increase up to 5.

Just a sidenote: on System V release 4 there exists a similar array of numbers,
of which one is used by xload, but the numbers represent the number of jobs
that are waiting for something. If you have 5 infinite loops running in
parallel the numbers remain 0, but if you have 5 'sleep 10000' processes
in parallel the numbers slowly approach 5.

Paul.