DOP-C02 Question 109
Single answerYour team is deploying a containerized application using Amazon ECS with the Fargate launch type. During testing, you notice that the application intermittently fails due to a lack of available resources. Upon investigation, you discover that the resource limits for the containers are underestimated. What is the best way to address this issue while minimizing operational overhead?
- A
Update the ECS task definition to increase the CPU and memory limits for the containers.
- B
Switch from the Fargate launch type to the EC2 launch type and manually scale the EC2 instances.
- C
Enable ECS Service Auto Scaling to automatically adjust the number of tasks running based on CPU and memory utilization.
- D
Use AWS Lambda to monitor the container resource usage and automatically update the task definition.
Show answer and explanation
Correct answer: A
Explanation
The issue occurs because the containers are running out of allocated resources. With Fargate, resource limits for containers are defined in the ECS task definition. By updating the CPU and memory limits in the task definition, you can allocate sufficient resources to each container. This approach minimizes operational overhead and adheres to Fargate's serverless model, where AWS manages the underlying infrastructure.
- A. Correct.
Correct. Updating the ECS task definition to increase the CPU and memory limits ensures the containers have sufficient resources to handle the workload without requiring a change to the infrastructure or launch type.
- B. Incorrect.
Incorrect. Switching to the EC2 launch type introduces additional management overhead, such as maintaining and scaling EC2 instances, which Fargate is designed to eliminate.
- C. Incorrect.
Incorrect. ECS Service Auto Scaling adjusts the number of tasks running, not the resource limits for individual containers. This does not address the issue of insufficient resources per container.
- D. Incorrect.
Incorrect. Using AWS Lambda to monitor and update task definitions is overly complex and not an ideal solution for this scenario, as task definition updates are a manual operation that requires careful planning.