Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't run more than 5 tasks in AWS ECS Fargate

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.

Screenshot of AWS ECS Console"

like image 780
ashraf revo Avatar asked Aug 01 '18 13:08

ashraf revo


People also ask

Are fargate tasks always running?

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.

How many containers can be defined in a task definition in ECS?

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.

What are AWS fargate tasks?

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.


3 Answers

TL;DR

Run an EC2 instance

More Detail

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!

Even more detail: Run a basic EC2 instance:

  1. https://eu-west-1.console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstances:
  2. Change to the same region as your ECS cluster
  3. Click Launch Instance
  4. Name: Test
  5. Image: Amazon Linux
  6. Architecture: 64-bit x86
  7. Instance Type: t3.medium
  8. Key pair: Proceed without
  9. Network: Uncheck all
  10. Storage: 8GB or default
  11. Click Launch
  12. Wait 10 minutes
  13. Goto https://eu-west-1.console.aws.amazon.com/ec2/v2/home?region=eu-west-1#Instances:
  14. Select correct region
  15. Instant State -> Terminate Instance -> Terminate
like image 158
Alastair McCormack Avatar answered Oct 23 '22 16:10

Alastair McCormack


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.

enter image description here

like image 23
jarmod Avatar answered Oct 23 '22 15:10

jarmod


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.

like image 31
roxxypoxxy Avatar answered Oct 23 '22 15:10

roxxypoxxy