Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 2008 14:14:33 +0200
From:      =?ISO-8859-1?Q?Ott_K=F6stner?= <OttK@zzz.ee>
To:        freebsd-questions@freebsd.org
Subject:   Re: top incorrectly reporting process time
Message-ID:  <492FE0A9.70205@zzz.ee>
In-Reply-To: <200811281301.26721.fbsd.questions@rachie.is-a-geek.net>
References:  <49202F59.7050802@zzz.ee> <492FC589.2090001@FreeBSD.org> <492FCD6A.4050103@zzz.ee> <200811281301.26721.fbsd.questions@rachie.is-a-geek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060101010705040500080009
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Mel wrote:

> On Friday 28 November 2008 11:52:26 Ott Köstner wrote:
>   

>> Second computer FreeBSD 7.1-PRERELEASE #3 (exact copy / paste):
>>
>> # ps -ax|grep mysql; echo; ps -axH|grep mysql
>>  1015 con- I      0:00.01 /bin/sh /usr/local/bin/mysqld_safe
>> --defaults-extra-file=/var/db/mysql/my.c
>>  1079 con- S    582:49.60 [mysqld]
>>
>>  1015 con- I      0:00.01 /bin/sh /usr/local/bin/mysqld_safe
>> --defaults-extra-file=/var/db/mysql/my.c
>>  1079 con- S      2:00.40 [mysqld]
>>  1079 con- I      0:00.00 [mysqld]
>>  1079 con- I      0:01.32 [mysqld]
>>  1079 con- I      0:47.04 [mysqld]
>>  1079 con- I      0:03.56 [mysqld]
>>  1079 con- S      0:26.43 [mysqld]
>>  1079 con- S      3:13.97 [mysqld]
>>  1079 con- S      4:12.72 [mysqld]
>>  1079 con- S      0:03.72 [mysqld]
>>
>> 582 minutes is clearly wrong.
>>     
>
> Not if it's the sum of all threads that lived and died during the lifetime of 
> the process. It's value is taken from the kernel's idea of the runtime. With 
> KERN_PROC_INC_THREAD set, it will look at the thread storage for active 
> threads, including the 'main()' thread.
> I haven't looked into detail, but I suspect when a thread dies it gets added 
> to process runtime, and is stored nowhere else.
>
>   
I see. Thank You!


> Aside from the different machines, you also took 2 different daemons, which 
> fits this:
> named uses a static thread pool, by design, sum(nthreads) will equal the 
> process time
> mysqld uses a dynamic thread pool, sum(nthreads) is really 
> sum(nthreads_active).
>
> I haven't looked into detail
>
>   
I see.


Regards,
O.K.



--------------060101010705040500080009--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?492FE0A9.70205>