Simple threading question

Phillip Oldham phill at activityhq.com
Mon Sep 27 11:28:16 MSD 2010


  On 27/09/2010 07:50, Ankur Gupta wrote:
> 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?

It may be that nginx is proxying to the same php process, which has 
multiple threads, and your sleep command in that thread is causing the 
process to sleep. I've found that the best set-up is 1/2 nginx workers 
(depending on how many CPUs/cores you're running and how much SSL 
traffic you have), multiple PHP processes, each running a small number 
(<5) threads. Specifically, or main production server runs 2/20/4. If 
you need to issue sleep() commands and it *is* locking the process 
rather than the specific thread, maybe reduce that to 2/30-50/1?

-- 

*Phillip B Oldham*
ActivityHQ
phill at activityhq.com <mailto:phill at theactivitypeople.co.uk>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named 
recipient(s) only and may be confidential. If they have come to you in 
error, please reply to this e-mail and highlight the error. No action 
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is 
not a 100% secure communications medium, and we have taken steps to 
ensure that this e-mail and attachments are free from any virus. We must 
advise that in keeping with good computing practice the recipient should 
ensure they are completely virus free, and that you understand and 
observe the lack of security when e-mailing us.

------------------------------------------------------------------------



More information about the nginx mailing list