DOP-C02 Question 116
Single answerYour organization is running a large-scale microservices application on Amazon ECS with Fargate. The application is experiencing performance issues due to inconsistent resource allocation across services. To address this, you are tasked with designing an automated solution to optimize resource allocation based on historical usage patterns and application-specific requirements. Which solution would best meet these requirements?
- A
Implement AWS Lambda functions to periodically analyze resource usage metrics from Amazon CloudWatch and adjust task definitions in ECS using the AWS SDK.
- B
Use AWS Auto Scaling with target tracking policies to automatically optimize resource allocation for ECS services based on predefined metrics like CPU or memory utilization.
- C
Deploy an Amazon SageMaker model to dynamically predict resource requirements and use the model's output to manually update ECS task definitions.
- D
Enable Amazon ECS Service Discovery to automatically adjust ECS resource allocation for services based on DNS and service registry updates.
Show answer and explanation
Correct answer: B
Explanation
AWS Auto Scaling with target tracking policies is designed to optimize resource allocation for ECS services automatically and at scale based on real-time and historical metrics. It is the most suitable solution for handling performance issues caused by inconsistent resource allocation in a large-scale environment. This approach minimizes manual intervention and leverages AWS's built-in scaling capabilities to address the given requirements efficiently.
- A. Incorrect.
This option involves creating a custom solution with AWS Lambda, which is possible but would require significant effort to implement and maintain. It is not the most efficient or scalable approach compared to built-in AWS features like Auto Scaling.
- B. Correct.
Using AWS Auto Scaling with target tracking policies is the most suitable solution. It is a native AWS feature that can automatically adjust ECS service resource allocation based on metrics such as CPU or memory utilization, effectively addressing the issue at scale with minimal operational overhead.
- C. Incorrect.
While deploying a SageMaker model could theoretically predict resource needs, this approach introduces unnecessary complexity and requires manual updates. It is not automated or efficient in the context of dynamic ECS resource allocation.
- D. Incorrect.
Amazon ECS Service Discovery helps manage service-to-service communication but does not provide functionality for dynamically adjusting ECS resource allocation. This is unrelated to the problem described in the scenario.