CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Scaling a Stateless Application with Auto Scaling
Learn how to effectively scale a stateless application using Auto Scaling based on CPU utilization for the AWS Certified Solutions Architect - Associate exam.
Scaling a stateless application behind an Application Load Balancer can be tricky for many candidates. The decision on how to automatically respond to CPU utilization often leads to confusion.
The question
A stateless application behind an Application Load Balancer must scale out automatically when average CPU exceeds 60%. Which combination provides this?
- A. An Auto Scaling group with a target tracking policy on CPU utilization
- B. A single large EC2 instance
- C. A Spot Fleet with no scaling policy
- D. An S3 lifecycle rule
Think before you scroll
Before you choose an option, consider the requirements of scaling out based on CPU utilization. Think about how each choice interacts with Auto Scaling and the concept of stateless applications.
The answer
The correct option is A: An Auto Scaling group with a target tracking policy on CPU utilization. This option directly addresses the requirement of scaling out automatically when CPU usage exceeds 60%. The target tracking policy automatically adjusts the number of instances in the Auto Scaling group to maintain the specified CPU target.
Why the other options lose
- B. A single large EC2 instance: This option does not scale out at all. It may handle increased load up to a point, but it lacks the ability to automatically adjust in response to CPU metrics. If the load exceeds the instance's capacity, it can lead to performance issues.
- C. A Spot Fleet with no scaling policy: This choice does not provide any scaling mechanism. Without a scaling policy, the Spot Fleet cannot respond to changes in CPU utilization, making it ineffective for the needs described in the question.
- D. An S3 lifecycle rule: This option is irrelevant to the question. S3 lifecycle rules manage the storage of objects in S3 but have no impact on EC2 instances or CPU utilization.
The concept behind it
Understanding Auto Scaling is crucial for AWS architects. The principle of using a target tracking scaling policy allows for dynamic adjustments to your application’s capacity based on real-time metrics. This ensures your application can handle varying loads efficiently.
Exam trap to remember
Remember: Always choose an Auto Scaling solution when asked about scaling based on metrics like CPU utilization.