Welcome! Log In Create A New Profile

Advanced

php-cgi process dies from time to time in low traffic

Posted by kabs 
php-cgi process dies from time to time in low traffic
June 11, 2009 10:57PM
Hello every1

Here is story: I have nginx 0.7.35 on ubuntu 8.10 with fastcgi for php stuff. I installed the server by following this tutorial here http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/. In fact the installation I have now is an upgrade from ubuntu 8.04 covered in the tutorial. My first installation worked beautifully without a problem.

My current installation (8.10) has really caused me a lot of sleepless nights and pain with php-cgi process suddenly going dead and this tends to happen during the times when there is low traffic. I have to log into the machine to run sudo /etc/init.d/php-fastcgi restart when the php-cgi process dies. Then it would run fine for a week or so and then die again and the process just repeats and it has been like that for the last four months and even gotten worse lately where the process dies as much as twice in a week.

Nobody seemed to have had this problem until recently when I came across this post that explained the problem in detail http://blog.taragana.com/index.php/archive/how-to-stop-crashing-hanging-of-php-cgi-spawn-fcgi-with-nginx-lighttpd/

However, I did employ their suggestion - Set maximum number of requests to execute per php-cgi process, but still the problem has not gone away.

Has anybody experienced this problem and what could really be the issue here?

Thanks for sparing some time to read through my problem

Kabs
Re: php-cgi process dies from time to time in low traffic
June 11, 2009 11:47PM
On Fri, Jun 12, 2009 at 9:57 AM, kabs<nginx-forum@nginx.us> wrote:
>
> Hello every1
>
> Here is story: I have nginx 0.7.35 on ubuntu 8.10 with fastcgi for php stuff. I installed the server by following this tutorial here http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/. In fact the installation I have now is an upgrade from ubuntu 8.04 covered in the tutorial. My first installation worked  beautifully without a problem.
>
> My current installation (8.10) has really caused me  a lot of sleepless nights and pain with php-cgi process suddenly going dead and this tends to happen  during the times when there is low traffic. I have to log into the machine to run sudo /etc/init.d/php-fastcgi restart when the php-cgi process dies. Then it would run fine for a week or so and then die again and the process just repeats and it has been like that for the last four months and even gotten worse lately where the process dies as much as twice in a week.
>
> Nobody seemed to have had this problem until recently when I came across this post that explained the problem in detail http://blog.taragana.com/index.php/archive/how-to-stop-crashing-hanging-of-php-cgi-spawn-fcgi-with-nginx-lighttpd/
>
> However, I did employ their suggestion - Set maximum number of requests to execute per php-cgi process, but still the problem has not gone away.
>
> Has anybody experienced this problem and what could really be the issue here?
>
> Thanks for sparing some time to read through my problem
>
> Kabs
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,2847,2847#msg-2847
>
>

either use php-fpm or a process manager (god, runit, monit, supervisord, etc)

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: php-cgi process dies from time to time in low traffic
June 11, 2009 11:50PM
On Fri, Jun 12, 2009 at 10:47 AM, Edho P Arief<edhoprima@gmail.com> wrote:
> On Fri, Jun 12, 2009 at 9:57 AM, kabs<nginx-forum@nginx.us> wrote:
>>
>> Hello every1
>>
>> Here is story: I have nginx 0.7.35 on ubuntu 8.10 with fastcgi for php stuff. I installed the server by following this tutorial here http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/. In fact the installation I have now is an upgrade from ubuntu 8.04 covered in the tutorial. My first installation worked  beautifully without a problem.
>>
>> My current installation (8.10) has really caused me  a lot of sleepless nights and pain with php-cgi process suddenly going dead and this tends to happen  during the times when there is low traffic. I have to log into the machine to run sudo /etc/init.d/php-fastcgi restart when the php-cgi process dies. Then it would run fine for a week or so and then die again and the process just repeats and it has been like that for the last four months and even gotten worse lately where the process dies as much as twice in a week.
>>
>> Nobody seemed to have had this problem until recently when I came across this post that explained the problem in detail http://blog.taragana.com/index.php/archive/how-to-stop-crashing-hanging-of-php-cgi-spawn-fcgi-with-nginx-lighttpd/
>>
>> However, I did employ their suggestion - Set maximum number of requests to execute per php-cgi process, but still the problem has not gone away.
>>
>> Has anybody experienced this problem and what could really be the issue here?
>>
>> Thanks for sparing some time to read through my problem
>>
>> Kabs
>>
>> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,2847,2847#msg-2847
>>
>>
>
> either use php-fpm or a process manager (god, runit, monit, supervisord, etc)
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>

