Welcome! Log In Create A New Profile

Advanced

Re: Simple threading question

September 27, 2010 08:04AM
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 that
> if I make two requests at the same time (from the same IP address), they
> 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.

Regards

Ian


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Simple threading question

Ankur Gupta September 27, 2010 02:10AM

Re: Simple threading question

mat h September 27, 2010 02:26AM

Re: Simple threading question

Ankur Gupta September 27, 2010 02:54AM

Re: Simple threading question

mat h September 27, 2010 03:00AM

Re: Simple threading question

Phillip Oldham September 27, 2010 03:34AM

Re: Simple threading question

Igor Sysoev September 27, 2010 03:22AM

Re: Simple threading question

hobson42 September 27, 2010 08:04AM

Re: Simple threading question

Splitice September 27, 2010 11:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 139
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready