A cross-zone load balancing question: what changes when you enable it on an NLB?
IntermediateScenarioLoad Balancing, Proxies & CDN
Answer
Situation read → Without cross-zone each LB node only sends traffic to targets in its own AZ.
What I'd do →
- Without it an AZ with fewer targets gets the same share of traffic as one with many, causing hot spots
- Enable:
aws elbv2 modify-load-balancer-attributes --attributes Key=load_balancing.cross_zone.enabled,Value=true - ALB has it on by default, NLB and GWLB off by default
- Remember cross-AZ data transfer charges apply on NLB when enabled
Why → Cross-zone evens load but adds inter-AZ cost and a shared failure surface.
Interview tip → Mention that you keep target counts balanced across AZs when it's off.
More on Load Balancing, Proxies & CDN
What is the difference between a Layer 4 and a Layer 7 load balancer?BeginnerWhen do you choose an ALB and when an NLB in AWS?BeginnerForward proxy versus reverse proxy: what is the difference?BeginnerHow do health checks work on a load balancer and what makes a good one?BeginnerWhat are sticky sessions and why would you avoid them?BeginnerWhat does a CDN do and when does it help?Beginner