I'm facing a problem when using AWS ECS Fargate on a new AWS account. When I try to run run more than 5 tasks, I get an error saying:
service feedback was unable to place a task. Reason: You've reached the limit on the number of tasks you can run concurrently.
"
When used this way, tasks are persistent -- your containers will continue to run even if no requests are received, even when running on Fargate. Since your containers are always running, there is no warmup time caused by Fargate.
The task definition is a text file, in JSON format, that describes one or more containers, up to a maximum of ten, that form your application.
AWS Fargate is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances. With AWS Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers.
Run an EC2 instance
I raised a support request with AWS after receiving this on a new account. This is their response:
In this situation, in order to activate the requested regions i.e EU (Ireland) and/or other regions, please launch an EC2 instance in those regions, this will enable you to run multiple concurrent Fargate tasks.
Running an t3.medium instance for 10 minutes in eu-west-1 resulted in an email being sent to the account email informing us that:
Your request has now been validated for AWS Europe (Ireland) region(s).
After which, I was able to run more than 2 concurrent ECS Fargate tasks.
Don't forget to terminate your EC2 instance!
All AWS accounts have service limits, to protect you and other accounts.
See the ECS Service Limits page and decide if you need to request an increase in service limits.
In your case, you're using Fargate which has their own service limit separated from ECS service limit. Search for "Fargate" in service limit page and request for the new limit.
Apparently all new account has a limit of 2 tasks that can be run concurrently, which does not seem to be documented anywhere. Increasing the limit fixes the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With