Scaling EC2 Based on SQS Queue Depth
Short answer
D Use an Amazon EC2 Auto Scaling target tracking policy to scale out the processing tier instances. Use the ApproximateNumberOfMessages attribute to determine when to scale.
Question
Key Takeaways
The question tests the ability to identify the correct Auto Scaling metric for an SQS-decoupled system, specifically avoiding static CPU metrics when queue depth is the true bottleneck indicator.
This question addresses how to scale EC2 instances in a decoupled architecture using Amazon SQS as a buffer. The correct solution leverages target tracking scaling policies based on queue metrics to handle unpredictable traffic spikes.
Common mistake: Many learners choose Option A (scheduled scaling or CPU-based scaling) because they assume predictable patterns or focus on the symptom (high CPU) rather than the cause (queue backlog). Scheduled scaling fails due to unpredictability, and CPU scaling doesn't account for variable processing times per message.
Expert Analysis
Why the Answer Is Correct
The application bottleneck is in the processing tier, indicated by 100% CPU usage and a filling SQS queue. Since peak times are variable and unpredictable, scheduled scaling (Option A) is ineffective. Option D uses a target tracking policy with the ApproximateNumberOfMessagesVisible metric, which directly correlates the number of pending tasks with the required compute capacity. This ensures that instances scale out exactly when work accumulates, preventing delays.
Why the Other Options Are Wrong
Option A relies on scheduled scaling, which cannot adapt to unpredictable peaks, and CPU utilization, which may not reflect the actual workload if messages vary in complexity. Option B suggests adding ElastiCache, but this only helps with read-heavy database operations, not the processing bottleneck causing queue buildup. Option C adds CloudFront for the web tier, which does nothing to address the processing tier's inability to keep up with incoming orders.
Community Comment Notes
Community consensus strongly supports Option D. As user LeonSauveterre noted, "CPU utilization is not an accurate metric... There could be just one task but it takes quite a while to process." User FlyingHawk emphasized that since peaks are unpredictable, scheduled scaling is incorrect. Most users identified the processing tier as the clear bottleneck, dismissing caching solutions as irrelevant to the specific failure mode described.
Official Reference
https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always look for the decoupling mechanism in the architecture. If SQS is present, the primary scaling trigger should often be related to queue depth (ApproximateNumberOfMessages), especially when the problem describes backlogs or delays in processing.
Frequently Asked Questions
Why not use CPU utilization to scale?
Can ElastiCache solve this delay issue?
Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 6 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 6
-
EllenLiu 👍 3 Answered DThe bottleneck is from the processing tier.
-
FlyingHawk 👍 2 Answered DThe bottleneck is at the processing tier, B and C are incorrect, processing tier instances are running at 100% CPU usage, and the SQS queue fills up. Because the peak times are variable and unpredictable, we should use the EC2 Auto Scaling target tracking policy to scale out the processing tier instances based on the size of the queue, A uses scheduled scaling for Amazon EC2 Auto Scaling is incorrect.
-
LeonSauveterre 👍 2 Answered DJust scale base on how many tasks left in the queue. CPU utilization is not an accurate metric. There could be just one task but it takes quite a while to process, in which case scaling is unnecessary.
-
dragossky 👍 1 Answered BYes, ElastiCache can be used with DynamoDB to improve the performance and scalability of read-heavy or frequently accessed workloads. Amazon ElastiCache is a fully managed in-memory data store that supports popular caching engines such as Memcached and Redis.
-
GOTJ 👍 1 Answered DCheck this out: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html
Show 1 more comment
-
aragon_saa 👍 2 Answered DAnswer is D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAA-C03 Questions
Access 120 questions with complete answers and detailed explanations.
View Full SAA-C03 Practice Test →