PHP-FPM and concurrency

Patrick J. Walsh pwalsh at esoft.com
Thu Jan 28 17:02:44 MSK 2010


If this is PHP and you are using sessions, I would guess that your sessions are blocking.  With sessions enabled, each PHP client has a write lock on the sessions file and concurrent requests are blocked to wait for the session to be available for an exclusive lock.  As soon as you are done making changes to a session, close it for writing and other requests will be handled.  See this page for details:

http://php.net/session_write_close

..Patrick



On Jan 28, 2010, at 6:21 AM, Reinis Rozitis wrote:

> Static files are most likely served instantly rather than keeping a connection hanging for a minute (to check something different than php you can try a perl script with just sleep(60); in it).
> You can also look if nginx gets the second request (if not then its still the browser problem and not webserver) just by checking the access and errorlog (in case there is some fastcgi backend timeout).
> 
> Of course it might be a problem with php/fpm config. How many php childs do you spawn? Could it be possible that all childs are taken at the moment for processing your ~1min scripts?
> 
> rr
> 
> 
> ----- Original Message ----- From: "Kiril Angov" <kupokomapa at gmail.com>
> To: <nginx at nginx.org>
> Sent: Thursday, January 28, 2010 3:00 PM
> Subject: Re: PHP-FPM and concurrency
> 
> 
>> Hello,
>> 
>> thanks but for the reason of browser configuration, I checked to see if I can open other resources from the same domain from the same browser and it work for static files. Also, browser limits would be per tab or at least 6 requests per second, not really 6 concurrent connections.
>> 
>> Any other suggestions?
>> 
>> On Jan 28, 2010, at 12:08 PM, Reinis Rozitis wrote:
>> 
>>> It is probably more related to how many connections at max a single browser instance keeps open to a single hostname.
>>> 
>>> For Firefox for example usually the default value is only 2. ( can search google for network.http.max-connections-per-server )
>>> IE has 6 at least (but seems you are not using that).
>>> 
>>> Increase those and see if it helps.
>>> 
>>> rr
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20100128/085580f8/attachment.bin>


More information about the nginx mailing list