Soru

Zorluk: OrtaImplementing Auto Scaling and Fault Tolerance

A company operates a critical web application on AWS that runs on Amazon EC2 instances inside an Auto Scaling group behind an Application Load Balancer (ALB). The instances are deployed across two Availability Zones (us-east-1a and us-east-1b) in private subnets. Outbound internet traffic for both zones is routed through a single NAT Gateway located in us-east-1a.

During sudden morning traffic spikes, CPU utilization on the EC2 instances surges to 95% within 2 minutes. The Auto Scaling group uses a target tracking policy based on average CPU utilization with a 60-second cooldown period. However, because new instances require 5 minutes to bootstrap and initialize, the Auto Scaling group launches duplicate, redundant instances during the lag, which remain idle once initialization completes. Additionally, when us-east-1a experiences an outage, instances in us-east-1b lose all outbound connectivity, failing to reach external APIs.

Which two configurations should the solutions architect implement to resolve these scaling and availability issues?

  1. Deploy a NAT Gateway in each Availability Zone, and update the private subnet route tables to route outbound traffic through the NAT Gateway in their respective Availability Zone.Cevap
  2. Configure an Auto Scaling group warm pool to maintain a pool of pre-warmed instances, and increase the scaling cooldown period to exceed the instance bootstrapping and initialization time.Cevap
  3. C
    Keep the single NAT Gateway in us-east-1a, and configure the route table of the private subnet in us-east-1b to route outbound traffic through the Application Load Balancer during an outage.
  4. D
    Decrease the Auto Scaling group cooldown period to 15 seconds to allow the scaling policy to react more aggressively to CPU spikes before the CPU reaches 95%.
  5. E
    Submit a request to AWS Support to pre-warm the Application Load Balancer prior to the morning spikes to distribute traffic more evenly and prevent EC2 CPU surges.

Cevap

Deploy a NAT Gateway in each Availability Zone, and configure an Auto Scaling group warm pool while increasing the scaling cooldown period.
Deploying a dedicated NAT Gateway in each Availability Zone resolves the single point of failure for outbound traffic. Using an Auto Scaling group warm pool keeps instances in a pre-warmed state to reduce startup latency, and increasing the scaling cooldown period to exceed the initialization time ensures the scaling policy waits for new instances to take load before triggering further scale-out events.

Adım Adım Çözüm

1
Address the single point of failure in outbound traffic routing.
Identify that routing traffic from both Availability Zones through a single NAT Gateway in one zone causes outbound traffic loss during a zone failure.
Deploying a NAT Gateway in each Availability Zone and pointing local private subnets to their respective zone's NAT Gateway ensures high availability and isolates zone failures.
2
Resolve the issue of launching duplicate, redundant instances during scaling lags.
Recognize that the 60-second cooldown period is too short for a 5-minute instance bootstrapping duration, leading to premature scale-out triggers.
Using an Auto Scaling group warm pool speeds up the availability of ready instances, and increasing the cooldown period to exceed the initialization time prevents unnecessary scaling actions while the scaling policy waits for the new instances to register metrics.

Anahtar Kavram

Fault tolerance for outbound traffic requires multi-AZ NAT Gateway redundancy, and auto-scaling policies must account for instance bootstrapping time through proper cooldown settings and warm pools.
Bu soruyu puanla