Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: nospam@zk3.dec.com (Eric Werme - replace nospam with werme)
Subject: Re: Uptime command
Date: 16 Jan 2001 20:55:49 GMT	[thread overview]
Message-ID: <942cgl$9q4j$1@lead.zk3.dec.com> (raw)
In-Reply-To: 931sai$97pc$1@lead.zk3.dec.com

duane@magma.uucp (Andrew Duane USG) writes:

>In article <GvO46.1157$6F6.298776@paloalto-snr1.gtei.net> "GTE News" <awebber@gte.net> writes:
>>Can anyone explain *exactly* how the "uptime" command calculates the
>>"average load", and what the 3 numbers that follow mean? I am looking for
>>very specific information on how it does this. Thanks!!!

>The three numbers are the average number of runnable processes
>(i.e. those processes ready to actually do something, not waiting
>for disk, network, paging, etc.) for the last 5 , 30 , and 60 seconds.

Well, that's not very specific, actually.  Let me add a couple things.
Caveat: I'm not certain of the below, but it should be close enough.
First, it only counts threads that are running or on run queues.  Some
other Unixes may include threads in short term uninterruptible sleeps, like
waiting on disk I/O, Tru64 doesn't.  (Yes, Andrew said the same.)

Second, the "last 5 seconds" isn't really right.  If you start an infinite
loop and watch with xload, you'll see an exponential curve, not a straight
line. Each second, the code does

   load_avg = (load_avg * FACTOR + (active + queued) * (1000 - FACTOR) / 1000;

for FACTORs of:

	800,			/* (4.0/5.0) 5 second average */
	966,			/* (29.0/30.0) 30 second average */
	983,			/* (59.0/60.) 1 minute average */

and "active" being the busy CPUs and "queued" the threads waiting their turn.

It's a lot like the time constant of a RC network, if you're an EE.

The mach factor uses the same exponential decay, but goes from the number
of CPUs on an idle system to 0 on an infinitely loaded system.  I've
no idea what it's good for.

	-Ric Werme
--
<>    Eric (Ric) Werme    <> The above is unlikely to contain    <>
<>    ROT-13 addresses:   <> official claims or policies of      <>
<>   <jrezr@mx3.qrp.pbz>  <> Compaq Computer Corp.               <>
<>  <jrezr@zrqvnbar.arg>  <> http://people.ne.mediaone.net/werme <>


      parent reply	other threads:[~2001-01-16 20:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 23:23 Uptime command GTE News
2001-01-04 13:03 ` Andrew Duane USG
2001-01-04 16:43   ` GTE News
2001-01-05  7:31     ` Kevin Stevens
2001-01-05  7:48     ` Kevin Stevens
2001-01-16 21:01     ` Eric Werme - replace nospam with werme
2001-01-16 20:55   ` Eric Werme - replace nospam with werme [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox