Another soln, dont start a session on the blocking page if it is not
Sent from my iPod
On 27/09/2010, at 9:59 PM, Ian Hobson <ia...@ianhobson.co.uk> wrote:
On 27/09/2010 07:05, Ankur Gupta wrote:
I have a bunch of nginx and php-fpm worker threads. I am running a
very simple test with a script doing: <? sleep(20); ?>. I notice
if I make two requests at the same time (from the same IP address),
get serialized on the
php-fpm side and have a twenty second differential. Why would this
happen and the two requests not get processed in parallel when there
are an abundant number of threads?
This is a feature of PHP.
It carefully sequences the accesses so that only one thread at a
time can access the session variables.
You can call session_write_close() after you have updated all your
session variables, to tell php you are done with the session and it
will release any waiting thread.
If nginx is serving static content, these serves will not be effected.