or just add a cron entry like this

[ ! `pgrep php-cgi` ] && /command/to/start/php-cgi

and run it every ten minutes or so

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: php-cgi process dies from time to time in low traffic
June 12, 2009 01:46AM
Thanks edogawaconan for your response. On first suggestion, could the process be dying because of the type of process manager am using?

I did use your second suggestion of a cron, but sometimes the process just wont restart by command line even manually and the server would require a reboot to get the process back up again. It would be great if I can get to the bottom of what really is causing the process to die. And I don't have much knowledge about fastcgi. Is there a possibility of a process queue being full or something?

Kabs



Edited 1 time(s). Last edit at 06/12/2009 01:46AM by kabs.
Re: php-cgi process dies from time to time in low traffic
June 12, 2009 08:34AM
On Fri, Jun 12, 2009 at 12:46 PM, kabs<nginx-forum@nginx.us> wrote:
>
> Thanks edogawaconan for your response. On first suggestion, could the process be dying because of the type of process manager am using?
>
> I did use your second suggestion of a cron, but sometimes the process just wont restart by command line even manually and the server would require a reboot to get the process back up again. It would be great if I can get to the bottom of what really is causing the process to die. And I don't have much knowledge about fastcgi. Is there a possiblity of a process queue being full or something?
>

that's most likely the reason. I don't really know myself either.

as for requiring reboot - it shouldn't happen if all php-cgi processes
have been dead.


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Since the machine needs a reboot, it could also be something like bad
drive,bad memory etc.

Thanks,
--
Anoop P Alias (PGP Key ID : 0x014F9953)
GNU system administrator
http://GnuSys.net
Re: php-cgi process dies from time to time in low traffic
June 16, 2009 11:17AM
I bit the bullet and re-did the installation and using php-5.2.8, php-5.2.8-fpm-0.5.10, nginx-0.59 on Ubuntu 8.04.2 LTS. I will report in a month's time. My last installation used to fail every two weeks, so fingers crossed on this one. Case closed for now.
Re: php-cgi process dies from time to time in low traffic
June 20, 2009 03:28AM
Well, I guess this case is open again. In less than a week of the new installation my site went down three times for the same reason. Looks like even a fresh installation with php-fpm on a new OS did not help. And the solution every time was to sudo /etc/init.d/php-fpm restart. And the problem is not hardware or RAM. Surely there must be somebody who understands what is going on.

Any help please?

Kabs
Artemy Nikolsky
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 05:05AM
what php extension are you using?


2009/6/20 kabs

>
> Well, I guess this case is open again. In less than a week of the new
> installation my site went down three times for the same reason. Looks like
> even a fresh installation with php-fpm on a new OS did not help. And the
> solution every time was to sudo /etc/init.d/php-fpm restart. And the
> problem is not hardware or RAM. Surely there must be somebody who
> understands what is going on.
>
> Any help please?
>
> Kabs
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?3,2847,3170#msg-3170
>
>
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 10:29AM
Hi Artemy,

In addition to the defaults, am using memcache & APC. Here is my PHP compile configuration

'./configure' '--enable-fastcgi' '--enable-fpm' '--with-mcrypt' '--with-zlib' '--enable-mbstring' '--disable-pdo' '--with-pgsql' '--with-curl' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-xml' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--with-mhash' '--enable-xslt' '--enable-memcache' '--enable-zip' '--with-pcre-regex' '--with-zend-vm=GOTO' '--with-mysql' '--with-gd'

Thanks

Kabs
Artemy Nikolsky
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 10:40AM
I do not see any problems in the expansion.
As written in the logs nginx, php-fpm?

2009/6/23 kabs

