简体   繁体   中英

AWS ECS cluster auto-scaling vs service auto-scaling

this is my first time using amazon ecs service.

I have searched online for awhile to understand auto-scaling with ecs services.

I found there are two options to auto-scale my application. But, There are some I don't understand.

First is Service auto scaling which track the cpu/memory metric from cloudWatch and increase the task number accordingly.

Second is cluster auto scaling which needs to create auto scaling resource, create capacity provider and so on. But, in Tutorial: Using cluster auto scaling , it can run the task definition without service. But it also seems increasing the task number in the end.

So what's the different and 'pros and cons' between them?

I will try to explain briefly.

  • A Task is a container which is running our code(from a docker image).
  • As Service is making sure that given desired no of tasks are maintained.
  • We will be running these services in ECS backed by EC2 or Fargate. Ec2 is machines managed by us. Fargate is machines managed by AWS.

Scaling: Ultimately, We will be scaling the tasks just by setting desired no of tasks between min and max tasks, based on CPU or any other metric of individual task. This is called service auto scaling.

  • Fargate: Since AWS will manage necessary VMs behind the scenes, we can set any no of desired tasks we want and seamlessly scale without worrying about any infrastructure.
  • EC2: We can't seamlessly scale services because we need to add/remove EC2 instances behind the scenes too. We need to auto scale these instances also based on cpu or any other metrics of the Ec2 machines, which is called Cluster scaling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM