Bird
Raised Fist0
AWScloud~10 mins

Cross-zone load balancing in AWS - Step-by-Step Execution

Choose your learning style10 modes available
Process Flow - Cross-zone load balancing
Client sends request
↓
Load Balancer receives request
↓
Check cross-zone load balancing setting
↓
Distribute evenly
↓
Forward request
↓
Target instances process request
↓
Response sent back
The load balancer receives a request and decides how to distribute it based on cross-zone load balancing setting. If enabled, it spreads requests evenly across all zones; if disabled, it sends requests only to targets in the same zone as the client.
Execution Sample
AWS
Client -> Load Balancer
Load Balancer: cross-zone enabled = true
Targets in Zone A: 3
Targets in Zone B: 2
Distribute requests evenly across zones
This setup shows a load balancer with cross-zone load balancing enabled distributing client requests evenly across targets in multiple zones.
Process Table
StepActionCross-zone Enabled?Targets in Zone ATargets in Zone BRequest DistributionResult
1Client sends requesttrue32N/ARequest received by load balancer
2Load balancer checks settingtrue32EnabledWill distribute evenly across zones
3Distribute request 1true32EvenlySent to Zone A target 1
4Distribute request 2true32EvenlySent to Zone B target 1
5Distribute request 3true32EvenlySent to Zone A target 2
6Distribute request 4true32EvenlySent to Zone B target 2
7Distribute request 5true32EvenlySent to Zone A target 3
8All requests distributedtrue32EvenlyRequests balanced across zones
9Client sends requestfalse32N/ARequest received by load balancer
10Load balancer checks settingfalse32DisabledWill distribute only to targets in client's zone
11Client in Zone A sends requestfalse32Zone A onlySent to Zone A target 1
12Client in Zone B sends requestfalse32Zone B onlySent to Zone B target 1
13Requests distributed per zonefalse32Zone-specificRequests not balanced across zones
💡 Execution stops after requests are distributed according to cross-zone load balancing setting.
Status Tracker
VariableStartAfter Step 3After Step 4After Step 5After Step 6After Step 7Final
Cross-zone Enabledtruetruetruetruetruetruefalse
Requests sent to Zone A targets0112233
Requests sent to Zone B targets0011222
Key Moments - 2 Insights
Why does the load balancer send requests only to targets in the client's zone when cross-zone load balancing is disabled?
When cross-zone load balancing is disabled (see execution_table rows 10-13), the load balancer restricts requests to targets in the same zone as the client to reduce cross-zone data transfer costs.
How does enabling cross-zone load balancing affect request distribution?
Enabling cross-zone load balancing (execution_table rows 2-8) causes the load balancer to distribute requests evenly across all healthy targets in all zones, improving load distribution.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 5. Which target receives the request?
AZone B target 1
BZone A target 2
CZone A target 1
DZone B target 2
💡 Hint
Check the 'Request Distribution' and 'Result' columns at step 5 in execution_table.
At which step does the load balancer distribute requests only to targets in the client's zone?
AStep 2
BStep 6
CStep 10
DStep 8
💡 Hint
Look for when 'Cross-zone Enabled?' is false and distribution is zone-specific in execution_table.
If cross-zone load balancing is enabled, how many requests are sent to Zone B targets after 7 requests?
A2
B3
C4
D1
💡 Hint
Refer to variable_tracker row 'Requests sent to Zone B targets' after step 7.
Concept Snapshot
Cross-zone load balancing controls how a load balancer distributes requests across availability zones.
Enabled: requests spread evenly across all zones' targets.
Disabled: requests sent only to targets in the client's zone.
Improves fault tolerance and load distribution.
May increase cross-zone data transfer costs when enabled.
Full Transcript
Cross-zone load balancing is a setting on a load balancer that decides how client requests are distributed across multiple availability zones. When enabled, the load balancer sends requests evenly to all healthy targets in all zones, balancing the load well. When disabled, it sends requests only to targets in the same zone as the client, which can reduce cross-zone data transfer costs. The execution table shows step-by-step how requests are distributed differently based on this setting. The variable tracker shows how many requests each zone's targets receive over time. Key moments clarify why the load balancer behaves differently depending on the setting. The visual quiz tests understanding of request distribution at specific steps.

Practice

(1/5)
1. What is the main benefit of enabling cross-zone load balancing in AWS Elastic Load Balancer?
easy
A. It increases the maximum number of connections per target.
B. It automatically scales the number of Availability Zones.
C. It evenly distributes incoming traffic across all registered targets in all enabled Availability Zones.
D. It encrypts all traffic between the load balancer and targets.

Solution

  1. Step 1: Understand cross-zone load balancing purpose

    Cross-zone load balancing spreads traffic evenly across targets in all zones, preventing uneven load.
  2. Step 2: Compare options to this purpose

    Only It evenly distributes incoming traffic across all registered targets in all enabled Availability Zones. describes this even distribution. Other options describe unrelated features.
  3. Final Answer:

    It evenly distributes incoming traffic across all registered targets in all enabled Availability Zones. -> Option C
  4. Quick Check:

    Cross-zone load balancing = even traffic spread [OK]
