To utilize the CPU and memory resources of multiple EC2 instances to run a single task with multiple containers, you can use ECS capacity providers.
When you register an Auto Scaling Group as a capacity provider for your ECS cluster, ECS is able to view the combined resources of all the EC2 instances in that ASG.
You can then create a task definition specifying the total CPU and memory needed for your containers. ECS will schedule the task across multiple instances registered with the capacity provider to fulfill the resource requirements.
Some key points:
Make sure the capacity provider ASG has sufficient instances to meet the task resource needs. ECS will scale out the ASG if needed.
Use placement constraints and strategies as needed to control task placement across instances.
Individual containers do not need to be pinned to specific instances. ECS will distribute containers as needed.
Instance resources are not literally combined. ECS schedules container resources across multiple instances transparently.
Tasks remain isolated even if distributed across instances. Cpu, memory are not shared between tasks.
- Accepted Answerasked 2 years ago
- asked 2 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- How do I resolve “InsufficientInstanceCapacity” or “UnfulfillableCapacity” launch errors in my Amazon EC2 Auto Scaling group?AWS OFFICIALUpdated 5 months ago
- EXPERTpublished 2 months ago