Whats the difference on using a ECS capacity provider and using automatic scaling from auto scaling group in a ECS cluster?

Viewed 948
2 Answers

Your auto scaling group scaling works on a service level only. An ECS cluster can have many services running. Therefore, capacity provider runs at cluster level and can scale your container instances based on all the services in the cluster, not only one service.

Capacity Providers is the compute interface that links your Amazon ECS cluster with your ASG. With Capacity Providers, you can define flexible rules for how containerized workloads run on different types of compute capacity, and manage the scaling of the capacity. Capacity Providers improve the availability, scalability, and cost of running tasks and services on ECS.

In other words, with Capacity provider, you can apply flexible rule to scales your app that saves the cost.

Example - By simply setting the base and weights in capacity provider strategy that to set the default strategy to be a mix of Fargate and Fargate Spot to ensure that if Spot tasks are terminated, we still have our minimum, desired amount of tasks running on Fargate. In this way we can take advantage of the cost savings of Fargate Spot in our every day workloads.

(for more information, check out the official AWS documentation.)

Related