>
> Hi Artemy,
>
> In addition to the defaults, am using memcache & APC. Here is my PHP
> compile configuration
>
> './configure' '--enable-fastcgi' '--enable-fpm' '--with-mcrypt'
> '--with-zlib' '--enable-mbstring' '--disable-pdo' '--with-pgsql'
> '--with-curl' '--disable-debug' '--enable-pic' '--disable-rpath'
> '--enable-inline-optimization' '--with-bz2' '--with-xml' '--with-zlib'
> '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl'
> '--enable-mbregex' '--with-mhash' '--enable-xslt' '--enable-memcache'
> '--enable-zip' '--with-pcre-regex' '--with-zend-vm=GOTO' '--with-mysql'
> '--with-gd'
>
> Thanks
>
> Kabs
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?3,2847,3292#msg-3292
>
>
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 12:30PM
I'm looking around, I've never seen the --with-zend-vm option...

According to some blogs and such, it gives a decent performance boost.
However, I don't know how that may affect things, perhaps it still has
some bugs or the php-fpm model of keeping the engines persistent does
not work with it properly.

http://sebastian-bergmann.de/archives/504-PHP-5.1-Performance.html -
says 400% boost, would be worth my while to compile it in too, but I
don't want to if it's going to have issues ;)

Also what OS / version is this on?

You could try a fresh compile without that, and see. It would be nice
for you to be a guinea pig for me. :)

On Tue, Jun 23, 2009 at 7:29 AM, kabs <nginx-forum@nginx.us> wrote:
>
> Hi Artemy,
>
> In addition to the defaults, am using memcache & APC. Here is my PHP compile configuration
>
> './configure' '--enable-fastcgi' '--enable-fpm' '--with-mcrypt' '--with-zlib' '--enable-mbstring' '--disable-pdo' '--with-pgsql' '--with-curl' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-xml' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--with-mhash' '--enable-xslt' '--enable-memcache' '--enable-zip' '--with-pcre-regex' '--with-zend-vm=GOTO' '--with-mysql' '--with-gd'
>
> Thanks
>
> Kabs
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,2847,3292#msg-3292
>
Artemy Nikolsky
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 12:56PM
--with-zend-vm=GOTO is normal option

2009/6/23 Michael Shadle

>
> I'm looking around, I've never seen the --with-zend-vm option...
>
> According to some blogs and such, it gives a decent performance boost.
> However, I don't know how that may affect things, perhaps it still has
> some bugs or the php-fpm model of keeping the engines persistent does
> not work with it properly.
>
> http://sebastian-bergmann.de/archives/504-PHP-5.1-Performance.html -
> says 400% boost, would be worth my while to compile it in too, but I
> don't want to if it's going to have issues ;)
>
> Also what OS / version is this on?
>
> You could try a fresh compile without that, and see. It would be nice
> for you to be a guinea pig for me. :)
>
> On Tue, Jun 23, 2009 at 7:29 AM, kabs wrote:
> >
> > Hi Artemy,
> >
> > In addition to the defaults, am using memcache & APC. Here is my PHP
> compile configuration
> >
> > './configure' '--enable-fastcgi' '--enable-fpm' '--with-mcrypt'
> '--with-zlib' '--enable-mbstring' '--disable-pdo' '--with-pgsql'
> '--with-curl' '--disable-debug' '--enable-pic' '--disable-rpath'
> '--enable-inline-optimization' '--with-bz2' '--with-xml' '--with-zlib'
> '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl'
> '--enable-mbregex' '--with-mhash' '--enable-xslt' '--enable-memcache'
> '--enable-zip' '--with-pcre-regex' '--with-zend-vm=GOTO' '--with-mysql'
> '--with-gd'
> >
> > Thanks
> >
> > Kabs
> >
> > Posted at Nginx Forum:
> http://forum.nginx.org/read.php?3,2847,3292#msg-3292
> >
>
Re: php-cgi process dies from time to time in low traffic
June 23, 2009 03:08PM
I've never specifically fed it in my configure.

