Hard1 markMultiple Choice
Domain 2.4: ReliabilityReliabilityAuto ScalingSQS

AWS SAP-C02 · Question 39 · Domain 2.4: Reliability

A company has a multi-tier web application running on Amazon EC2 instances. The application uses Amazon SQS to decouple the web tier from the worker tier. During peak hours, the worker instances cannot process the messages fast enough, causing the SQS queue to grow and delaying order processing. The Architect needs to scale the worker tier dynamically based on the queue backlog. Which scaling metric is the MOST appropriate?

Answer options:

A.

Create a custom CloudWatch metric for 'Backlog per instance' (ApproximateNumberOfMessages / number of healthy instances) and use it for target tracking scaling.

B.

Use the SQS ApproximateNumberOfMessagesVisible metric directly with a step scaling policy.

C.

Use the EC2 CPUUtilization metric of the worker Auto Scaling group with target tracking scaling.

D.

Use the SQS OldestMessageAge metric to trigger an AWS Lambda function that adds instances to the Auto Scaling group.

How to approach this question

Identify the AWS best practice metric for scaling queue workers.

Full Answer

A.Create a custom CloudWatch metric for 'Backlog per instance' (ApproximateNumberOfMessages / number of healthy instances) and use it for target tracking scaling.✓ Correct
When scaling an Auto Scaling group based on an SQS queue, the best practice is to use a custom metric representing the 'backlog per instance'. You calculate this by dividing the `ApproximateNumberOfMessages` by the `InService` capacity of the Auto Scaling group. Using Target Tracking on this metric ensures you maintain an acceptable processing time regardless of the total queue size.

Common mistakes

Scaling based on CPU, which fails for I/O bound worker tasks.

Practice the full AWS Solutions Architect Professional SAP-C02 Practice Exam 5

75 questions · hints · full answers · grading

More questions from this exam