Ensure that your Amazon Elastic Container Service (ECS) cluster services are using the best placement strategies in order to optimize tasks for reliability and cost efficiency. A placement strategy is an algorithm for selecting EC2 instances for task placement or tasks for termination. The recommended task placement strategies for your Amazon ECS services are "Spread" and "Binpack". The "Spread" placement strategy will ensure that your tasks are placed evenly based on the specified value, providing redundancy within the ECS service and thus better reliability. The "Binpack" strategy places tasks on container instances so as to leave the least amount of unused memory or CPU (but still able to run the tasks). This strategy minimizes the number of Amazon ECS container instances in use, resulting in cost efficiency.
When a task that uses the EC2 launch type is executed, Amazon ECS must determine where to place that task based on the requirements specified in the task definition, such as CPU and memory. Similarly, when you scale down the task count, Amazon ECS must determine which tasks to terminate. To customize how Amazon ECS service places and terminates tasks for improved reliability and cost efficiency, apply the recommended task placement strategies.
To determine the task placement strategy defined for your Amazon ECS cluster service(s), perform the following actions:
Remediation / Resolution
To configure the compliant (optimal) task placement strategy for your Amazon ECS cluster services, perform the following actions:
Unlock the Remediation Steps
Gain free unlimited access
to our full Knowledge Base
Over 750 rules & best practices
Get started for FREE
You are auditing:
Check for Amazon ECS Service Placement Strategy
Risk level: Medium