From owner-freebsd-threads@FreeBSD.ORG Thu Jan 8 15:36:08 2009 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5171A106564A for ; Thu, 8 Jan 2009 15:36:08 +0000 (UTC) (envelope-from craig@animalhead.com) Received: from animalhead.com (animalhead.com [198.66.255.31]) by mx1.freebsd.org (Postfix) with ESMTP id 3811F8FC08 for ; Thu, 8 Jan 2009 15:36:08 +0000 (UTC) (envelope-from craig@animalhead.com) Received: from [192.168.0.4] (pool-71-116-115-15.snfcca.dsl-w.verizon.net [71.116.115.15]) (authenticated bits=0) by animalhead.com (8.13.6.20060614/8.13.6) with ESMTP id n08Fa6h7078909 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 8 Jan 2009 07:36:07 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <20090108012941.GX60686@elvis.mu.org> References: <9F36BDB2-36D4-4941-BD05-36D2CC5C77AB@animalhead.com> <20090108012941.GX60686@elvis.mu.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <61799EAA-1065-443D-812B-5EAFE0643229@animalhead.com> Content-Transfer-Encoding: 7bit From: craig@animalhead.com Date: Thu, 8 Jan 2009 07:36:00 -0800 To: freebsd-threads@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: Re: ThreadsPerChild in Apache2 vs THR in top using Event MPM X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 15:36:08 -0000 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. >