Amazon ECS provides built-in internal load balancing to distribute client traffic between the tasks in an ECS service. If all the client load were to be sent to a single task in a three-task service, the internal load balancer would direct some of the client traffic to the other tasks to distribute the client load evenly.Â
Problem:Â The number of tasks in a service as configured initially is fixed. If the client load is expected to be fixed, the fixed number of tasks in an ECS service should suffice. But if client load fluctuates, the ECS service tasks do not scale automatically. If the client load were to increase, the preconfigured number of tasks may not be able to serve the client traffic.
Solution:Â Amazon ECS supports auto scaling using an auto scaling policy that consists of a CloudWatch alarm based on one of the ECS service metrics:Â ...