- The load balancer distributes traffic to backends with a simple round-robin mechanism.
- With default config, each backend is assigned weight "1" so all backends are given equal chance of receiving requests.
- If some backend is given weight 2, then that backend is given twice the number of connections.
Hence, changing weights is a way to make sure all backends have the same load.
Based on the load feedback from backend, define the weight of each backend such that all backends have a very similar distribution of requests
For eg, consider we've 3 backends A, B, C.
- If the backends have a similar load, then weights stay 1, 1, 1.
- If A & B have load "L", but C has load "0.8L", weights should increase for C so that it can ultimately catch up and reach load L in future.
In my case, this is a TCP load balancer (L4) acting as the first point behind multiple L7 load balancers.
TCP Load Balancer -> LVS (ipvs+linux) Backend -> Nginx
Is there a proposed well-known algorithm on how should the weight be chosen to ensure that all backends will ultimately achieve similar load in future?