0 votes
in AWS by
You have an S3 bucket that receives photos uploaded by customers. When an object is uploaded, an event notification is sent to an SQS queue with the object details. You also have an ECS cluster that gets messages from the queue to do the batch processing. The queue size may change greatly depending on the number of incoming messages and backend processing speed. Which metric would you use to scale up/down the ECS cluster capacity?

A. The number of messages in the SQS queue.

B. Memory usage of the ECS cluster.

C. Number of objects in the S3 bucket.

D. Number of containers in the ECS cluster.

1 Answer

0 votes
by

A. The number of messages in the SQS queue.

In this scenario, the SQS queue is used to store the object details which is a highly scalable and reliable service. ECS is ideal to perform batch processing and it should scale up or down based on the number of messages in the queue. Details please check https://github.com/aws-samples/ecs-refarch-batch-processing. 

Option​ ​A ​is​ CORRECT:​ Users can configure a CloudWatch alarm based on the number of messages in the SQS queue and notify the ECS cluster to scale up or down using the alarm.

Option​ ​B ​is​ ​incorrect:​ Because memory usage may not be able to reflect the workload.

Option​ ​C ​is​ ​incorrect:​ Because the number of objects in S3 cannot determine if the ECS cluster should change its capacity.

Option​ ​D ​is​ ​incorrect:​ Because the number of containers cannot be used as a metric to trigger an auto-scaling event.

Related questions

0 votes
asked Sep 1, 2022 in AWS by sharadyadav1986
0 votes
asked Apr 2, 2021 in AWS by sharadyadav1986
...