Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34830 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95835 invoked by uid 1010); 18 Jan 2008 15:51:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95819 invoked from network); 18 Jan 2008 15:51:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2008 15:51:22 -0000 Authentication-Results: pb1.pair.com header.from=ioplex@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ioplex@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.162.178 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ioplex@gmail.com X-Host-Fingerprint: 209.85.162.178 el-out-1112.google.com Linux 2.4/2.6 Received: from [209.85.162.178] ([209.85.162.178:19867] helo=el-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/58-18592-6FAC0974 for ; Fri, 18 Jan 2008 10:51:21 -0500 Received: by el-out-1112.google.com with SMTP id n30so24172elf.17 for ; Fri, 18 Jan 2008 07:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=yPaaX8xYfz8t2ynwgzcRTacptQ0ryOmSxc04LUEDs4A=; b=vo0J5FP9my2atJleFBvZ6C70kwi8GcOUpF25Tl7YzOKwWZoF89q5PqekKI7jGjlUc+m76uuE/46g4rG7swYwr6avMGLbPHNr9sDLUMuH1XiRKnVtNIvs/RycdZ7YuzNbONa54EWhad75NEdpyZbf0D/5BRS+OXUD6aHYrHortws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=wc3aleQeo3Bm5W7eoNQ/e/PUbLebdogMckAJ2LryHVCb816QmuHIp/vK2A8e752+v3SN7q4VPNA9o1gLcktmScvflwW48P18BYOsUKfyV/d8zfmOk+8gKCaQHecW+wWwIiKfDOntd4k17eYFmUxsGmlEV+ipwuv3aJhx2ppSyyQ= Received: by 10.142.177.7 with SMTP id z7mr2148356wfe.47.1200671474261; Fri, 18 Jan 2008 07:51:14 -0800 (PST) Received: by 10.142.133.21 with HTTP; Fri, 18 Jan 2008 07:51:14 -0800 (PST) Message-ID: <78c6bd860801180751n3950c90ek4eed385cf4d17c6c@mail.gmail.com> Date: Fri, 18 Jan 2008 10:51:14 -0500 To: "Scott MacVicar" Cc: internals@lists.php.net In-Reply-To: <47907E9A.9070401@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <78c6bd860801172346tab2dd81p841511ee07d15a5e@mail.gmail.com> <47907E9A.9070401@php.net> Subject: Re: [PHP-DEV] Asymmetric Module Init / Deinit From: ioplex@gmail.com ("Michael B Allen") On 1/18/08, Scott MacVicar wrote: > Apache children get killed and re-spawned after the number of requests > defined by MaxRequestsPerChild, the default is 10,000. Though MINI > talways get called for each child spawned. > > Is Apache using pre-fork or worker? Pre-fork. That's weird. I set MaxRequestPerChild to 100, ran ab -n 500 url and I can see workers being destroyed and created but I only see MINIT being called once on startup. As workers exit I see MSHUTDOWN but no corresponding MINIT. Just to be sure my log apparatus wasn't setup yet I wrote a message to stderr, flushed it and verified that it's in the Apache error_log. I'm pretty sure MINIT gets called on startup and MSHUTDOWN gets called every time a child exits. I used stock Apache 2.2.6 and PHP 5.2.5 with the standard Apache 2 build instructions [1] (although I did not compile php --with-mysql) on x86_64-redhat-linux. Mike [1] http://www.php.net/manual/en/install.unix.apache2.php > Michael B Allen wrote: > > I have someone using my extension who is seeing some strange behavior > > where the module initializes which Apache starts, the extension works > > perfectly and then, without warning, after about 40 seconds, the > > deinitialization routine runs. This kills some state in a global > > context and everything goes very badly from there. Otherwise, Apache > > is still running just fine. > > > > The setup is Apache 2.2 / PHP 5.2 on Fedora 7. > > > > I personally have not been able to replicate this problem but I'm > > thinking it must be an Apache worker exiting that's triggering deinit. > > I know Apache 1.x has that behavior and I'm wondering if anyone knows > > if 2.2 exhibits that behavior. It's annoying because it means that the > > module initialization is called once whereas the deinitialization > > routine is called many times. > > > > Does this sound familiar to anyone? > > > > I would appreciate any insight as to how I can ensure that my module > > is deinitialized only once. My first thought is to simply save the pid > > of the process that initialized the module and check for it in the > > deinitialization routine. > > > > Mike > > > -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/