weight and balancing in upstream proxy

Frank Liu gfrankliu at gmail.com
Fri Apr 14 20:01:54 UTC 2017


Hi Aleks,

Those information are extremely helpful. Much appreciated!

Regards,
Frank


On Fri, Apr 14, 2017 at 1:47 AM, Aleksandar Lazic <al-nginx at none.at> wrote:

> Hi.
>
> Am 12-04-2017 23:50, schrieb Frank Liu:
>
> Hi,
>>
>> How does nginx balances traffic to upstream with different weight?
>> 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?
>> 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?
>>
>
> You can find a explanation of the algorithm in the commit messages.
>
> http://hg.nginx.org/nginx/rev/c90801720a0c
> http://hg.nginx.org/nginx/rev/d05ab8793a69
> http://hg.nginx.org/nginx/rev/0811376954e4
>
> I have found this with this query.
>
> http://hg.nginx.org/nginx/log?rev=weight
>
> Have you seen this doc?
> http://nginx.org/en/docs/http/load_balancing.html
>
> Best Regards
> Aleks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170414/1e868eb7/attachment.html>


More information about the nginx mailing list