Cross-Zone Load Balancing for NLB
What you'll learn: How to distribute traffic evenly across all targets in multiple availability zones using Network Load Balancers, and understand when it costs extra.
The Default Behavior Problem
By default, an NLB distributes traffic only to targets within the same availability zone where the traffic arrives. Imagine you have three availability zones (AZ-A, AZ-B, AZ-C) with different numbers of targets: 5 in AZ-A, 2 in AZ-B, and 3 in AZ-C.
If most traffic comes through AZ-A's NLB node, those 5 targets get all that traffic while the targets in other zones sit idle. This creates an imbalanced load distribution.
What Cross-Zone Load Balancing Does
Cross-zone load balancing allows each NLB node to distribute traffic evenly across all healthy targets in all enabled availability zones, regardless of where the traffic entered.
Using the same example: traffic arriving at AZ-A's node would now be distributed across all 10 targets (5+2+3), ensuring each target receives roughly equal load. This is like having a single queue for all checkout lanes instead of separate queues per lane.
The Cost Consideration
Unlike Application Load Balancers (where cross-zone is free), Network Load Balancers charge for data transferred between availability zones when cross-zone load balancing is enabled. You pay for the cross-zone data traffic at standard inter-AZ data transfer rates.
This is a critical design decision: better traffic distribution versus additional data transfer costs.
When to Enable It
Enable cross-zone load balancing when:
- You have uneven target distribution across zones
- Traffic balance is more important than cost optimization
- You need predictable, even load distribution
Key Takeaway: Cross-zone load balancing for NLB ensures even traffic distribution across all availability zones but incurs inter-AZ data transfer charges—balance performance needs against cost implications.