Welcome! Log In Create A New Profile

Advanced

Re: Simple threading question

Ankur Gupta
September 27, 2010 02:54AM
I can change the number of threads but my question is something completely
orthogonal to what you replied. Why did the two server requests to php-fpm
get serialized and not happen in parallel even though there are enough
worker threads?

On Sun, Sep 26, 2010 at 11:17 PM, mat h <mat999@gmail.com> wrote:

> nginx doesnt need 100+ threads, it uses an event worker model. Set
> your worker_processes to something more reasonable. If you are trying
> to handle 150 requests then you really only need a single worker.
>
> On Mon, Sep 27, 2010 at 4:05 PM, Ankur Gupta <ankur655@gmail.com> wrote:
> > Hi,
> >
> > 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? Here are the two requests in the
> > slow log file and they have a twenty second difference:
> >
> > Sep 26 19:02:38.177091 pid 13597 (pool default)
> > script_filename = /var/www/test1/test.php
> > [0x00000000095b5280] sleep() /var/www/test1/test.php:2
> >
> > Sep 26 19:02:58.321560 pid 13609 (pool default)
> > script_filename = /var/www/test1/test.php
> > [0x000000000942a890] sleep() /var/www/test1/test.php:2
> >
> > I have 100+ nginx threads
> > $ ps -afe | grep nginx | wc -l
> > 120
> >
> > and 150 php-fpm threads
> > $ ps -afe | grep php-fpm | wc -l
> > 150
> >
> >
> > Thanks,
> > Ankur
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
> >
> >
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
_______________________________________________
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: 119
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