Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 23093 invoked from network); 23 Apr 2007 05:00:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Apr 2007 05:00:12 -0000 Received: (qmail 53093 invoked by uid 500); 23 Apr 2007 05:00:15 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 53063 invoked by uid 500); 23 Apr 2007 05:00:15 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 53024 invoked by uid 99); 23 Apr 2007 05:00:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Apr 2007 22:00:14 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gozer@ectoplasm.org designates 66.34.202.202 as permitted sender) Received: from [66.34.202.202] (HELO minerva.ectoplasm.org) (66.34.202.202) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Apr 2007 22:00:06 -0700 Received: from minerva.ectoplasm.org (localhost.localdomain [127.0.0.1]) by pmx.secure.ectoplasm.org (Postfix) with SMTP id BE81B5F56C; Sun, 22 Apr 2007 21:59:45 -0700 (PDT) Received: from [10.0.1.2] (S01060000b48fdfe6.vc.shawcable.net [24.86.203.6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by minerva.ectoplasm.org (Postfix) with ESMTP id 2A4685F567; Sun, 22 Apr 2007 21:59:45 -0700 (PDT) In-Reply-To: <200703282107.06698.torsten.foertsch@gmx.net> References: <200703282107.06698.torsten.foertsch@gmx.net> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-6--718797720" Message-Id: Cc: dev@perl.apache.org Content-Transfer-Encoding: 7bit From: Philippe M. Chiasson Subject: Re: COND_WAIT in modperl_tipool Date: Sun, 22 Apr 2007 21:59:41 -0700 To: Torsten Foertsch X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.3) X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.4.10.95133 X-PerlMx-Spam: Gauge=XXII, Probability=22%, Report='RELAY_IN_NJABL_DYNABLOCK 2.5, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_SPECIFIC 0, __CP_NAME_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_VERSION 0, __RDNS_POOLED_2 0, __RELAY_IN_NJABL_DYNABLOCK 0, __SANE_MSGID 0' X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-6--718797720 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 28-Mar-07, at 12:06 PM, Torsten Foertsch wrote: > Hi, > > is there a reason not to use APR mutex and condition variables in > the tipool > implementation but instead Perl's COND_... and MUTEX_... macros? I know I wondered about that exact same thing a long time ago, and if memory serves me right, it was an early doug'ism. Think APR wasn't quite there yet at that time or something. But as far as I can tell, it doesn't really make much of a difference. > The reason I am asking is that after some heavy load generated with > ab over a > GBit link I have seen request timeouts and what is worse apache > processes > hanging around not accepting connections. Then I patched mod_perl/ > mod_status > to report the waiting in COND_WAIT via the scoreboard and saw there > were some > requests hanging in this state after all traffic has been finished. > > The really bad thing about that is that the hanging process is > alive for the > master apache. So, it's share of the scoreboard is blocked and > MaxClients is > practically lowered by ThreadsPerChild. That's strange, and could indicate some bug somewhere. Something not playing by the tipool's usage rules and causing these hangs. Any change your investigation showed you where this might be hapenning ? > I have then changed the tipool implementation to use > apr_thread_cond_timedwait > with a timeout of 0.5 sec instead of COND_WAIT. The problem seems > gone. Hrm, that sounds like you just worked around one problem, most likely causing another one ;-) > I know the problem lies probably not in mod_perl but in the pthread > lib on my > Linux (NPTL 2.5). But maybe it is saver programming not to wait > forever. The > more as it is not determined in what order threads are awakened by a > pthread_cond_signal Can you tell where these child were stuck in COND_WAIT ? I'm curious about what code path was jamming. ------------------------------------------------------------------------ Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/ --Apple-Mail-6--718797720 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (Darwin) iD8DBQFGLD09yzKhB4jDpaURAoPDAKCud7h8H5EHkbkyKDsCEa4M0Wz4mwCeJaNg nfds+DEQd3NEeKQi1Zixx+Y= =IUqx -----END PGP SIGNATURE----- --Apple-Mail-6--718797720--