DOP-C02 Question 42
Single answerYour company is running a mission-critical application on Amazon ECS using the Fargate launch type. The application requires real-time data processing and must scale automatically based on incoming traffic. You notice that during traffic spikes, the application becomes unresponsive due to insufficient resources. Which solution will ensure the application scales automatically and remains responsive during traffic surges?
- A
Enable ECS Service Auto Scaling using target tracking policies.
- B
Increase the task memory and CPU values manually in the ECS service definition.
- C
Switch the ECS launch type to EC2 and manually scale the EC2 instances.
- D
Integrate an Application Load Balancer (ALB) with ECS and enable load-based scaling.
Show answer and explanation
Correct answer: A
Explanation
The best solution in this scenario is to enable ECS Service Auto Scaling using target tracking policies. This approach allows the ECS service to dynamically scale the number of tasks based on metrics like CPU or memory utilization, ensuring that the application remains responsive during traffic surges. This is the recommended way to handle fluctuating traffic in a Fargate-based ECS service.
- A. Correct.
Enabling ECS Service Auto Scaling with target tracking policies allows the service to automatically adjust the number of running tasks based on traffic or resource utilization metrics such as CPU or memory usage. This is the most efficient and AWS-recommended approach in this scenario.
- B. Incorrect.
Manually increasing task memory and CPU values in the ECS service definition does not address the need for automatic scaling. It also requires manual intervention and does not adapt to fluctuating traffic levels.
- C. Incorrect.
Switching to the EC2 launch type and manually scaling EC2 instances adds unnecessary operational overhead and does not provide automatic scaling for ECS tasks.
- D. Incorrect.
Integrating an ALB with ECS and enabling load-based scaling might help distribute traffic more effectively, but it does not solve the underlying issue of resource allocation and automatic task scaling during traffic spikes.