Question

Difficulty: Very hardImplementing Auto Scaling and Fault Tolerance

A company provides real-time financial market analytics through a multi-tier API hosted on AWS. The application runs on Amazon EC2 instances managed by an Auto Scaling Group (ASG) behind an Application Load Balancer (ALB). The instances must fetch external market data feeds via the internet, which currently routes through a single NAT Gateway deployed in a public subnet of a single Availability Zone (AZ).

During unscheduled economic announcements, the platform experiences sudden traffic surges of up to 10×10\times the baseline within 2 minutes. This leads to HTTP 503 and 504 errors on the ALB, and outbound API calls fail completely if the AZ containing the NAT Gateway suffers an outage.

An audit of the environment reveals the following:
* The EC2 instances require exactly 300 seconds300\text{ seconds} to download configurations, compile proprietary analytical libraries, and fully initialize.
* The ASG uses a Target Tracking scaling policy based on Average CPU Utilization, with the default cooldown set to 180 seconds180\text{ seconds} and the instance warmup set to 120 seconds120\text{ seconds}.
* The ALB health check is configured as a TCP check on port 80, which succeeds within 30 seconds30\text{ seconds} of instance launch (as soon as the web daemon starts), before library compilation is complete.
* During scaling events, the ASG over-provisions instances rapidly, followed by aggressive scale-in actions that terminate instances before they process any traffic.

Which combination of architectural modifications will resolve the availability, scaling, and fault tolerance issues?

  1. A
    Increase the Auto Scaling group's default cooldown to 300 seconds300\text{ seconds} to prevent the group from launching additional instances before bootstrapping completes. Configure the ALB health check grace period to 300 seconds300\text{ seconds} to delay traffic delivery. Deploy a standby NAT Gateway in a secondary Availability Zone and configure Route 53 routing policies to fail over outbound internet traffic from the primary NAT Gateway during an outage.
  2. B
    Submit an AWS Support request to pre-warm the Application Load Balancer to handle the sudden flash traffic. Increase the default cooldown to 300 seconds300\text{ seconds} and configure the ALB health check grace period to 300 seconds300\text{ seconds} to ensure traffic is not sent to instances during bootstrapping. Deploy a single highly available NAT Gateway in a shared services VPC and route all outbound traffic through a Transit Gateway.
  3. Configure a scale-out lifecycle hook to hold instances in a wait state during bootstrapping, and update the target tracking policy's instance warmup to 300 seconds300\text{ seconds}. Modify the ALB health check to target an HTTP endpoint that returns success only after initialization completes. Deploy one NAT Gateway per Availability Zone, and update the route tables to route outbound traffic through the local NAT Gateway.Answer
  4. D
    Configure a Step Scaling policy with a cooldown of 300 seconds300\text{ seconds} using a custom CloudWatch metric that measures active application sessions. Configure a NAT Instance fleet in an Auto Scaling group across multiple Availability Zones to replace the NAT Gateway, using Route 53 health checks to update the route tables dynamically during a failure.

Answer

The option that configures a scale-out lifecycle hook, sets the instance warmup to 300 seconds, modifies the ALB health check to target an HTTP endpoint, and deploys one NAT Gateway per Availability Zone.
The correct solution involves configuring a scale-out lifecycle hook to pause the instance lifecycle until the bootstrapping script completes, and updating the target tracking policy's instance warmup to 300 seconds to match the actual initialization time. This prevents the ASG from prematurely launching additional instances during the startup phase. Furthermore, modifying the ALB health check to target a custom HTTP endpoint that only returns success after the compilation and initialization processes are finished ensures that the load balancer does not send requests to unready instances. Finally, deploying a NAT Gateway in each Availability Zone removes the single point of failure for outbound traffic, providing full fault tolerance.

Step-by-Step Solution

1
Analyze the instance bootstrapping duration and its relation to scaling metrics.
Identified that instances require 300 seconds to fully initialize, while the current instance warmup is only 120 seconds and default cooldown is 180 seconds.
Target tracking policies ignore default cooldowns and use the instance warmup duration. If instance warmup is less than the bootstrapping time, the policy will assume launched instances are not contributing to metrics and will continuously launch new instances (over-scaling).
2
Address the premature traffic routing to uninitialized instances.
Configure a scale-out lifecycle hook to keep instances in the Pending:Wait state during bootstrapping, and configure the ALB health check to use an HTTP endpoint that returns 200 OK only after the initialization process completes.
This prevents the ALB from routing traffic to instances that have only opened port 80 but have not finished library compilation.
3
Address the fault tolerance of outbound traffic.
Deploy a NAT Gateway in each Availability Zone and configure the route tables to route traffic via the local NAT Gateway.
A single NAT Gateway represents a single point of failure. Deploying a NAT Gateway per AZ ensures that an AZ outage does not disrupt outbound traffic for instances in other AZs.
4
Evaluate and rule out pre-warming and non-standard failover mechanisms.
Determine that pre-warming is ineffective for unscheduled spikes, and Route 53 cannot fail over local route table entries for active-standby NAT Gateway setups.
Pre-warming requires advance planning, and Route 53 resolves DNS names, which does not help with routing tables configured for outbound IP packets routing to internet destinations.

Key Concept

Aligning Auto Scaling warmup parameters and health checks with instance bootstrapping times, and ensuring outbound high availability via multi-AZ NAT Gateway routing.
Rate this question