Disable Cross zone load balancing on target groups

0

In our ECS Fargate configuration utilizing an Application Load Balancer by default cross zone loadbalcer is enabled, how does the implementation of cross-zone load balancing benefit our infrastructure? Is there any associated cost for enabling this feature? Furthermore, how does cross-zone load balancing contribute to ensuring high availability within our system? Finally, what specific advantages does enabling cross-zone load balancing offer compared to disabling it?

2 Answers
1

Hello,

  1. Cross-zone load balancing guarantees that incoming traffic is uniformly distributed across all ECS tasks within your ECS services across different Availability Zones (AZs), preventing any single AZ from overloading and ensuring a balanced distribution of traffic load.
  2. By distributing traffic across multiple AZs, cross-zone load balancing helps in maintaining service availability even if an ECS task or an entire AZ goes down. This redundancy is critical for maintaining high availability and fault tolerance in your infrastructure.

AWS charges for data transfer between Availability Zones (AZs). When cross-zone load balancing is enabled, traffic may be routed across multiple AZs, resulting in inter-AZ data transfer costs. These costs vary depending on the amount of data transferred and the AWS region in which your resources are located.

With Application Load Balancers, cross-zone load balancing is always turned on at the load balancer level, and cannot be turned off. For target groups, the default is to use the load balancer setting, but you can override the default by explicitly turning cross-zone load balancing off at the target group level.

For more information about CZ-LB:

  1. https://docs.aws.amazon.com/elasticloadbalancing/latest/application/disable-cross-zone.html
  2. https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#availability-zones
profile picture
EXPERT
answered a month ago
profile pictureAWS
EXPERT
iBehr
reviewed a month ago
  • Correcting a bit, if an entire AZ fails, so will the load balancer node in that AZ. Whether cross-AZ load balancing is enabled or disabled will make no difference.

0

The cross-zone load balancing option allows the load balancer to send traffic it received in one AZ to a target group member in a different AZ. Typically, the main drawback is simply that cross-AZ network traffic in a VPC or across VPC peering connections is charged separately, while traffic that stays inside AZ is usually free (with some exceptions, such as traffic passing through a Transit Gateway incurring a cost also within an AZ).

There can be more elaborate considerations for complex environments. For example, a service behind a load balancer could have plenty of resources in each AZ and be designed such that it would use compute capacity in a given AZ to provide service to client systems in the same AZ. Aside from costs, this could be a component in an advanced design regarding how capacity is managed, or how negative impact from load peaks or zonal network disruptions in one AZ could be attempted to be prevented from affecting resources in other AZs. Containing traffic within an AZ could also benefit from the marginally shorter network latencies than when crossing an AZ boundary, but latencies are so short within a region that this is rarely significant.

However, those are relatively advanced considerations. In most cases where the relevance of cross-AZ load balancing isn't known, the main disadvantage of using it is simply the cost of cross-AZ traffic. The benefit of allowing cross-AZ load balancing is that requests can be serviced by all the available compute resources in any AZ. The impact of a disruption or lack of capacity in one AZ can be reduced by service being provided by resources in a neighbouring AZ.

EXPERT
Leo K
answered a month ago