nginx blocking during long running PHP request?

Rt Ibmer rtibmx at yahoo.com
Thu Feb 26 09:38:13 MSK 2009


I am using php-fpm and compiled PHP with the --enable-fastcgi and --enable-fpm switches among others. At boot time a script in /etc/init.d launches it.

phpinfo shows CGI/FastCGI as the server API.

In looking at /usr/php/etc/php-fpm.conf I see: 

 <value name="max_children">5</value>

and

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">500</value>

Although - I just noticed this - in my php-fpm start up script it has this:

php_fpm_CONF=/usr/php/etc/php-fpm.conf
php_opts=""
# i.e. php_opts="--fpm-config $php_fpm_CONF"

Notice how the php_opts is blank.  So perhaps my config file is being ignored completely?

Then again, it probably is getting picked up because the listening port of 8888 is set in the php-fpm.conf file and obviously being picked up from there I would think, because where else could it get this (it is not set in the php-fpm startup script)?

Is there a way I can verify what php-fpm is using as the fcgi-children and max request settings? What else can I check into?

Thank you!!



--- On Thu, 2/26/09, mike <mike503 at gmail.com> wrote:

> From: mike <mike503 at gmail.com>
> Subject: Re: nginx blocking during long running PHP request?
> To: "nginx at sysoev.ru" <nginx at sysoev.ru>
> Cc: "nginx" <nginx at sysoev.ru>
> Date: Thursday, February 26, 2009, 5:00 AM
> Do you use php-fpm (I hope?)
> 
> I noticed you did not mention how you manage your fastcgi
> engines.
> 
> On Feb 25, 2009, at 6:17 PM, Rt Ibmer
> <rtibmx at yahoo.com> wrote:
> 
> > I use nginx to frontend fastcgi and PHP.  I have a PHP
> page that accesses a mySQL db and executes a query which
> takes about 30 seconds to execute.
> > 
> > During that time, if I hit another php page on my
> site, the browser just spins and does not load the php page
> until the other php page finishes executing the query.
> > 
> > I am not sure if it is nginx blocking somehow, or
> perhaps PHP can only execute one page at a time (which would
> be a major bottleneck when we go to production - right now
> we are just testing).
> > 
> > Here is my location block that handles the PHP
> request:
> > 
> > location ~ .*\.php$ {
> >        include fastcgi;
> >        fastcgi_read_timeout 180s;
> >        fastcgi_pass  127.0.0.1:8888;
> >        fastcgi_index index.php;
> >        fastcgi_intercept_errors  on;
> >        error_page  404         /404.php;
> >        root    html;
> >    }
> > 
> > Am I missing a setting somewhere that is preventing
> nginx and/or PHP from executing on multiple requests
> simultaneously?  What other troubleshooting steps can I
> take?
> > 
> > Thank you!
> > 
> > 
> > 
> > 
> > 
> >


      






More information about the nginx mailing list