Amazon's EC2 Container Service allows you to run any amount of containers you want, it will choose an EC2 instance(s) to run the containers on automatically. Which are great features. However, we are really concerned about automatic scalability.
Scenario:
- I launch a container via AWS ECS Console.
- The HTTP requests are starting to come up.
- The HTTP load increases significantly with time.
- CPU (or RAM) usage of the container is getting closer to 100%.
Question 1: Will ECS run one more container automatically?
Question 2: Will ECS automatically shut one of the containers down when CPU (or RAM) load gets low?
No, you don't get fully automated scaling with basic ECS. What you can do is create an alarm for when load gets high and have the alarm trigger an update to increase the cluster size.
Update Nov 29, 2017
This allows to scale containers without worrying about underneath infrastructure working with ECS service level scaling configurations.
As of Dec 2017 Amazon announced the new service called Fargate. Quoting the link:
I assume the bold text means that Fargate will scale up and down the resources for me. Not 100% sure though.
You should ideally put scaling both at the ec2 and ecscontainer level.
In case you are using ASGs, ec2 scaling based on the cloudwatch alarms can be configured on the ASG.
For container scaling you will have to write a lambda function or have some sort of application which can be triggered on an cloudwatch alarm for the scaling to occur.
On May 18th 2016, ECS has released autoscaling capability. you wont need Lambda to build scaling capability at service level.
Please see the release and feature documentation below
https://aws.amazon.com/about-aws/whats-new/2016/05/amazon-ec2-container-service-supports-automatic-service-scaling/
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html
So it doesn't say so explicitly and Nathaniel could certainly be correct but this blog from April 9th this year seems to imply at least that you can do what you are asking