Architecture Design and Implementation Built for the Cloud

An ECS service on EC2 processes SQS messages one at a time per task, averaging 12 seconds each, and must target an average queue wait of 120 seconds. Processing is I/O-bound, demand varies, and the cluster must add instances when tasks exceed available capacity; which scaling design best fits?

Show the answer

Correct answerD. Target 10 visible messages per running task; enable capacity provider managed scaling.

AWhy not this: The task metric is appropriate, but fixed EC2 capacity can leave additional tasks unable to run.

BWhy not this: Total queue depth does not normalize backlog by the number of workers and therefore is unsuitable for this target-tracking design.

CWhy not this: CPU is a poor demand signal for I/O-bound workers, and fixed instance capacity can prevent task placement.

DWhy this is right: Ten messages per task matches the wait-time target, and managed scaling supplies EC2 capacity for additional tasks.

The backlog-per-task target is 120 ÷ 12 = 10 messages. ECS service scaling adjusts workers, while capacity provider managed scaling adds EC2 capacity; a fixed total queue target does not express backlog relative to processing capacity.