From owner-freebsd-questions@FreeBSD.ORG Thu Sep 14 05:48:02 2006 Return-Path: X-Original-To: questions@FreeBSD.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A34E16A412 for ; Thu, 14 Sep 2006 05:48:02 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30C8F43D80 for ; Thu, 14 Sep 2006 05:47:56 +0000 (GMT) (envelope-from keramida@FreeBSD.org) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-2) with ESMTP id k8E5lbGT025762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Sep 2006 08:47:38 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.7/8.13.7) with ESMTP id k8E5lw1k077634; Thu, 14 Sep 2006 08:47:58 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from giorgos@localhost) by gothmog.pc (8.13.7/8.13.7/Submit) id k8E5lwNM077633; Thu, 14 Sep 2006 08:47:58 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Thu, 14 Sep 2006 08:47:58 +0300 From: Giorgos Keramidas To: "Tamouh H." Message-ID: <20060914054758.GA77575@gothmog.pc> References: <20060810055227.GA7051@gothmog.pc> <20060914044822.E7C1E5C17FD@poseidon.ceid.upatras.gr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: <20060914044822.E7C1E5C17FD@poseidon.ceid.upatras.gr> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.873, required 5, autolearn=not spam, AWL -0.28, BAYES_00 -2.60, UNPARSEABLE_RELAY 0.00) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: questions@FreeBSD.org, 'Ian Smith' Subject: Re: Top not showing cpu usage even remotely accurately X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 05:48:02 -0000 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2006-09-14 00:48, "Tamouh H." wrote: > I think TOP and load averages are no longer accurate on FBSD 5.x and > 6.x with SMP kernel. As far as I've seen. Load averages hit sometimes > 8.0 without a noticable degradation in performance. > > This is one TOP that freaked me out, notice Idle CPU is 70% while the > process is showing it is using 99% of CPU. systat draws more accurate > picture, however, load average is still useless as far as performance > monitoring : > > last pid: 10174; load averages: 1.63, 1.44, 1.20 up 4+00:25:19 00:39:20 > 169 processes: 2 running, 166 sleeping, 1 zombie > CPU states: 25.8% user, 0.0% nice, 0.7% system, 0.1% interrupt, 73.4% idle > Mem: 1316M Active, 1445M Inact, 297M Wired, 127M Cache, 112M Buf, 79M Free > Swap: 8762M Total, 2096K Used, 8760M Free > > PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND > 13362 root 111 0 36444K 34196K CPU3 3 50:06 98.88% 98.88% perl5.8.7 > 90391 root 96 0 27356K 26236K select 2 0:06 0.54% 0.54% perl5.8.7 > 79619 nobody 4 0 209M 84640K sbwait 1 0:09 0.39% 0.39% httpd > 10161 root 97 0 6712K 4752K select 2 0:00 1.40% 0.20% exim-4.62-0 > 79649 nobody 20 0 210M 84464K lockf 0 0:06 0.15% 0.15% httpd Apparently, you have a 4-CPU system :-) What you see displayed as "CPU" is for one of the processors, not for all of them. Load average is not an easy thing to update for an SMP system, I guess. There are two options: - Set load-average to >= 1.0 if at least one process wants to run on at least one processor - Calculate an aggregate load-average for all CPUs None of these is 100% correct, though. One of them is useful in some cases. The other in other cases :-( I don't remember off-hand how 5.X or 6.X calculate their load-average, but I'd be interested to know what you expected it to show, or what it shows on Linux systems. --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFCO0O1g+UGjGGA7YRAtL5AKCs/sd6V5aIv1g40VftExLyLPRhFgCeL2Lb 0Fd9D6ZVTzGN46/6n8mtpVE= =HwPU -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5--