Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28352 invoked from network); 24 Aug 2008 16:39:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2008 16:39:42 -0000 X-Host-Fingerprint: 84.167.92.227 p54A75CE3.dip.t-dialin.net Received: from [84.167.92.227] ([84.167.92.227:14879] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/81-22001-DCE81B84 for ; Sun, 24 Aug 2008 12:39:42 -0400 Message-ID: <1B.81.22001.DCE81B84@pb1.pair.com> To: internals@lists.php.net Date: Sun, 24 Aug 2008 18:39:38 +0200 User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 References: <718401811.20080824161649@marcus-boerger.de> In-Reply-To: <718401811.20080824161649@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 84.167.92.227 Subject: Re: [PHP-DEV] php-cgi: cgi_main.c => max_requests = 500? From: guidoreina@gmail.com (Guido) Marcus Boerger wrote: > Hello Guido, > > Sunday, August 24, 2008, 3:51:19 PM, you wrote: > >> Hi all, > >> I am new to PHP and to this forum. > >> I was testing my webserver with PHP and found out that after 500 >> requests the php-cgi process finished (without cores). I ran it with >> valgrind and no memory leaks :). I thought it couldn't be a coincidence >> that, always, after 500 requests, php-cgi finished; so I have had a look >> at cgi_main.c and found: > >> max_requests = 500; > >> I have seen that the environment variable: PHP_FCGI_MAX_REQUESTS might >> be used to override this value; why php-cgi has to finish after n requests? > > It is a common habit to reload the binary after a given number of requests. > This prevents memory leaks and other esource issues. > > Best regards, > Marcus > Hi Marcus, thank you very much for your response. I have set the environment variable to a big number and test with valgrind and everything seems to be fine (no leaks), so before launching php-cgi, I will always set this variable :). Guido.