From owner-freebsd-questions Sun Mar 25 14:44:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id 5848437B71A for ; Sun, 25 Mar 2001 14:44:43 -0800 (PST) (envelope-from ryan@sasknow.com) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id QAA61816; Sun, 25 Mar 2001 16:43:21 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Sun, 25 Mar 2001 16:43:21 -0600 (CST) From: Ryan Thompson To: Paul Herman Cc: j mckitrick , freebsd-questions@FreeBSD.ORG Subject: Re: interpreting 'load' statistics In-Reply-To: Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Paul Herman wrote to Ryan Thompson: > The others have already given good answers, but when I read... > > > Make a fork bomb. > > Run the fork bomb AS A NORMAL USER. > > As root, run uptime. > > Kill the fork bomb. > > > > ryan@stimpy$ uptime > > 1:01PM up 91 days, 10:17, 3 users, load averages: 572.68, 607.01, 388.05 > > ...I just wanted to point out that there is an interesting 'feature' > that I found when testing the same thing. The load only goes up to > 1024.00. After that, it rolls back over to 0.00. That _is_ kinda interesting. The reason behind this is found in param.h: /* * $FreeBSD: src/sys/sys/param.h,v 1.38.2.12 1999/12/17 07:48:07 jkh Exp $ */ . . . /* * Scale factor for scaled integers used to count %cpu time and load avgs. * * The number of CPU `tick's that map to a unique `%age' can be expressed * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that * can be calculated (assuming 32 bits) can be closely approximated using * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). * * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. */ #define FSHIFT 11 /* bits to right of fixed binary point */ #define FSCALE (1< 1K :-) Of course, you could always tune FSHIFT to meet the needs of your system, too. - Ryan > 09:22:12{{ttyp4}pherman@husten}~//> uptime > 9:24AM up 21 mins, 1 user, load averages: 1000.21, 723.32, 429.71 > 09:24:11{{ttyp4}pherman@husten}~//> uptime > 9:25AM up 23 mins, 1 user, load averages: 1023.58, 805.98, 492.73 > 09:25:50{{ttyp4}pherman@husten}~//> uptime > 9:25AM up 23 mins, 1 user, load averages: 0.74, 809.83, 495.92 > 09:25:53{{ttyp4}pherman@husten}~//> uptime > 9:26AM up 23 mins, 1 user, load averages: 160.21, 817.34, 502.26 > 09:26:00{{ttyp4}pherman@husten}~//> ps ax | wc > 1075 6450 41030 > > I found this out on a machine with only 64MB RAM which ain't an easy > trick, but I could still get work done on the machine and kill the > processes without any major problems, and I didn't have to reboot. > Gotta love FreeBSD. > > -Paul. > > -- Ryan Thompson Network Administrator, Accounts SaskNow Technologies - http://www.sasknow.com #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2 Tel: 306-664-3600 Fax: 306-664-1161 Saskatoon Toll-Free: 877-727-5669 (877-SASKNOW) North America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message