From owner-freebsd-questions@FreeBSD.ORG  Wed Jan 21 21:01:33 2009
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: freebsd-questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 067241065796
	for <freebsd-questions@freebsd.org>;
	Wed, 21 Jan 2009 21:01:33 +0000 (UTC)
	(envelope-from freebsd-questions-local@be-well.ilk.org)
Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net
	[69.17.117.5]) by mx1.freebsd.org (Postfix) with ESMTP id D380C8FC1C
	for <freebsd-questions@freebsd.org>;
	Wed, 21 Jan 2009 21:01:32 +0000 (UTC)
	(envelope-from freebsd-questions-local@be-well.ilk.org)
Received: (qmail 27576 invoked from network); 21 Jan 2009 21:01:32 -0000
Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org)
	([66.92.78.145])
	(envelope-sender <freebsd-questions-local@be-well.ilk.org>)
	by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP
	for <freebsd-questions@freebsd.org>; 21 Jan 2009 21:01:32 -0000
Received: by be-well.ilk.org (Postfix, from userid 1147)
	id 1696450844; Wed, 21 Jan 2009 16:01:31 -0500 (EST)
To: KES <kes-kes@yandex.ru>
References: <571280828.20090121220816@yandex.ru>
From: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
Date: Wed, 21 Jan 2009 16:01:30 -0500
In-Reply-To: <571280828.20090121220816@yandex.ru> (KES's message of "Wed\,
	21 Jan 2009 22\:08\:16 +0200")
Message-ID: <44k58os79x.fsf@be-well.ilk.org>
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Cc: freebsd-questions@freebsd.org
Subject: Re: 'top' shows wrong CPU usage
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: freebsd-questions@freebsd.org
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Jan 2009 21:01:34 -0000

KES <kes-kes@yandex.ru> writes:

> top shows often nonsense in CPU usage of a process, but totals are OK
> and it seems that WCPU and CPU has no differences in results

Why do you think it's nonsense?  It's averaged over a different time
period than the "CPU:" line in the header, so I wouldn't expect it to
match... 

> top -S
> last pid: 66182;  load averages:  2.51,  2.15,  2.03             up 10+23:40:14  22:05:41
> 798 processes: 6 running, 772 sleeping, 1 zombie, 18 waiting, 1 lock
> CPU:  4.4% user,  0.0% nice, 14.8% system, 16.7% interrupt, 64.0% idle
> Mem: 264M Active, 60M Inact, 147M Wired, 6968K Cache, 60M Buf, 9888K Free
> Swap: 2048M Total, 1903M Used, 145M Free, 92% Inuse
>
>   PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
>    11 root          1 171 ki31     0K     8K RUN    104.1H 88.48% idle: cpu0
> 66178 firebird      1  49    0 23120K  5828K select   0:00  1.37% fb_inet_server
> 66159 firebird      1  48    0 23120K  5760K select   0:01  1.17% fb_inet_server
>  5156 root          1  44    0  9024K   544K select  57:39  0.68% snmpd
> 66182 root          1  44    0  4556K  2608K RUN      0:00  0.68% top
> 66147 root          1   8    0  3124K   840K nanslp   0:00  0.59% monitord
> 66138 firebird      1  44    0 23120K  5736K select   0:01  0.49% fb_inet_server
> 75745 www           1  44    0 24628K  9500K select   5:05  0.29% python2.5
> 66180 firebird      1  46    0 23120K  5852K select   0:00  0.10% fb_inet_server
>
>
> #top -S -C
> last pid: 66209;  load averages:  2.13,  2.10,  2.02             up 10+23:41:07  22:06:34
> 814 processes: 6 running, 788 sleeping, 1 zombie, 18 waiting, 1 lock
> CPU:  9.3% user,  0.0% nice, 13.4% system, 12.8% interrupt, 64.5% idle
> Mem: 269M Active, 56M Inact, 148M Wired, 12M Cache, 60M Buf, 3700K Free
> Swap: 2048M Total, 1903M Used, 145M Free, 92% Inuse
>
>   PID USERNAME    THR PRI NICE   SIZE    RES STATE    TIME    CPU COMMAND
>    11 root          1 171 ki31     0K     8K RUN    104.1H 92.29% idle: cpu0
> 66138 firebird      1  49    0 23120K  5556K select   0:01  1.46% fb_inet_server
> 66180 firebird      1  44    0 23120K  5612K select   0:01  0.59% fb_inet_server
> 66209 root          1  44    0  4556K  2556K RUN      0:00  0.59% top
> 66179 firebird      1  44    0 23120K  5624K select   0:01  0.49% fb_inet_server
>  5156 root          1  44    0  9024K   544K select  57:39  0.39% snmpd
> 66147 root          1   8    0  3124K   840K nanslp   0:01  0.39% monitord
> 66178 firebird      1  44    0 23120K  5584K select   0:01  0.20% fb_inet_server
>    12 root          1 -44    -     0K     8K WAIT   126.8H  0.00% swi1: net
>    42 root          1 -68    -     0K     8K -      219:53  0.00% dummynet

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/