3 messages in ru.sysoev.nginxRe: optimizing worker processes usage
FromSent OnAttachments
Manlio PerilloSep 24, 2007 4:45 am 
Igor SysoevSep 24, 2007 12:21 pm 
Manlio PerilloOct 1, 2007 2:31 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: optimizing worker processes usageActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Sep 24, 2007 12:21:42 pm
List:ru.sysoev.nginx

On Mon, Sep 24, 2007 at 01:45:54PM +0200, Manlio Perillo wrote:

Doing some tests with mod_wsgi, I have found some "problems" with worker processes usage.

I have worker_processes set to 2 (and I have a Dual Core CUP).

When a WSGI app "quickly" return a chunk of data (and write it at once), nginx seems to use only one process, serializing all the requestes.

How can I optimize the code so that nginx can use all the worker processes?

I have found that if the WSGI app calls, as an example, sleep(0.01), then nginx will use all of its worker processes (but this slow down the response time: 159.52 req/sec vs 2848.19 req/sec)

It's up to OS.

nginx uses accept_mutex to receive new connection notifications form kqueue/epoll/etc in only one worker. It seems that your load is not enough to utilize two CPUs.