Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 74990 invoked from network); 2 Mar 2009 15:03:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2009 15:03:35 -0000 Received: (qmail 97236 invoked by uid 500); 2 Mar 2009 15:03:25 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 97219 invoked by uid 500); 2 Mar 2009 15:03:25 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 97207 invoked by uid 99); 2 Mar 2009 15:03:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 07:03:24 -0800 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mangoo@wpkg.org designates 78.111.66.105 as permitted sender) Received: from [78.111.66.105] (HELO mx03.syneticon.net) (78.111.66.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 15:03:15 +0000 Received: from localhost (filter1.syneticon.net [192.168.113.83]) by mx03.syneticon.net (Postfix) with ESMTP id 9A53D36152 for ; Mon, 2 Mar 2009 16:02:54 +0100 (CET) X-Virus-Scanned: amavisd-new at mx03.syneticon.net Received: from mx03.syneticon.net ([192.168.113.84]) by localhost (mx03.syneticon.net [192.168.113.83]) (amavisd-new, port 10025) with ESMTP id qgUTdSf+YZ+9 for ; Mon, 2 Mar 2009 16:02:52 +0100 (CET) Received: from [192.168.10.145] (koln-4db4160b.pool.einsundeins.de [77.180.22.11]) by mx03.syneticon.net (Postfix) with ESMTPSA for ; Mon, 2 Mar 2009 16:02:52 +0100 (CET) Message-ID: <49ABF51B.3050909@wpkg.org> Date: Mon, 02 Mar 2009 16:02:51 +0100 From: Tomasz Chmielewski User-Agent: Thunderbird 2.0.0.19 (X11/20081231) MIME-Version: 1.0 To: users@httpd.apache.org References: <49A94C33.2010205@wpkg.org> In-Reply-To: <49A94C33.2010205@wpkg.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] preforked processes don't want to die over time -> memory full Tomasz Chmielewski schrieb: > I have Apache 2.2.3 server, which over time (a couple of days) uses lots > of memory. What uses lots of memory? Apache processes which do not want > to die for some reason. > > The server can have only 10-20 active connections to httpd (as reported > by netstat's ESTABLISHED), but in the same time, there can be 80, 100, > 120 or more httpd processes (the longer httpd was not restarted, the > more httpd processes will run, till memory and swap are full and > OOM-killer will start to kill processes). > > Short term, httpd processes are created and killed (exit), but longer > term, after several hours, I can see that more and more httpd processes > are running. > > How can I trace what causes this misbehaviour? Perhaps it's some PHP > code which never exits. > I always used strace to check various malfunctioning, but I think it'd > be an overkill here, and perhaps there is a better way to check what > httpd processes were doing and how long did it take them. My issue looks very similar to the one described (and not solved) here: http://www.webhostingtalk.com/showthread.php?t=670621 In short, stracing a httpd process stops on LOCK_EX: $ strace -p 3230 06:57:12 open("/var/lib/php/session/sess_86ecf346c6f7adba93cb1077f6b95d43", O_RDWR|O_CREAT, 0600) = 44 06:57:12 flock(44, LOCK_EX And "lsof" shows that such session files are being accessed by many httpd processes (each wanting to have an exclusive lock, which will block all other instances). Hmm, what should I do? -- Tomasz Chmielewski http://wpkg.org --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org