php-fastcgi and memory leaks

Phillip B Oldham phill at theactivitypeople.co.uk
Fri Mar 28 12:37:19 MSK 2008


Out of interest, if I were to add the following to my nginx.conf:

env PHP_FCGI_MAX_REQUESTS=10;

Would that be picked up by php?

Rob Schultz wrote:
> I am not sure if this is "Gentoo" specific but they use ALLOWED_ENV 
> settings when using spawn-fcgi here is the two relevant files
>
> http://www.pastie.org/private/scbfzxfcvfqqdkohjdmw
>
> On Mar 26, 2008, at 5:00 AM, Phillip B Oldham wrote:
>
>> #   php-fastcgi (webserver)
>> #   --------------------
>>
>> check process php-fastcgi with pidfile /var/run/php-fastcgi.pid
>>   start program = "/etc/init.d/php-fastcgi start"
>>   stop  program = "/etc/init.d/php-fastcgi stop"
>>   if cpu usage > 95% for 3 cycles then alert
>>   if totalmem usage > 90% for 1 cycles then restart
>>   depends php-fastcgi_init
>>   depends php-fastcgi_bin
>>
>> check file php-fastcgi_init with path /etc/init.d/php-fastcgi
>>   group www
>>
>> check file php-fastcgi_bin with path /usr/local/bin/php-fcgi
>>   group www
>>
>> And my php-fcgi script looks like this:
>>
>> #!/bin/bash
>> PHP_FCGI_MAX_REQUESTS=25
>> export PHP_FCGI_MAX_REQUESTS
>> /usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 10005 -u apache -g apache 
>> -C 3 -f /usr/local/bin/php-cgi -P /var/run/php-fastcgi.pid
>>
>> Doesn't look as though PHP_FCGI_MAX_REQUESTS is being honoured 
>> though, which is annoying. I've even tried setting it to 1 (so the 
>> child dies after every request) but it has no effect. I think in the 
>> whole time I've been working with php under nginx in this way I've 
>> only seen a <defunct> php process once.
>>
>> Thomas wrote:
>>> Hi Phillip,
>>>
>>> Do you mind sharing your monitrc section concerning the monitoring of
>>> the spawn-fcgi process? I am currently unable to do so. This way I
>>> could hammer my php apps with httperf and see if I also have this
>>> memory leaks problem.
>>>
>>>
>>> On Wed, Mar 26, 2008 at 9:12 AM, Phillip B Oldham
>>> <phill at theactivitypeople.co.uk> wrote:
>>>
>>>> I'm using spawn-fcgi, from the lighttpd project. It seemed the 
>>>> easiest way
>>>> to manage the php instances. Is there a better way to spawn php 
>>>> instances
>>>> for nginx?
>>>>
>>>>
>>>>
>>>> Yordan Georgiev wrote:
>>>> Hello Phillip,
>>>>
>>>> How to create you are fastcgi gataway?
>>>>
>>>> -- 
>>>> Please excuse my bad english...
>>>>
>>>> С уважение,
>>>> Й. Георгиев.
>>>>
>>>> WEB: http://gigavolt-bg.net/
>>>> Blog: http://live.gigavolt-bg.net/
>>>>
>>>> -- 
>>>>
>>>>
>>>>
>>>> Phillip B Oldham
>>>> The Activity People
>>>> phill at theactivitypeople.co.uk ________________________________
>>>>
>>>>
>>>> Policies
>>>>
>>>> This e-mail and its attachments are intended for the above named
>>>> recipient(s) only and may be confidential. If they have come to you in
>>>> error, please reply to this e-mail and highlight the error. No 
>>>> action should
>>>> be taken regarding content, nor must you copy or show them to anyone.
>>>>
>>>> This e-mail has been created in the knowledge that Internet e-mail 
>>>> is not a
>>>> 100% secure communications medium, and we have taken steps to 
>>>> ensure that
>>>> this e-mail and attachments are free from any virus. We must advise 
>>>> that in
>>>> keeping with good computing practice the recipient should ensure 
>>>> they are
>>>> completely virus free, and that you understand and observe the lack of
>>>> security when e-mailing us. ________________________________
>>>>
>>>>
>>
>> -- 
>>
>> *Phillip B Oldham*
>> The Activity People
>> phill at theactivitypeople.co.uk <mailto:phill at theactivitypeople.co.uk>
>>
>> ------------------------------------------------------------------------
>>
>> *Policies*
>>
>> This e-mail and its attachments are intended for the above named 
>> recipient(s) only and may be confidential. If they have come to you 
>> in error, please reply to this e-mail and highlight the error. No 
>> action should be taken regarding content, nor must you copy or show 
>> them to anyone.
>>
>> This e-mail has been created in the knowledge that Internet e-mail is 
>> not a 100% secure communications medium, and we have taken steps to 
>> ensure that this e-mail and attachments are free from any virus. We 
>> must advise that in keeping with good computing practice the 
>> recipient should ensure they are completely virus free, and that you 
>> understand and observe the lack of security when e-mailing us.
>>
>> ------------------------------------------------------------------------
>
>
>

-- 

*Phillip B Oldham*
The Activity People
phill at theactivitypeople.co.uk <mailto:phill at theactivitypeople.co.uk>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named 
recipient(s) only and may be confidential. If they have come to you in 
error, please reply to this e-mail and highlight the error. No action 
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is 
not a 100% secure communications medium, and we have taken steps to 
ensure that this e-mail and attachments are free from any virus. We must 
advise that in keeping with good computing practice the recipient should 
ensure they are completely virus free, and that you understand and 
observe the lack of security when e-mailing us.

------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080328/62c603f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phill.vcf
Type: text/x-vcard
Size: 272 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20080328/62c603f5/attachment.vcf>


More information about the nginx mailing list