Reputation: 788
I'm not seeing the point in using a capacity provider to scale the ECS cluster if I have automatic scaling at the ECS service level:
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html
Am I missing something? Why would I use a capacity provider to scale the auto scaling group if I already can scale it at the service level?
Upvotes: 7
Views: 3741
Reputation: 737
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.)
Upvotes: 2
Reputation: 238957
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.
Upvotes: 13