How nginx define a free worker?

chen cw crk_world at
Fri Nov 23 03:38:06 UTC 2012

1. How nginx define a free worker
    "ngx_accept_disabled = ngx_cycle->connection_n / 8 -
    so when the number of free connections is more than the value of
"worker_connections" directive, the worker is free.

2. Will it be doing round robin?

No, it is not RR.
In fact, nginx use the tecnology called  "accept mutax", so only one worker
is listening on the port, others are waiting.
you can refer to "ngx_process_events_and_timers()" for more information.

On Thu, Nov 22, 2012 at 12:51 AM, Vivek Goel <goelvivek2011 at>wrote:

> Hi,
> If  I have n cores and I am running n nginx worker process how nginx will
> decide free worker for next connection?
>    1. Will it be doing round robin?
> If it is not using round robin what method it use? Is there a way I can
> force it to use round robin method?
> regards
> Vivek Goel
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at



Charles Chen

Software Engineer

Server Platforms Team at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list