Cross-Zone Load Balancing
Learn how cross-zone balancing increases the availability and fault-tolerance by distributing incoming traffic across multiple appliances,
Cross-zone balancing
In Elastic Load Balancers, incoming traffic is distributed evenly across load balancer nodes in each AZ, which then forwards these requests to the targets registered within that AZ. However, Elastic Load Balancers allow us to enable cross-zone load balancing, where all load balancer nodes can distribute traffic to all available healthy targets, irrespective of their Availability Zone.
Let's look at the diagram given below to have a better understanding of how cross-zone load balancing works.
In the first slide, we have two AZs available for our ALB. There are two healthy targets in one AZ-1 and five healthy targets in AZ-2. As cross-zone load balancing is not enabled, the load balancer node in each AZ will only be able to send the client requests to the targets available in their respective AZs. Hence, each target in AZ-1 will receive 25% of the requests, while the targets in AZ-2 will receive 10% of the requests each.
In the second slide, as cross-zone load balancing is enabled, incoming client requests are distributed among all available healthy targets, irrespective of their Availability Zone.
Cross-zone balancing in different load balancers
Let's see how cross-zone load balancing works in the case of different load balancers:
Application Load Balancers: In ALBs, cross-zone load balancing is enabled by default and cannot be disabled on the load balancer level. However, we do have the option of disabling cross-zone load balancing on the target group level.
Network Load Balancers: By default, cross-zone load balancing is not enabled in NLBs, and traffic on one node is distributed among targets in a single AZ. However, we do have the option of enabling cross-zone load balancing at the load balancer or the target group level.
Gateway Load Balancers: We have the option to enable cross-zone load balancing in GLBs to distribute traffic from one load balancer node to targets in all AZs.
Benefits of using cross-zone load balancing
Following are some of the benefits of using cross-zone load balancing:
Increased availability: By cross-zone load balancing, we can increase the availability of our application servers by distributing traffic across targets available in different AZs.
Increased fault-tolerance: Through cross-zone load balancing, we can distribute traffic across all AZ, which allows load balancers to easily redirect requests in case a target or AZ becomes unavailable.
High scalability: Cross-zone load balancing supports horizontal scalability and automatically distributes traffic across newly registered targets.
Get hands-on with 1300+ tech skills courses.