ECS: Capacity Provider vs Autoscaling Group

0

Hi all, I'm trying to understand the difference between capacity providers and autoscaling groups in ECS. They both help to autoscale EC2 instances while we configure our services to deploy and scale our tasks. Capacity providers have target capacity to scale EC2 instances conditionally, and autoscaling groups provide customizable autoscaling policies that can achieve the same results. Any idea what advantage/convenience capacity provider brings over autoscaling groups? Or is it just a wrapper around the latter to interface with services?

Paul
已提問 2 年前檢視次數 3700 次
3 個答案
2

Capacity Providers do use ASG underneath. They are just a way to make ECS "ASG aware". Prior to CP ECS would have no idea that ASG existed and viceversa. My suggestion would be to watch this re:Invent presentation about the announcement of Capacity Providers because it provides a lot of background re what they are and what their value is (Vs using raw ASGs).

AWS
專家
已回答 2 年前
  • I see. Thanks for clarifying, I'm watching the video now (:

1

As mreferre said, the CP drives the ASG capacity based on the services' task definitions which express CPU/RAM requirements for the tasks to run for that service. Instead of having to do complex logic into your CW Alarms etc. driving the ECS instances provisioning / deprovisioning, ECS deals with that for you to maintain available compute resources to satisfy services scaling.

Mind you though, for your capacity providers strategy, you can't mix-and-match FARGATE with AS capacity providers. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html#capacity-providers-considerations

profile picture
已回答 2 年前
  • I see. Yeah that makes sense, Fargate is meant to be a severless service. Thanks for your help, I'll read through the documentation you sent over

0

Given that re:Post showed this question whilst answering another one, linking to it for posterity: https://repost.aws/questions/QU0UOJ8gczSkWlXTztwrF-ow/ecs-capacity-providers-best-practices

profile picture
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南