Courseiva
Monitoring and LogginghardMultiple ChoiceObjective-mapped

ECS Memory-Based Auto Scaling with Target Tracking Policy

A company runs a containerized web application on Amazon ECS with AWS Fargate. The application is critical and requires high availability. The DevOps team has set up an Amazon CloudWatch alarm that triggers an auto scaling action when the average CPU utilization exceeds 75% for 5 minutes. However, during a recent traffic spike, the application became slow and some requests timed out, even though the CloudWatch alarm did not fire. The team checked the ECS service auto scaling configuration and found that the target tracking scaling policy based on average CPU utilization is set with a target value of 75%. The ECS service is configured with a minimum of 2 tasks and a maximum of 10 tasks. Upon investigation, they noticed that the CPU utilization metric for the service remained below 75% during the spike, but the memory utilization was high (over 90%). The application logs show that the tasks were running out of memory, causing garbage collection pauses and slow responses. Which course of action should the DevOps engineer take to prevent this issue in the future?

Quick Answer

The answer is to add a second target tracking scaling policy based on average memory utilization with a target value of 75%. This is correct because the root cause is memory pressure, not CPU—the existing CPU-based policy never triggered since utilization stayed below 75%, while memory spiked above 90%, causing garbage collection pauses and timeouts. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding that ECS memory-based auto scaling with a target tracking policy can independently scale tasks based on a different resource metric, and that a single policy may miss critical bottlenecks. A common trap is assuming CPU is always the primary scaling signal, or reaching for static fixes like increasing task memory, which wastes cost and fails to handle dynamic spikes. Remember the memory tip: “CPU sleeps, memory creeps—track both to keep the service deep.”

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add a second target tracking scaling policy based on average memory utilization with a target value of 75%.

The issue is memory pressure, not CPU. Adding a target tracking scaling policy based on average memory utilization with a target value of 75% will cause the ECS service to automatically scale out when memory utilization exceeds the target, preventing performance degradation due to high memory usage. Option B (decreasing CPU target to 50%) is incorrect because CPU utilization was not the bottleneck. Option C (increasing minimum tasks to 5) provides static capacity but does not dynamically respond to memory spikes, leading to wasted resources or insufficient scaling. Option D (increasing task memory limit) is a static change that may help temporarily but does not provide dynamic scaling; auto scaling based on memory is the recommended approach.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Add a second target tracking scaling policy based on average memory utilization with a target value of 75%.

    Why this is correct

    Memory-based scaling will add tasks when memory is high, preventing memory exhaustion.

  • Decrease the CPU target value to 50% to trigger scaling earlier.

    Why it's wrong here

    The issue is memory, not CPU; scaling on CPU would not help.

  • Increase the minimum number of tasks from 2 to 5 to provide more capacity upfront.

    Why it's wrong here

    Increasing minimum tasks adds static capacity but does not dynamically respond to memory spikes, and may increase cost.

  • Increase the task memory limit in the task definition to 8 GB.

    Why it's wrong here

    Increasing memory limit statically may not handle dynamic spikes and could be cost-inefficient; auto scaling based on memory is a better approach.

About these practice questions

This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company has deployed a containerized application on Amazon ECS with Fargate. The application is fronted by an Application Load Balancer (ALB). The DevOps team is using CloudWatch Container Insights to monitor the ECS cluster. They notice that the 'MemoryUtilized' metric for the service is consistently above 80%, and the 'CPUUtilized' is around 50%. The ALB's 'TargetResponseTime' is increasing over time. The team wants to resolve the performance issue. Which action should the team take?

medium
  • A.Increase the memory limit for the ECS task definition to allow the container to use more memory.
  • B.Increase the CPU limit for the ECS task definition to improve performance.
  • C.Increase the number of ALB targets by adding more availability zones.
  • D.Increase the desired count of the ECS service to distribute the load across more tasks.

Why A: The high memory utilization (above 80%) is likely causing performance degradation due to memory pressure. Increasing the memory limit for the ECS task definition allows the container to use more memory, which can reduce swapping and improve response times. Option B (increase CPU) is not the best action because CPU utilization is only 50%, so CPU is not the bottleneck. Option C (increase ALB targets) does not address the container's memory constraints. Option D (increase desired count) may distribute load but each task is still memory-constrained; fixing the memory limit is more direct.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.