Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Jan 2009 10:40:18 -0800
From:      Julian Elischer <julian@elischer.org>
To:        craig@animalhead.com
Cc:        freebsd-threads@freebsd.org
Subject:   Re: ThreadsPerChild in Apache2 vs THR in top using Event MPM
Message-ID:  <49664892.40602@elischer.org>
In-Reply-To: <61799EAA-1065-443D-812B-5EAFE0643229@animalhead.com>
References:  <9F36BDB2-36D4-4941-BD05-36D2CC5C77AB@animalhead.com>	<20090108012941.GX60686@elvis.mu.org> <61799EAA-1065-443D-812B-5EAFE0643229@animalhead.com>

next in thread | previous in thread | raw e-mail | index | archive | help
craig@animalhead.com wrote:
> Thank you both for replying.  Yes they wait in kserel
> and yes libpthread is shown in the ldd output.
> 
> Is there anything written anywhere on the M:N mechanism?
> Particularly something that would tell me
> 
> 1) whether the number of kernel threads (11) is derived
> from the number of user threads (25), or if not, what
> controls it?

The 11 is made up of:
the number of threads actually waiting in the kernel for input,
plus the extra signal thread
plus one that is waiting to be woken up as it has no work
plus, depending on a number of factors one or two more.

Threads  that are waiting in userland for a condition variable
will not show up at all as they have no kernel resources allocated.



> 
> 2) should I adjust the ThreadsPerChild number from 25
> given this environment?

no

> 
> Thanks again,
> cmac
> www.animalhead.com
> 
> On Jan 7, 2009, at 5:36 PM, Julian Elischer wrote:
>>
>> It depends on which threading library you are using
>> if you see (in top -H) threads waiting in kserel
>> tehn you are using the M:N library, where not every thread in the
>> process makes a kernel thread until it's needed.
>> if you link with libthr instead (see man libmap)
>> you may see different results. (and performance)
>> libthr is the default in 7.x.
>>
> 
> On Jan 7, 2009, at 5:29 PM, Alfred Perlstein wrote:
> 
>> I think 6.3 uses "libkse" which is N:M threads library, so top(1)
>> can't know how many user threads there are, just kernel threads.
>>
>> Do this:
>>  ldd /path/to/httpd
>>
>> If you see libpthread, you're using "kse" and won't see the exact
>> number of threads.
>>
> _______________________________________________
> freebsd-threads@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"




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