NGINX and the “Power of Two Choices” Load-Balancing Algorithm
NGINX and the “Power of Two Choices” Load-Balancing Algorithm New use cases sometimes require new load‑balancing algorithms, and in NGINX Plus R16 and open source NGINX 1.15.1 we added a new method that is particularly suitable for distributed load balancers: an implementation of the “power of two choices” algorithm. Why Do We Need a New Load‑Balancing Algorithm? Classic load‑balancing methods such as Least Connections work very well when you operate a single active load balancer which maintains a complete view of the state of the load‑balanced nodes. The “power of two choices” approach is not as effective on a single load balancer, but it deftly avoids the bad‑case “herd behavior” that can occur when you scale out to a number of independent load balancers. This scenario is not just observed when you scale out in high‑performance environments; it’s also observed in containerized [ more… ]