A financial services provider hosts a transactional processing application on Amazon EC2 instances within an Auto Scaling group behind an Application Load Balancer (ALB). The application requires a complex bootstrap process—including downloading security certificates and loading a large dataset into local memory—which takes approximately 6 minutes before the instance can pass health checks. During sudden market volatility, rapid traffic spikes overload the existing instances, causing request timeouts before new instances can finish bootstrapping. Which solution will most effectively minimize the latency of scaling out the compute capacity?
- Implement an Amazon EC2 Auto Scaling warm pool to maintain a pool of pre-initialized instances in a Stopped state, and use lifecycle hooks to run the bootstrap steps before the instances are stopped.Answer
- BModify the Auto Scaling group launch template to deploy the EC2 instances inside a cluster placement group to maximize throughput and accelerate the data transfer during bootstrapping.
- CConfigure the ALB target group health check to query a lightweight secondary port that responds immediately upon instance startup, allowing the instance to receive traffic while bootstrapping in the background.
- DMigrate the application to AWS Lambda and configure Provisioned Concurrency to handle the spikes, keeping the execution environments active continuously to process the transactional workloads.
Answer
Implement an Amazon EC2 Auto Scaling warm pool to maintain a pool of pre-initialized instances in a Stopped state, and use lifecycle hooks to run the bootstrap steps before the instances are stopped.
Implementing a warm pool with pre-initialized instances in a Stopped state allows the Auto Scaling group to rapidly scale out. When a scaling event is triggered, the instances only need to be started, skipping the 6-minute bootstrap process. Using lifecycle hooks ensures that the bootstrapping is completed before the instance is stopped and placed in the pool.
Step-by-Step Solution
Key Concept
Amazon EC2 Auto Scaling Warm Pools allow applications with long initialization times to scale out rapidly by maintaining a pool of pre-initialized instances.
Estimated Time:2m 0s