On Tue, Jun 23, 2009 at 9:56 AM, Artemy Nikolsky
<artemy.nikolsky@gmail.com> wrote:
>
> --with-zend-vm=GOTO is normal option
>
> 2009/6/23 Michael Shadle <mike503@gmail.com>
>>
>> I'm looking around, I've never seen the --with-zend-vm option...
>>
>> According to some blogs and such, it gives a decent performance boost.
>> However, I don't know how that may affect things, perhaps it still has
>> some bugs or the php-fpm model of keeping the engines persistent does
>> not work with it properly.
>>
>> http://sebastian-bergmann.de/archives/504-PHP-5.1-Performance.html -
>> says 400% boost, would be worth my while to compile it in too, but I
>> don't want to if it's going to have issues ;)
>>
>> Also what OS / version is this on?
>>
>> You could try a fresh compile without that, and see. It would be nice
>> for you to be a guinea pig for me. :)
>>
>> On Tue, Jun 23, 2009 at 7:29 AM, kabs <nginx-forum@nginx.us> wrote:
>> >
>> > Hi Artemy,
>> >
>> > In addition to the defaults, am using memcache & APC. Here is my PHP compile configuration
>> >
>> > './configure' '--enable-fastcgi' '--enable-fpm' '--with-mcrypt' '--with-zlib' '--enable-mbstring' '--disable-pdo' '--with-pgsql' '--with-curl' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-xml' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--with-mhash' '--enable-xslt' '--enable-memcache' '--enable-zip' '--with-pcre-regex' '--with-zend-vm=GOTO' '--with-mysql' '--with-gd'
>> >
>> > Thanks
>> >
>> > Kabs
>> >
>> > Posted at Nginx Forum: http://forum.nginx.org/read.php?3,2847,3292#msg-3292
>> >
>
Re: php-cgi process dies from time to time in low traffic
June 24, 2009 10:06AM
I am running this on Ubuntu 8.04 LTS. These are errors I have in the php-fpm.log. And I can now predictably reproduce the 502 error. Happens when I try to do bulk deletes of my posts.

=====================================================
Jun 24 13:55:06.952649 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jun 24 13:55:06.952649 [WARNING] fpm_children_bury(), line 215: child 6894 (pool default) exited on signal 15 SIGTERM after 253.246432 seconds from start
Jun 24 13:55:06.956649 [NOTICE] fpm_children_make(), line 352: child 6908 (pool default) started
Jun 24 13:55:10.612857 [WARNING] fpm_request_check_timed_out(), line 146: child 6885, script '/home/public_html/web/www/index.php' (pool default) executing too slow (5.112291 sec), logging
Jun 24 13:55:10.612857 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jun 24 13:55:10.612857 [NOTICE] fpm_children_bury(), line 194: child 6885 stopped for tracing
Jun 24 13:55:10.612857 [NOTICE] fpm_php_trace(), line 139: about to trace 6885
Jun 24 13:55:10.612857 [ERROR] fpm_trace_get_long(), line 78: ptrace(PEEKDATA) failed: Input/output error (5)
Jun 24 13:55:10.612857 [NOTICE] fpm_php_trace(), line 167: finished trace of 6885
Jun 24 13:55:10.744865 [WARNING] fpm_request_check_timed_out(), line 158: child 6885, script '/home/public_html/web/www/index.php' (pool default) execution timed out (5.244299 sec), terminating
Jun 24 13:55:10.752865 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jun 24 13:55:10.756865 [WARNING] fpm_children_bury(), line 215: child 6885 (pool default) exited on signal 15 SIGTERM after 352.036061 seconds from start
Jun 24 13:55:10.756865 [NOTICE] fpm_children_make(), line 352: child 6909 (pool default) started
Jun 24 13:55:11.804925 [WARNING] fpm_request_check_timed_out(), line 146: child 6878, script '/home/public_html/web/www/index.php' (pool default) executing too slow (5.120292 sec), logging
Jun 24 13:55:11.804925 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jun 24 13:55:11.804925 [NOTICE] fpm_children_bury(), line 194: child 6878 stopped for tracing
Jun 24 13:55:11.804925 [NOTICE] fpm_php_trace(), line 139: about to trace 6878
Jun 24 13:55:11.804925 [ERROR] fpm_trace_get_long(), line 78: ptrace(PEEKDATA) failed: Input/output error (5)
Jun 24 13:55:11.804925 [NOTICE] fpm_php_trace(), line 167: finished trace of 6878
Jun 24 13:55:11.936933 [WARNING] fpm_request_check_timed_out(), line 158: child 6878, script '/home/public_html/web/www/index.php' (pool default) execution timed out (5.252300 sec), terminating
Jun 24 13:55:12.008937 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD
Jun 24 13:55:12.008937 [WARNING] fpm_children_bury(), line 215: child 6878 (pool default) exited on signal 15 SIGTERM after 364.280759 seconds from start
Jun 24 13:55:12.012937 [NOTICE] fpm_children_make(), line 352: child 6910 (pool default) started
Jun 24 13:55:13.585026 [WARNING] fpm_request_check_timed_out(), line 146: child 6907, script '/home/public_html/web/www/index.php' (pool default) executing too slow (5.004286 sec), logging
=====================================================
Re: php-cgi process dies from time to time in low traffic
June 24, 2009 12:04PM
oh, well it looks like the script is too slow and/or may be blocking...
what does your nginx config look like? 5.1 seconds shouldn't be timing out
and giving a bad gateway with nginx defaults I think (although i would
re-code that, Rasmus will tell you any script that can't execute 100ms or
less is broken)

