EC2 Auto Scaling (policies, lifecycle hooks, warm pools): DOP-C02 study notes and practice questions
What to know about EC2 Auto Scaling (policies, lifecycle hooks, warm pools) for the DOP-C02 exam, from the Resilient Cloud Solutions domain (15% of the exam guide), then 2 free questions to test it. Part of the DOP-C02 study guide.
These questions describe demand patterns or slow-starting instances and ask how to scale reliably.
Scaling policies
Policy
Use
Target tracking
Keep a metric near a value, such as average CPU 50% or a custom metric like sessions per server
Step scaling
Bigger changes for bigger alarm breaches
Scheduled
Raise minimum capacity before a known event
Predictive
Forecast daily and weekly patterns and scale ahead
Combine them: scheduled or predictive for known peaks, target tracking for everyday changes.
Starting instances faster
Warm pools keep pre-initialized instances (stopped, hibernated or running) ready to join quickly.
Golden AMIs reduce boot-time installation.
Default instance warmup stops new instances’ metrics skewing scaling decisions.
Lifecycle hooks
Launching: pause in Pending:Wait to install software or register with systems before InService.
Terminating: pause in Terminating:Wait to drain work or copy logs.
Complete with CompleteLifecycleAction, or the heartbeat timeout applies the default result. Hooks send events to EventBridge, SNS or SQS.
Updating and replacing
Instance refresh replaces instances with a new launch template version gradually, with minimum healthy percentage, checkpoints, skip matching and automatic rollback on alarms.
Max instance lifetime replaces old instances regularly.
Cost and capacity
Mixed instances policy with several types, On-Demand base and Spot with capacity-optimized allocation.
Capacity rebalancing replaces Spot instances at risk of interruption.
Span multiple AZs for availability.
Common traps
CPU-based scaling when the real load is sessions or queue depth.
Reactive scaling only for an 8 a.m. rush.
Terminating before logs are saved when a lifecycle hook could copy them.
A game studio runs dedicated game servers on EC2 instances in an Auto Scaling group. Each server publishes its active player session count as a custom CloudWatch metric.
New servers take about eight minutes to download and load the game's asset packs before they can accept players. During evening peaks, players wait in queues while new servers start, even though the group has already added instances.
The studio wants capacity to follow the number of sessions per server, with new servers ready to accept players quickly, and it wants to keep the current instance types.
Which configuration meets these requirements?
Choose one answer.
AA. Schedule scale-out actions for the evening peak and keep the simple scaling policy on CPU utilization, with a cooldown of one hour so that the group does not add instances too quickly.
BB. Create a warm pool of pre-initialized instances that have already loaded the asset packs, and add a target tracking policy on the sessions-per-server custom metric.
CC. Switch the group to larger instance types with more CPU and memory, so that each server can handle more sessions and fewer new servers are needed during the peak.
DD. Add a step scaling policy that adds five instances whenever the average CPU crosses 60 percent, and attach a lifecycle hook that waits for the asset download to finish before the server is added.
C. Wrong: Larger instances can raise the number of sessions per server, but they do not shorten the eight-minute startup and they raise cost. The studio asked to keep the current instance types.
D. Wrong: A lifecycle hook keeps a new instance out of service until its assets load, which avoids sending players to an unready server but does not shorten the eight-minute wait. Step scaling on CPU still does not follow sessions per server. Learn more: Amazon EC2 Auto Scaling lifecycle hooks (opens in a new tab)
Explanation
A warm pool keeps instances that have already completed their startup work, so they can join the group quickly and begin accepting players. Target tracking on the custom sessions-per-server metric keeps capacity tied to demand. Schedules, larger instances and CPU-based policies each miss part of the requirement.
An online retailer runs its storefront on an Auto Scaling group of EC2 instances behind an Application Load Balancer. Traffic is steady most days but rises sharply when a flash sale starts at a fixed time every Tuesday at noon.
Last month the group scaled out only after CPU rose, so the first ten minutes of the sale produced timeouts while new instances started. The team wants capacity in place before the sale begins and wants normal daily traffic to follow demand.
The team wants to keep the existing policies and adjust only what is needed.
Which change meets these requirements?
Choose one answer.
AA. Keep the CPU target tracking policy, and add a scheduled action that raises the minimum capacity before noon every Tuesday and lowers it after the sale.
BB. Replace the target tracking policy with a step scaling policy that adds one instance each time CPU passes 50 percent, with a cooldown of 15 minutes between each step.
CC. Increase the group's maximum capacity to three times the current size, so that the group has room to grow when the sale starts.
DD. Set the group to use a simple scaling policy with a cooldown of 300 seconds on the instance count, so that each scale-out waits for the previous one to finish.
Show the answer and explanation
Answer: A
A. Right: Correct. The scheduled action puts capacity in place before the known sale start, and target tracking continues to follow demand during the rest of the week. The existing policy stays in place and only the schedule is added. Learn more: Scheduled scaling for Amazon EC2 Auto Scaling (opens in a new tab)
A scheduled scaling action raises the group's minimum capacity before a known event, so instances are running before the sale starts. Target tracking continues to adjust for ordinary daily demand. Step and simple policies react only after load rises, and a higher maximum does not start any instances on its own.
Want more on EC2 Auto Scaling (policies, lifecycle hooks, warm pools)? The 5 full-length practice sets have 8 more EC2 Auto Scaling (policies, lifecycle hooks, warm pools) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →
Study EC2 Auto Scaling (policies, lifecycle hooks, warm pools)