AWS Certified SysOps Administrator – Associate — Question 342
A company runs a worker process on three Amazon EC2 instances. The instances are in an Auto Scaling group that is configured to use a simple scaling policy. The instances process messages from an Amazon Simple Queue Service (Amazon SQS) queue.
Random periods of increased messages are causing a decrease in the performance of the worker process. A SysOps administrator must scale the instances to accommodate the increased number of messages.
Which solution will meet these requirements?
Answer options
- A. Use CloudWatch to create a metric math expression to calculate the approximate age of the oldest message in the SQS queue. Create a target tracking scaling policy for the metric math expression to modify the Auto Scaling group.
- B. Use CloudWatch to create a metric math expression to calculate the approximate number of messages visible in the SQS queue for each instance. Create a target tracking scaling policy for the metric math expression to modify the Auto Scaling group.
- C. Create an Application Load Balancer (ALB). Attach the ALB to the Auto Scaling group. Create a target tracking scaling policy for the ALBRequestCountPerTarget metric to modify the Auto Scaling group.
- D. Create an Application Load Balancer (ALB). Attach the ALB to the Auto Scaling group. Create a scheduled scaling policy for the Auto Scaling group.
Correct answer: B
Explanation
To scale an Auto Scaling group based on an SQS queue backlog, AWS recommends using CloudWatch metric math to calculate the backlog per instance (ApproximateNumberOfMessagesVisible divided by the number of instances) and applying target tracking. Application Load Balancers (ALBs) are designed for HTTP/HTTPS routing and are not utilized by SQS queue workers that pull messages. Scaling based on the age of the oldest message does not accurately reflect the processing capacity needed compared to the backlog per instance metric.