Amazon Elastic Container Service (Amazon ECS) is a fast container orchestration service to quickly run, stop, and manage launch thousands of containers on a cluster ECS is also a highly scalable service, meaning you can easily and automatically scale container clusters to match application requirements.
So what is Cluster Auto Scaling in Amazon ECS?
Let’s take a look.
What is Amazon ECS Cluster Auto Scaling?
Amazon ECS Cluster Auto Scaling (CAS) makes it easy to scale in or out your Amazon EC2 instances in an ECS cluster to accommodate your tasks and services. CAS means that Amazon ECS can manage the scaling of all EC2 instances registered to your cluster by using an Amazon ECS Auto Scaling Group (ASG) capacity provider with managed scaling turned on.
Doing this creates two custom CloudWatch metrics (more on this later) plus a target tracking scaling policy. The policy attaches to your ASG, which allows ECS to manage the group’s scale-in and scale-out actions based on the load tasks put on your cluster. CAS ensures that the correct number of instances are running in an ASG to satisfy the needs of the tasks assigned to that ASG.
How does ECS CAS Work?
For each ASG provider, ECS will create and manage a low metric value and high metric value CloudWatch alarm and a target tracking scaling policy. The process to enable Amazon ECS cluster auto scaling is as follows:
- Create an ASG
- Create a capacity provider (that uses that group)
- Turn on managed scaling for the provider
- Associate the capacity provider with a cluster
ECS will regularly collect information to determine whether the ASG needs to scale (in or out). The group will launch new instances to scale out if launched tasks cannot be placed on available instances, and scale in by terminating a running instance on which there are no tasks.
Amazon ECS Auto Scaling with CloudWatch Metrics
Amazon ECS measures service utilization based on average CPU and memory utilization and publishes them as predefined CloudWatch metrics to help you:
- Scale out your service, i.e., add more tasks, to satisfy high demand at peak times
- Scale in your service, i.e. run fewer tasks, to reduce costs during low resource utilization
You can also track and measure many custom metrics to trigger specific application scaling actions (based on alarms from CloudWatch), such as:
- Average response time
- New requests rate
- SQS queue buffer depth
With the help of these metrics, you can provision the right amount of capacity required by the application and maintain a balance between app performance and cost.
Conclusion
Amazon ECS is a great choice to quickly and easily run reliable and scalable containers in the AWS Cloud. To know more about ECS and its auto scaling capabilities, contact Axcess.io.