you may need to tweak nginx so it will wait longer for a reply from the
fastcgi proxy

On Wed, Jun 24, 2009 at 7:06 AM, kabs wrote:

>
> I am running this on Ubuntu 8.04 LTS. These are errors I have in the
> php-fpm.log. And I can now predictably reproduce the 502 error. Happens when
> I try to do bulk deletes of my posts.
>
> =====================================================
> Jun 24 13:55:06.952649 fpm_got_signal(), line 48: received SIGCHLD
> Jun 24 13:55:06.952649 fpm_children_bury(), line 215: child 6894 (pool
> default) exited on signal 15 SIGTERM after 253.246432 seconds from start
> Jun 24 13:55:06.956649 fpm_children_make(), line 352: child 6908 (pool
> default) started
> Jun 24 13:55:10.612857 fpm_request_check_timed_out(), line 146: child
> 6885, script '/home/public_html/web/www/index.php' (pool default) executing
> too slow (5.112291 sec), logging
> Jun 24 13:55:10.612857 fpm_got_signal(), line 48: received SIGCHLD
> Jun 24 13:55:10.612857 fpm_children_bury(), line 194: child 6885 stopped
> for tracing
> Jun 24 13:55:10.612857 fpm_php_trace(), line 139: about to trace 6885
> Jun 24 13:55:10.612857 fpm_trace_get_long(), line 78: ptrace(PEEKDATA)
> failed: Input/output error (5)
> Jun 24 13:55:10.612857 fpm_php_trace(), line 167: finished trace of 6885
> Jun 24 13:55:10.744865 fpm_request_check_timed_out(), line 158: child
> 6885, script '/home/public_html/web/www/index.php' (pool default) execution
> timed out (5.244299 sec), terminating
> Jun 24 13:55:10.752865 fpm_got_signal(), line 48: received SIGCHLD
> Jun 24 13:55:10.756865 fpm_children_bury(), line 215: child 6885 (pool
> default) exited on signal 15 SIGTERM after 352.036061 seconds from start
> Jun 24 13:55:10.756865 fpm_children_make(), line 352: child 6909 (pool
> default) started
> Jun 24 13:55:11.804925 fpm_request_check_timed_out(), line 146: child
> 6878, script '/home/public_html/web/www/index.php' (pool default) executing
> too slow (5.120292 sec), logging
> Jun 24 13:55:11.804925 fpm_got_signal(), line 48: received SIGCHLD
> Jun 24 13:55:11.804925 fpm_children_bury(), line 194: child 6878 stopped
> for tracing
> Jun 24 13:55:11.804925 fpm_php_trace(), line 139: about to trace 6878
> Jun 24 13:55:11.804925 fpm_trace_get_long(), line 78: ptrace(PEEKDATA)
> failed: Input/output error (5)
> Jun 24 13:55:11.804925 fpm_php_trace(), line 167: finished trace of 6878
> Jun 24 13:55:11.936933 fpm_request_check_timed_out(), line 158: child
> 6878, script '/home/public_html/web/www/index.php' (pool default) execution
> timed out (5.252300 sec), terminating
> Jun 24 13:55:12.008937 fpm_got_signal(), line 48: received SIGCHLD
> Jun 24 13:55:12.008937 fpm_children_bury(), line 215: child 6878 (pool
> default) exited on signal 15 SIGTERM after 364.280759 seconds from start
> Jun 24 13:55:12.012937 fpm_children_make(), line 352: child 6910 (pool
> default) started
> Jun 24 13:55:13.585026 fpm_request_check_timed_out(), line 146: child
> 6907, script '/home/public_html/web/www/index.php' (pool default) executing
> too slow (5.004286 sec), logging
> =====================================================
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?3,2847,3327#msg-3327
>
>
Re: php-cgi process dies from time to time in low traffic
June 24, 2009 01:03PM
mike my nginx.conf is here

