DOP-C02 practice question: Scaling ECS, EKS and serverless workloads
Resilient Cloud Solutions A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A SaaS startup processes uploaded invoices with containerized workers that run as an Amazon ECS service on AWS Fargate. Each uploaded file produces a message in an Amazon SQS queue, and the workers take messages from that queue.
Processing time per message varies widely, so CPU use on the workers is not a reliable signal of how much work is waiting. Customers expect each invoice to be processed within about 10 minutes of upload during business hours.
The team wants the worker count to follow the amount of waiting work per running task, scale in when the queue drains, and avoid any custom scaling service to maintain.
Which approach meets these requirements?
Choose one answer.
AA. Create a target tracking policy on the ECS service's average CPU utilization, with a target of 60 percent, and rely on CPU to add workers when invoices arrive.
BB. Create a scheduled scaling action that raises the worker count at 8 a.m. and lowers it at 6 p.m., so that the service has enough capacity during business hours.
CC. Create a target tracking policy that uses metric math to divide the queue's visible messages by the service's running task count, targeting the backlog per task.
DD. Replace the workers with an AWS Lambda function that is triggered by the queue, and rely on Lambda concurrency to match the number of messages that wait.
B. Wrong: A schedule ignores the actual backlog, so a morning spike can still wait for capacity. It also keeps capacity high when the queue is empty, which the team wants to avoid.
C. Right: Correct. Backlog per task is the measure the team asked for, and target tracking scales the service out and in to keep it near the target. Metric math builds the value from existing queue and service metrics, so no scaling service or publishing code is needed. Learn more: Scaling policy based on Amazon SQS (opens in a new tab)
A target tracking policy on a backlog-per-task metric scales an ECS service in proportion to the work waiting in the queue, both up and down. CPU does not reflect waiting messages, and a schedule ignores the actual backlog. Replacing the containers with Lambda changes the processing model the team wanted to keep.
Want more on Scaling ECS, EKS and serverless workloads? The 5 full-length practice sets have 9 more Scaling ECS, EKS and serverless workloads questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →