Monday, May 19, 2025

AWS Cross-Zone Load Balancing: Concept, Key Features, Benefits, Limitations, & Use case

 

AWS Cross-Zone Load Balancing is a feature of Elastic Load Balancing (ELB) that allows load balancers to distribute incoming traffic evenly across all registered targets in all enabled Availability Zones (AZs), not just within the same zone as the traffic originated.

 Concept

In a multi-AZ setup, enabling Cross-Zone Load Balancing ensures that each load balancer node can route requests to targets in all AZs, helping achieve a more balanced load and fault tolerance.

 Key Features

  1. Uniform Load Distribution
    Distributes traffic evenly across all healthy targets in all enabled AZs.
  2. Improved Fault Tolerance
    If one AZ has fewer targets, traffic can still be distributed to targets in other zones.
  3. Available for All ELB Types
    Supported by Application Load Balancer (ALB), Network Load Balancer (NLB), and Classic Load Balancer (CLB).
  4. Configuration Flexibility
    • ALB: Always enabled and free.
    • NLB: Configurable and chargeable (data transfer across zones).
    • CLB: Can be enabled or disabled.
  5. Elasticity
    Helps maintain performance and reliability during scaling.

 Benefits

  • Better Resource Utilization
    Prevents overloading targets in one AZ while others are underutilized.
  • Simplified Architecture
    Reduces need for manual routing or per-AZ target balancing.
  • High Availability
    Distributes requests during AZ failure or imbalance, ensuring continued service.
  • Cost-Effective for ALB
    No additional cost for cross-zone traffic with ALB.

 Limitations

  • Cross-Zone Charges for NLB
    AWS charges for inter-AZ traffic if cross-zone load balancing is enabled on Network Load Balancers.
  • Latency Considerations
    Requests may be forwarded to targets in different AZs, introducing minor additional latency.
  • Complex Monitoring
    Metrics must be observed carefully to ensure that traffic is balanced as intended.
  • Dependency on Target Health
    Malfunctioning health checks can still disrupt balance if not configured properly.

 Use Cases

  1. Multi-AZ Web Applications
    Ensure even traffic distribution and high availability for web apps deployed in multiple AZs.
  2. Auto Scaling Groups Spanning AZs
    When using Auto Scaling across AZs, cross-zone balancing ensures all instances get traffic.
  3. Disaster Recovery Setup
    Helps in gracefully failing over traffic to another AZ without complex configurations.
  4. Cost Optimization with ALB
    Leverage free cross-zone traffic to maximize resource usage in all AZs.
twtech-insights:

For the ALB:

 Cross-Zone Load Balancing is enabled by default. it can also can be disabled at the Target Group level.

 There are no extra charges if data goes across Availability zones (AZ).

For Network Load Balancer and Gateway Load Balancer:

Cross-Zone Load Balancing is disabled by default.

twtech is charged for all the Availability Zones that Cross-Zone Load Balancing is enable.

For Classic Load Balancer

Cross-Zone Load Balancing is disabled by default.

twtech is not charged for enabling for Cross-Zone Load Balancing if enabled in all the AZ.

Project: Hands-on

How twtech enables Cross-Zone Load Balancing for: network load balancer (NLB)

Edit load balancer attributes:

From Cross-Zone Load Balancing: off

From Cross-Zone Load Balancing(architecture displays) off


From Cross-Zone Load Balancing(architecture displays) on

Enable cross-zone load balancingEach load balancer node load balances traffic among healthy targets in all its enabled Availability Zones. Data transfer charges apply 


Save changes:


No comments:

Post a Comment

Kubernetes Clusters | Upstream Vs Downstream.

  The terms "upstream" and "downstream" in the context of Kubernetes clusters often refer to the direction of code fl...