ThreadsPerChild in Apache2 vs THR in top using Event MPM

craig at animalhead.com craig at animalhead.com
Thu Jan 8 15:36:08 UTC 2009


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?

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

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.
>


More information about the freebsd-threads mailing list