=================nginx.conf==========================
user www-data;
worker_processes 2;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 10 10;

gzip on;
gzip_comp_level 1;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /usr/local/nginx/logs/access.log main;

error_log /usr/local/nginx/logs/error.log alert;

include /usr/local/nginx/sites-enabled/*;
}
=====================================

And just in case my default.conf too


===============default.conf=====================

server {
listen *:80;
location / {
root /home/public_html/lweb/www;
index index.php index.html index.htm;
include /usr/local/nginx/conf/wordpress_params.super_cache;

# if file exists return it right away
if (-f $request_filename) {
break;
}

# otherwise rewrite the
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php$1 last;
break;
}

}


location ~ \.php$

{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/public_html/web/www$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
}
=================================================================
Re: php-cgi process dies from time to time in low traffic
June 24, 2009 02:41PM
On Wed, Jun 24, 2009 at 10:03 AM, kabs <nginx-forum@nginx.us> wrote:

> events {
-    worker_connections  1024;
+ worker_connections 2048;

>          location ~ \.php$
>        {
>                fastcgi_pass 127.0.0.1:9000;
>                fastcgi_index index.php;
>                fastcgi_param SCRIPT_FILENAME /home/public_html/web/www$fastcgi_script_name;

I'm going to give you some things to try. Best I can do I think :(

+ fastcgi_ignore_client_abort on;
+ fastcgi_intercept_errors off;
+ fastcgi_buffers 32 8k;
+ fastcgi_index index.php;
# I've used this in the past for slow PHP scripts - however
it won't return a 502 bad gateway, it should return a 504 gateway
timeout, but worth a shot
+ fastcgi_read_timeout 120;

>                include /usr/local/nginx/conf/fastcgi_params;
>        }
> }
Kabs,
Would you mind posting your php-fpm.conf file? Also, you might try running
php without APC and seeing if you have any luck. I found this thread from
the Russian php-fpm list that looks like a similar problem but Andrei never
posted if he found out what was causing it.

http://translate.google.com/translate?prev=hp&hl=en&js=n&u=http://groups.google.ru/group/highload-php-ru/browse_thread/thread/5a56d2670fd752c0&sl=ru&tl=en&history_state0=

Davy

On Wed, Jun 24, 2009 at 2:41 PM, Michael Shadle wrote:

>
> On Wed, Jun 24, 2009 at 10:03 AM, kabs wrote:
>
> > events {
> - worker_connections 1024;
> + worker_connections 2048;
>
> > location ~ \.php$
> > {
> > fastcgi_pass 127.0.0.1:9000;
> > fastcgi_index index.php;
> > fastcgi_param SCRIPT_FILENAME
> /home/public_html/web/www$fastcgi_script_name;
>
> I'm going to give you some things to try. Best I can do I think :(
>
> + fastcgi_ignore_client_abort on;
> + fastcgi_intercept_errors off;
> + fastcgi_buffers 32 8k;
> + fastcgi_index index.php;
> # I've used this in the past for slow PHP scripts - however
> it won't return a 502 bad gateway, it should return a 504 gateway
> timeout, but worth a shot
> + fastcgi_read_timeout 120;
>
> > include /usr/local/nginx/conf/fastcgi_params;
> > }
> > }
>
Re: php-cgi process dies from time to time in low traffic
June 24, 2009 11:37PM
Mike, did your changes and still got 502 on my bulk deletes. Davy here is my php-fpm.com file.

====================================================================

<?xml version="1.0" ?>
<configuration>

All relative paths in this config are relative to php's install prefix

<section name="global_options">

Pid file
<value name="pid_file">/usr/local/logs/php-fpm.pid</value>

Error log file
<value name="error_log">/usr/local/logs/php-fpm.log</value>

Log level
<value name="log_level">notice</value>

When this amount of php processes exited with SIGSEGV or SIGBUS ...
<value name="emergency_restart_threshold">10</value>

... in a less than this interval of time, a graceful restart will be initiated.
Useful to work around accidental curruptions in accelerator's shared memory.
<value name="emergency_restart_interval">1m</value>

Time limit on waiting child's reaction on signals from master
<value name="process_control_timeout">5s</value>

Set to 'no' to debug fpm
<value name="daemonize">yes</value>

</section>

<workers>

<section name="pool">

Name of pool. Used in logs and stats.
<value name="name">default</value>

Address to accept fastcgi requests on.
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
<value name="listen_address">127.0.0.1:9000</value>

<value name="listen_options">

Set listen(2) backlog
<value name="backlog">-1</value>

Set permissions for unix socket, if one used.
In Linux read/write permissions must be set in order to allow connections from web server.
Many BSD-derrived systems allow connections regardless of permissions.
<value name="owner">www-data</value>
<value name="group">www-data</value>
<value name="mode">0666</value>
</value>

Additional php.ini defines, specific to this pool of workers.
<value name="php_defines">
<!-- <value name="sendmail_path">/usr/sbin/sendmail -t -i</value> -->
<!-- <value name="display_errors">0</value> -->
</value>

Unix user of processes
<value name="user">www-data</value>

Unix group of processes
<value name="group">www-data</value>

Process manager settings
<value name="pm">

Sets style of controling worker process count.
Valid values are 'static' and 'apache-like'
<value name="style">static</value>

Sets the limit on the number of simultaneous requests that will be served.
Equivalent to Apache MaxClients directive.
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
Used with any pm_style.
<value name="max_children">10</value>

Settings group for 'apache-like' pm style
<value name="apache_like">

Sets the number of server processes created on startup.
Used only when 'apache-like' pm_style is selected
<value name="StartServers">20</value>

Sets the desired minimum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MinSpareServers">5</value>

Sets the desired maximum number of idle server processes.
Used only when 'apache-like' pm_style is selected
<value name="MaxSpareServers">35</value>

</value>

</value>

The timeout (in seconds) for serving a single request after which the worker process will be terminated
Should be used when 'max_execution_time' ini option does not stop script execution for some reason
'0s' means 'off'
<value name="request_terminate_timeout">5s</value>

The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
<value name="request_slowlog_timeout">5s</value>

The log file for slow requests
<value name="slowlog">logs/slow.log</value>

Set open file desc rlimit
<value name="rlimit_files">1024</value>

Set max core size rlimit
<value name="rlimit_core">0</value>

Chroot to this directory at the start, absolute path
<value name="chroot"></value>

Chdir to this directory at the start, absolute path
<value name="chdir"></value>

Redirect workers' stdout and stderr into main error log.
If not set, they will be redirected to /dev/null, according to FastCGI specs
<value name="catch_workers_output">yes</value>

How much requests each process should execute before respawn.
Useful to work around memory leaks in 3rd party libraries.
For endless request processing please specify 0
Equivalent to PHP_FCGI_MAX_REQUESTS
<value name="max_requests">1000</value>

Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
Makes sense only with AF_INET listening socket.
<value name="allowed_clients">127.0.0.1</value>

Pass environment variables like LD_LIBRARY_PATH
All $VARIABLEs are taken from current environment
<value name="environment">
<value name="HOSTNAME">$HOSTNAME</value>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
<value name="TMP">/tmp</value>
<value name="TMPDIR">/tmp</value>
<value name="TEMP">/tmp</value>
<value name="OSTYPE">$OSTYPE</value>
<value name="MACHTYPE">$MACHTYPE</value>
<value name="MALLOC_CHECK_">2</value>
</value>

</section>

</workers>

</configuration>

===================================================================
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready