3

I'm working on an API with microservice architecture. I deploy to ECS via Elastic Beanstalk. Each microservice is a long-running task (which, on ECS equates to a single container). I just passed up 10 tasks, and I can no longer deploy.

ERROR: Service:AmazonECS, Code:ClientException, Message:Too many containers., Class:com.amazonaws.services.ecs.model.ClientException

According to the documentation, 10 task definition containers is a hard limit on ECS.

Is there any way to get around this? How can I continue adding services to my API on ECS? This limitation suggests to me I am not using the service as intended. What is the best way to deploy a collection of microservices each as a separate Docker container on AWS?

EDIT: My understanding of the relationship between containers and tasks was completely wrong. Looks like the entire API is a single task and each container in my Dockerrun.aws.json is a container inside the API task. So, the limitation is a limit on containers inside a single task.

raddevon
  • 3,290
  • 4
  • 39
  • 49
  • you have to increase the service limit by contacting AWS support – Piyush Patil Jun 13 '16 at 15:14
  • 1
    @error2007s That particular limitation is under "other limitations for Amazon ECS that _cannot_ be changed" – raddevon Jun 13 '16 at 15:19
  • Can you retool on Lambda? There is no such limitation there; you are only limited to the number of ip#s available on the subnet where the function is invoked. – Rodrigo Murillo Jun 13 '16 at 15:30
  • @RodrigoM We would love to, but we've run into some problems there due to the way you have to include dependencies in the function bundle. Wish I could go into more detail, but I wasn't directly involved with that phase of the prototyping. – raddevon Jun 13 '16 at 15:33
  • 1
    are you talking about `Task definition max containers` ? – Marc Young Jun 14 '16 at 18:54
  • 1
    @MarcYoung Yes, that's it. – raddevon Jun 15 '16 at 10:19

2 Answers2

0

In ecs API, The containers defined in a same task guarantees those containers will be deployed on one instance. If this is the deployment behavior you want, define containers in one 'task'.

If you want to deploy containers across ecs cluster, you should define different task with only one container, so that all your containers can be deployed balancedly on the cluster.

-2

Since it's not changeable it means you need a new task definition.

Task definition max containers means you can have 10 per task definition. Just clone the definition if you need that many more containers.

Take it with a grain of salt but if you're setting your tasks on a per instance basis could you not work with creating AMIs instead or possibly let multiple tasks go on the same container instance?

Marc Young
  • 3,854
  • 3
  • 18
  • 22
  • How can I configure Elastic Beanstalk to create separate tasks? It seems to throw all the containers into a single task, and I can't find a documented way to configure it to separate them. – raddevon Jun 15 '16 at 10:19
  • 1
    You tagged amazon-ecs, you can't do that with beanstalk. I'd suggest re-tagging your question. – Marc Young Jun 15 '16 at 15:49