Question

Difficulty: HardImplementing Auto Scaling and Fault Tolerance

An enterprise web application hosts a financial ledger service on Amazon EC2 instances inside an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The instances are deployed across two Availability Zones (AZ-A and AZ-B) and require exactly 6 minutes6\text{ minutes} to bootstrap, retrieve cryptographic keys, and warm up local memory caches before passing target group health checks. Outbound internet traffic for both AZs is routed through a single NAT gateway located in AZ-A.

The application experiences two major operational issues:
1. During daily flash-sale events that cause immediate, massive traffic spikes, the ALB drops incoming requests with HTTP 503503 and 504504 errors before the ASG can respond. Additionally, the ASG experiences an "over-provisioning storm," launching far more instances than required because the scaling policy triggers additional scaling actions before the newly launched instances finish bootstrapping.
2. A recent fiber-cut outage in AZ-A caused all outbound internet traffic from instances in AZ-B to fail, disrupting transaction settlements.

Which solution resolves these issues with the lowest operational overhead?

  1. Configure scheduled scaling policies to scale out the Auto Scaling group in advance of the daily flash-sale events, and set the default cooldown and instance warmup timers to 450 seconds450\text{ seconds}. Request Application Load Balancer pre-warming from AWS Support for the flash-sale periods. Deploy a dedicated NAT gateway in the public subnet of each Availability Zone, and update the private subnet route tables to route outbound traffic through the local NAT gateway.Answer
  2. B
    Configure scheduled scaling policies to scale out the Auto Scaling group in advance of the daily flash-sale events, and set the default cooldown and instance warmup timers to 300 seconds300\text{ seconds}. Request Application Load Balancer pre-warming from AWS Support for the flash-sale periods. Deploy a dedicated NAT gateway in the public subnet of each Availability Zone, and update the private subnet route tables to route outbound traffic through the local NAT gateway.
  3. C
    Configure scheduled scaling policies to scale out the Auto Scaling group in advance of the daily flash-sale events, and set the default cooldown and instance warmup timers to 450 seconds450\text{ seconds}. Request Application Load Balancer pre-warming from AWS Support for the flash-sale periods. Consolidate all outbound traffic from both Availability Zones through the existing NAT gateway in AZ-A, and configure an AWS Lambda function to automatically recreate the NAT gateway in AZ-B if AZ-A experiences an outage.
  4. D
    Configure target tracking scaling policies on the Auto Scaling group based on average CPU utilization with the default cooldown and instance warmup timers set to 450 seconds450\text{ seconds}. Deploy a dedicated NAT gateway in the public subnet of each Availability Zone, and update the private subnet route tables to route outbound traffic through the local NAT gateway. Rely on the Application Load Balancer's automatic scaling to handle the traffic spikes during the flash-sale events.

Answer

Configure scheduled scaling policies to scale out the Auto Scaling group in advance of the daily flash-sale events, and set the default cooldown and instance warmup timers to 450 seconds450\text{ seconds}. Request Application Load Balancer pre-warming from AWS Support for the flash-sale periods. Deploy a dedicated NAT gateway in the public subnet of each Availability Zone, and update the private subnet route tables to route outbound traffic through the local NAT gateway.
The correct solution addresses all three components of the problem. First, configuring scheduled scaling policies and requesting ALB pre-warming ensures that both the application instances and the load balancer are ready to handle the immediate surge of flash-sale traffic, preventing HTTP 503503 and 504504 errors. Second, setting the default cooldown and instance warmup periods to 450 seconds450\text{ seconds} (which is longer than the 6-minute6\text{-minute} or 360-second360\text{-second} bootstrapping duration) ensures that the Auto Scaling group does not launch additional instances while the current batch is still bootstrapping, preventing the over-provisioning storm. Third, deploying a dedicated NAT gateway in each Availability Zone and updating the route tables ensures that outbound connectivity remains functional for AZ-B even if AZ-A suffers a failure.

Step-by-Step Solution

1
Analyze the bootstrapping requirements and scaling behavior.
The instances require 6 minutes6\text{ minutes} (360 seconds360\text{ seconds}) to bootstrap. The Auto Scaling group's cooldown and instance warmup period must be set to a value greater than 360 seconds360\text{ seconds} (e.g., 450 seconds450\text{ seconds}) to ensure that the scaling policy waits for the newly launched instances to become active before evaluating the metrics again. This prevents the over-provisioning storm.
Setting the cooldown/warmup shorter than the bootstrapping time leads to unnecessary scaling actions because metrics remain high while instances are starting up.
2
Address the sudden flash-sale traffic spikes at the load balancer and application tier.
Since the traffic spike is predictable and sudden (daily flash-sale), configure scheduled scaling to provision capacity ahead of time, and request Application Load Balancer pre-warming from AWS Support to handle the immediate influx of requests.
Standard reactive scaling cannot react fast enough to instant spikes, leading to connection drops and HTTP 503503/504504 errors.
3
Resolve the single point of failure for outbound traffic.
Deploy a NAT gateway in the public subnet of each Availability Zone and update the route tables of the private subnets to point to their respective local NAT gateways.
Deploying a NAT gateway per Availability Zone ensures that an outage in one zone does not impact the internet connectivity of resources in other zones.

Key Concept

To implement fault tolerance and auto-scaling for predictable flash traffic, use scheduled scaling policies combined with load balancer pre-warming, set the instance warmup and cooldown periods to exceed the bootstrapping duration to prevent over-provisioning, and deploy zone-redundant NAT gateways to eliminate single points of failure.
Rate this question