weight and balancing in upstream proxy
reallfqq-nginx at yahoo.fr
Thu Apr 13 08:09:16 UTC 2017
That is an interesting questions as intuitively, people could think the
former behavior applies.
If I got the source code
right, and as the docs
state, nginx is following a weighted round-robin
It thus means it will go over the same list of servers everytime a peer
needs to be chosen (ie for every request), and pick the first not having
depleted its weight allocation.
To me, it would use the latter of your proposals.
Please correct me if I am wrong, so incorrect information does not
propagate too much. :o)
On Wed, Apr 12, 2017 at 11:50 PM, Frank Liu <gfrankliu at gmail.com> wrote:
> 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?
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx