DOP-C02 · Question #309
A company has an application that runs on Amazon EC2 instances in an Auto Scaling group. The application processes a high volume of messages from an Amazon Simple Queue Service (Amazon SQS) queue. A…
The correct answer is C. Create a target tracking scaling policy for the Auto Scaling group. In the target tracking policy, use. ApproximateNumberOfMessagesVisible SQS metric shows the number of messages available for processing in the SQS queue. By using this metric, you can determine the workload (number of messages waiting) and adjust the scaling of the EC2 instances accordingly. Metric math allows…
Question
A company has an application that runs on Amazon EC2 instances in an Auto Scaling group. The application processes a high volume of messages from an Amazon Simple Queue Service (Amazon SQS) queue. A DevOps engineer noticed that the application took several hours to process a group of messages from the SQS queue. The average CPU utilization of the Auto Scaling group did not cross the threshold of a target tracking scaling policy when processing the messages. The application that processes the SQS queue publishes logs to `Amazon CloudWatch Logs. The DevOps engineer needs to ensure that the queue is processed quickly. Which solution meets these requirements with the LEAST operational overhead?
Options
- ACreate an AWS Lambda function. Configure the Lambda function to publish a custom metric by
- BCreate an AWS Lambda function. Configure the Lambda function to publish a custom metric by
- CCreate a target tracking scaling policy for the Auto Scaling group. In the target tracking policy, use
- DCreate an AWS Lambda function that logs the ApproximateNumberOfMessagesVisible attribute
How the community answered
(17 responses)- A12% (2)
- B6% (1)
- C82% (14)
Explanation
ApproximateNumberOfMessagesVisible SQS metric shows the number of messages available for processing in the SQS queue. By using this metric, you can determine the workload (number of messages waiting) and adjust the scaling of the EC2 instances accordingly. Metric math allows you to calculate a ratio of the number of messages in the queue to the number of instances in the Auto Scaling group (GroupInServiceInstances). This gives a more accurate representation of how many messages each instance is handling. This ensures that you scale in or out based on actual demand (messages per instance), not just CPU utilization, which may not always reflect the work required to process the queue. A target tracking scaling policy based on the number of messages per instance is efficient because it automatically adjusts the size of the Auto Scaling group based on the current load in the SQS queue. This allows the application to handle large message volumes faster without needing to manually adjust settings or add custom Lambda functions. By using metric math and SQS's native metrics, option C offers the most straightforward and operationally efficient way to scale the Auto Scaling group based on message volume in the SQS queue, ensuring faster message processing without additional custom infrastructure.
Topics
Community Discussion
No community discussion yet for this question.