High Availability Load Balancing with Cross-Zone Load Balancing
Nauman Munir
Senior DevOps and Cloud Consultant | AWS | Azure | GCP | Kubernetes | AWS Certified Solutions Architect – Professional
In high availability load balancing designs, distributing workloads across multiple Availability Zones (AZs) is a best practice to enhance resilience and protect against failures. If one AZ experiences an outage, the application can continue to function as the load is shared across other healthy AZs. AWS offers a feature called cross-zone load balancing, which optimizes how incoming traffic is distributed across instances in multiple AZs, ensuring even distribution of traffic and maintaining balanced workloads.
By default, AWS Application Load Balancers (ALBs) have cross-zone load balancing enabled. This means that incoming traffic is distributed evenly across all registered instances in every AZ associated with the load balancer, rather than limiting the distribution to instances within a single AZ. This approach prevents any one AZ from becoming overwhelmed with traffic while others remain underutilized, thus providing a more balanced and efficient use of resources.
领英推荐
Consider an example with two AZs: AZ-A and AZ-B. Suppose AZ-A has two servers, and AZ-B has four. If cross-zone load balancing is disabled, the ALB would send 50% of the traffic to each AZ. In this case, each server in AZ-A would handle 25% of the total traffic (50% traffic load / 2 servers), while each server in AZ-B would handle only 12.5% of the total traffic (50% traffic load / 4 servers). This uneven distribution could lead to overloading the servers in AZ-A, while the servers in AZ-B remain underutilized.
With cross-zone load balancing enabled, however, the ALB distributes the traffic evenly across all six servers, regardless of their AZs. Each server would receive an equal share of traffic, ensuring a more balanced and efficient load distribution.