Hint: Cross-zone means traffic spreads evenly across zones [OK]
Common Mistakes:
  • Confusing cross-zone with encryption or scaling
  • Thinking it increases max connections per target
  • Assuming it changes number of zones automatically
2. Which of the following is the correct way to enable cross-zone load balancing in an AWS Application Load Balancer using Terraform?
easy
A. enable_cross_zone_load_balancing = false
B. cross_zone_load_balancing = true
C. cross_zone_enabled = true
D. enable_cross_zone_load_balancing = true

Solution

  1. Step 1: Recall Terraform attribute for cross-zone load balancing

    The correct attribute is enable_cross_zone_load_balancing and it must be set to true to enable.
  2. Step 2: Match options to correct syntax

    Only enable_cross_zone_load_balancing = true uses the exact attribute name and sets it to true.
  3. Final Answer:

    enable_cross_zone_load_balancing = true -> Option D
  4. Quick Check:

    Terraform attribute = enable_cross_zone_load_balancing true [OK]
Hint: Look for exact attribute name with true value [OK]
Common Mistakes:
  • Using incorrect attribute names like cross_zone_load_balancing
  • Setting the value to false instead of true
  • Confusing with other unrelated settings
3. Given the following AWS CLI command to enable cross-zone load balancing on a Classic Load Balancer:
aws elb modify-load-balancer-attributes --load-balancer-name my-load-balancer --load-balancer-attributes '{"CrossZoneLoadBalancing":{"Enabled":true}}'

What will be the effect of running this command?
medium
A. Cross-zone load balancing will be disabled for the load balancer.
B. Cross-zone load balancing will be enabled, distributing traffic evenly across zones.
C. The load balancer will be deleted.
D. The command will fail due to syntax error.

Solution

  1. Step 1: Analyze the AWS CLI command structure

    The command modifies load balancer attributes, specifically enabling CrossZoneLoadBalancing by setting Enabled to true.
  2. Step 2: Understand the effect of enabling CrossZoneLoadBalancing

    Enabling it causes traffic to be evenly distributed across all registered targets in all zones.
  3. Final Answer:

    Cross-zone load balancing will be enabled, distributing traffic evenly across zones. -> Option B
  4. Quick Check:

    Enable CrossZoneLoadBalancing true = even traffic spread [OK]
Hint: Enabled true means cross-zone load balancing is active [OK]
Common Mistakes:
  • Thinking the command disables the feature
  • Assuming the load balancer is deleted
  • Believing the command syntax is incorrect
4. You configured cross-zone load balancing on your Network Load Balancer but notice traffic is still uneven across zones. What is the most likely cause?
medium
A. You forgot to register targets in all Availability Zones.
B. Cross-zone load balancing is not supported on Network Load Balancers.
C. Cross-zone load balancing requires manual DNS updates.
D. You must enable cross-zone load balancing on each target instance.

Solution

  1. Step 1: Recall cross-zone load balancing support on Network Load Balancers

    Network Load Balancers support cross-zone load balancing, but it must be enabled and targets must be registered in all zones.
  2. Step 2: Identify why traffic is uneven

    If targets are missing in some zones, traffic cannot be balanced evenly despite cross-zone load balancing being enabled.
  3. Final Answer:

    You forgot to register targets in all Availability Zones. -> Option A
  4. Quick Check:

    Targets missing in zones = uneven traffic [OK]
Hint: Ensure targets exist in all zones for balancing [OK]
Common Mistakes:
  • Thinking cross-zone load balancing is unsupported on NLB
  • Believing DNS updates are needed
  • Assuming enabling on targets is required
5. You have an Application Load Balancer spanning three Availability Zones with cross-zone load balancing enabled. One zone has only one healthy target, while the others have three each. How does cross-zone load balancing affect traffic distribution?
hard
A. Traffic is evenly distributed across all targets regardless of zone count.
B. Traffic is evenly distributed across zones, so the zone with one target gets one-third of traffic.
C. Traffic is sent only to zones with the most targets.
D. Traffic is distributed randomly without considering zones or targets.

Solution

  1. Step 1: Understand cross-zone load balancing behavior

    With cross-zone load balancing enabled, each load balancer node distributes traffic evenly across all healthy registered targets, regardless of their Availability Zone.
  2. Step 2: Apply to given scenario

    Total healthy targets: 1 + 3 + 3 = 7. Each target receives approximately equal traffic (1/7), so the zone with one target gets about 1/7 of total traffic.
  3. Final Answer:

    Traffic is evenly distributed across all targets regardless of zone count. -> Option A
  4. Quick Check:

    Cross-zone load balancing = even across all targets [OK]
Hint: Cross-zone balances evenly across all targets, ignoring zone boundaries [OK]
Common Mistakes:
  • Confusing with default zone-isolated balancing (even per zone)
  • Thinking traffic prefers zones with more targets
  • Believing distribution ignores target count
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard