From owner-freebsd-threads@FreeBSD.ORG Thu Jan 8 02:04:45 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 213A11065678 for ; Thu, 8 Jan 2009 02:04:45 +0000 (UTC) (envelope-from prvs=julian=25242c0f6@elischer.org) Received: from smtp-outbound.ironport.com (smtp-outbound.ironport.com [63.251.108.112]) by mx1.freebsd.org (Postfix) with ESMTP id E057C8FC21 for ; Thu, 8 Jan 2009 02:04:44 +0000 (UTC) (envelope-from prvs=julian=25242c0f6@elischer.org) Received: from unknown (HELO julian-mac.elischer.org) ([10.251.60.46]) by smtp-outbound.ironport.com with ESMTP; 07 Jan 2009 17:36:19 -0800 Message-ID: <49655892.1010500@elischer.org> Date: Wed, 07 Jan 2009 17:36:18 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: craig@animalhead.com References: <9F36BDB2-36D4-4941-BD05-36D2CC5C77AB@animalhead.com> In-Reply-To: <9F36BDB2-36D4-4941-BD05-36D2CC5C77AB@animalhead.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org 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 02:04:45 -0000 craig@animalhead.com wrote: > This is more of an Apache question than a FreeBSD question, but I've > received no response from enquiries to the users@httpd list. Perhaps > someone receiving from this list will be able to help? > > Our server is running Apache 2.2.11 with the Event MPM under FreeBSD > 6.3, on a site that's largely mod_perl2 driven. 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. > > ThreadsPerChild is specified as 25 in an include file of httpd.conf. > > The documentation of the Worker MPM (which is said to have the same > configuration characteristics as Event) states that each child process > creates threads when it starts, and never changes the > number of threads. > > But the THR column of the 'top' utility shows 11 threads per process. > Is 'top' just wrong, or is something constraining how many threads are > being created? Might my Internet Hosting Provider have built FreeBSD > with some such constraint? How can I get more data? > > The only way I know to ask Apache about its threads configuration > is the Apache2::MPM->query facility. Using this facility for all of > the values noted in the Apache2::Const documentation yields: > > MPMQ_MAX_DAEMON_USED(1) = -1 > MPMQ_IS_THREADED(2) = 1 > MPMQ_IS_FORKED(3) = 2 > MPMQ_HARD_LIMIT_DAEMONS(4) = 16 > MPMQ_HARD_LIMIT_THREADS(5) = 64 > MPMQ_MAX_THREADS(6) = 25 > MPMQ_MIN_SPARE_DAEMONS(7) = 0 > MPMQ_MIN_SPARE_THREADS(8) = 25 > MPMQ_MAX_SPARE_DAEMONS(9) = 0 > MPMQ_MAX_SPARE_THREADS(10) = 150 > MPMQ_MAX_REQUESTS_DAEMON(11) = 0 > MPMQ_MAX_DAEMONS(12) = 10 > > MPMQ_MAX_THREADS has the same value as ThreadsPerChild, but > its name suggests that this number is a maximum. Does this imply > that this number may not be created as a child process starts? > > Help will be much appreciated, > cmac > www.animalhead.com > > _______________________________________________ > 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"