<div dir="ltr">Hi Aleks,<div><br></div><div>Those information are extremely helpful. Much appreciated!</div><div><br></div><div>Regards,</div><div>Frank</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 14, 2017 at 1:47 AM, Aleksandar Lazic <span dir="ltr"><<a href="mailto:al-nginx@none.at" target="_blank">al-nginx@none.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<span class=""><br>
<br>
Am 12-04-2017 23:50, schrieb Frank Liu:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
How does nginx balances traffic to upstream with different weight?<br>
If I have 3 servers in upstream, with weight 1, 2, 4, assuming all are healthy, will nginx send traffic to server 1, 2, 3, 2, 3, 3, 3 or 1, 2, 2, 3, 3, 3, 3?<br>
If I have two servers with both weight 50, will nginx will 50 requests to server 1, and then 50 to server 2, or will it calculate the ration to be 1:1 and send one after another?<br>
</blockquote>
<br></span>
You can find a explanation of the algorithm in the commit messages.<br>
<br>
<a href="http://hg.nginx.org/nginx/rev/c90801720a0c" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/rev/<wbr>c90801720a0c</a><br>
<a href="http://hg.nginx.org/nginx/rev/d05ab8793a69" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/rev/<wbr>d05ab8793a69</a><br>
<a href="http://hg.nginx.org/nginx/rev/0811376954e4" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/rev/<wbr>0811376954e4</a><br>
<br>
I have found this with this query.<br>
<br>
<a href="http://hg.nginx.org/nginx/log?rev=weight" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/log?<wbr>rev=weight</a><br>
<br>
Have you seen this doc?<br>
<a href="http://nginx.org/en/docs/http/load_balancing.html" rel="noreferrer" target="_blank">http://nginx.org/en/docs/http/<wbr>load_balancing.html</a><br>
<br>
Best Regards<br>
Aleks<br>
</blockquote></div><br></div>