A rapidly growing startup has its core application deployed on Amazon EC2 instances behind an Application Load Balancer (ALB). The application experiences unpredictable traffic spikes, sometimes increasing by 500% in minutes, which frequently leads to performance degradation and timeouts. The current Auto Scaling group uses simple scaling policies based on CPU utilization, but it's not reacting fast enough. How should the DevOps team optimize the Auto Scaling configuration to handle these sudden, steep traffic increases more effectively?
- AImplement a target tracking scaling policy based on a custom metric like 'Application Load Balancer RequestCountPerTarget'.
- BSwitch to a step scaling policy with aggressive upper and lower bounds for CPU utilization.
- CConfigure a scheduled scaling policy to pre-scale instances during anticipated peak hours.
- DIncrease the 'cooldown period' for the existing simple scaling policy to allow more time for instances to launch.
Show answer & explanationAnswer & explanation
Correct answer: A. Implement a target tracking scaling policy based on a custom metric like 'Application Load Balancer RequestCountPerTarget'.
Target tracking scaling policies are ideal for handling unpredictable traffic spikes because they proactively adjust capacity to maintain a specified target value for a metric, like ALB request count, which is a better indicator of actual load than CPU for web applications.
Why the other options are wrong
- B. Step scaling can be more responsive than simple scaling, but target tracking is generally preferred for web applications as it directly tracks a performance indicator and adjusts proactively to maintain it, leading to smoother scaling and better performance during unpredictable spikes.
- C. Scheduled scaling is good for predictable spikes, but not for 'unpredictable traffic spikes', as stated in the scenario.
- D. Increasing the cooldown period would make scaling even slower, exacerbating the problem of not reacting fast enough.
Target Tracking Scaling Policy
A target tracking scaling policy for an Auto Scaling group adjusts the desired capacity of the group to maintain a specified target value for a chosen metric, such as average CPU utilization or ALB request count. It automatically calculates the scaling adjustments needed.
- Proactively adjusts capacity to maintain a target metric.
- Ideal for handling unpredictable and fluctuating workloads.
- More responsive and smoother than simple or step scaling.
- Supports various metrics, including custom metrics like ALB RequestCountPerTarget.
Memory trick: Target Tracking aims for steady performance, hitting the bullseye even when traffic zips.