atom feed8 messages in ru.sysoev.nginxSimple threading question
FromSent OnAttachments
Ankur GuptaSep 26, 2010 11:04 pm 
mat hSep 26, 2010 11:16 pm 
Ankur GuptaSep 26, 2010 11:49 pm 
mat hSep 26, 2010 11:56 pm 
Igor SysoevSep 27, 2010 12:18 am 
Phillip OldhamSep 27, 2010 12:27 am 
Ian HobsonSep 27, 2010 4:59 am 
SpliticeSep 27, 2010 8:47 am 
Subject:Simple threading question
From:Ankur Gupta (anku@gmail.com)
Date:Sep 26, 2010 11:04:37 pm
List:ru.sysoev.nginx

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