From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,b8fbe4f772711da2 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-01-16 13:04:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!newsgate.tandem.com!mailint03.im.hou.compaq.com!pa.dec.com!ajo.zk3.dec.com!not-for-mail From: nospam@zk3.dec.com (Eric Werme - replace nospam with werme) Newsgroups: comp.unix.tru64 Subject: Re: Uptime command Date: 16 Jan 2001 20:55:49 GMT Organization: Awesome OSIS Folk Message-ID: <942cgl$9q4j$1@lead.zk3.dec.com> References: <931sai$97pc$1@lead.zk3.dec.com> Reply-To: (Replace nobody with werme) nobody@zk3.dec.com NNTP-Posting-Host: alingo.zk3.dec.com X-Trace: lead.zk3.dec.com 979678549 321683 16.140.64.211 (16 Jan 2001 20:55:49 GMT) X-Complaints-To: iass@ajo.zk3.dec.com NNTP-Posting-Date: 16 Jan 2001 20:55:49 GMT X-Newsreader: NN version 6.5.0 CURRENT #60 Xref: supernews.google.com comp.unix.tru64:1483 duane@magma.uucp (Andrew Duane USG) writes: >In article "GTE News" 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 <> <> <> Compaq Computer Corp. <> <> <> http://people.ne.mediaone.net/werme <>