<div>1. How nginx define a free worker</div><div> "ngx_accept_disabled = ngx_cycle->connection_n / 8 - ngx_cycle->free_connection_n;"</div><div> so when the number of free connections is more than the value of "worker_connections" directive, the worker is free.</div>
<div><br></div><div>2. Will it be doing round robin?</div><div><br></div><div>No, it is not RR.</div><div>In fact, nginx use the tecnology called "accept mutax", so only one worker is listening on the port, others are waiting.</div>
<div>you can refer to "ngx_process_events_and_timers()" for more information.</div><div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 22, 2012 at 12:51 AM, Vivek Goel <span dir="ltr"><<a href="mailto:goelvivek2011@gmail.com" target="_blank">goelvivek2011@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, <br>If I have n cores and I am running n nginx worker process how nginx will decide free worker for next connection?<div>
<br></div><div><ol><li>Will it be doing round robin?</li></ol><div>If it is not using round robin what method it use? Is there a way I can force it to use round robin method?</div>
regards<span class="HOEnZb"><font color="#888888"><div>Vivek Goel</div><br>
</font></span></div>
<br>_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br>
<p><span lang="EN-US">--</span></p>
<p><span lang="EN-US">Charles Chen</span></p>
<p><span lang="EN-US">Software Engineer</span></p>
<p><span lang="EN-US">Server Platforms Team at Taobao.com</span><br></p><br>
</div>