A company operates a web application on a single EC2 instance that becomes slow at peak times when CPU utilization exceeds 95%. A user-data script installs custom packages on the instance at launch, which makes instance startup take several minutes. The company will create an Auto Scaling group using a launch template, with mixed instance types, varying CPU capacities, and a maximum capacity limit. The company wants to reduce application latency when new instances are launched during scaling events. Which approach satisfies this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Use a dynamic scaling policy. Enable warm pools for the Auto Scaling group. Use lifecycle hooks to run the user-data script..
Why this is the answer
The correct answer uses a dynamic scaling policy to react to real-time CPU utilization, which is appropriate for unpredictable load spikes. Enabling warm pools ensures that pre-initialized instances are ready to serve traffic immediately, reducing latency during scaling events. Lifecycle hooks are the correct mechanism to execute the user-data script during instance launch or termination, ensuring custom packages are installed before the instance is put into service. Predictive scaling is less suitable here as it relies on historical data to forecast demand, which might not be accurate for sudden, unpredictable spikes. An instance maintenance policy is not designed for running user-data scripts during initial launch or scaling events. Setting the default instance warmup time to 0 seconds with a user-data script that takes several minutes to run would mean instances are put into service before they are fully ready, leading to errors or poor performance.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed