Skip to content

What is the limit of concurrent Fargate tasks?

0

I am trying to work out what the limit is for a single task running concurrently.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html

From what I can decipher this could mean 5,000 consecutive tasks or 1,000, or even 500.

I've asked Amazon Q to clarify but it was unable to.

Imagine a service that performs a long running task per user, I am trying to work out how many of these I can have running at the same time.

Thanks

asked 2 years ago4.3K views

3 Answers
2
Accepted Answer

Hi,

My understanding is a bit different: I'd use Containers per task definition Each supported Region: 10

If it is too low for your use case, you define N tasks in parallel to obtain the ability to use N x10 containers in parallel. You can go up to N = 5000 as quota of tasks per service.

Note: you may want to use CDK to be able to program the loop of generating so many multiple tasks. If CDK is overkill for you, you will need to write a small script (Python, Perl, etc.) generating your template with so many tasks.

Best,

Didier

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thanks! I'm a little confused about the practical difference between "N parallel tasks" and "10 containers per task" There is a difference I am struggling to clarify with these two. Is the latter referring to how I can add 10 images into a task? Or are parallel tasks part of one overarching task?

  • A task can run 10 containers. A service can contain 5000 tasks but tasks can be launched outside of a service which i often do

  • Hi, A task defines a set of 1 to N containers collaborating together to achieve a goal. So, you can have more than 1 container in your task. And then, you can have multiple task in a service. Then, a service definition guarantees that you have the adequate number of tasks present at all times (to properly serve your workloads, etc.). Hence, the hierarchy service > task > container. Thanks for accepting my answer ! Didier

  • If I’m not running a service and tasks only. What’s the absolute limit?

1

The limit for concurrent Fargate tasks is not a single fixed number, but rather depends on several factors and quotas. Here's a breakdown to help clarify:

  1. AWS Fargate has quotas that limit the number of concurrent running tasks in each AWS Region. These quotas apply to both On-Demand and Fargate Spot tasks on Amazon ECS, and also include any Amazon EKS pods running on Fargate.

  2. The actual number of concurrent tasks you can run depends on the vCPU-based quotas set for your account. These quotas can be adjusted based on your scaling requirements.

  3. For a single service performing long-running tasks, there's an important limitation to consider: Amazon ECS services configured to use AWS Cloud Map-based service discovery have a limit of 1,000 tasks per service. This is due to the AWS Cloud Map service quota for the number of instances per service, and it's a hard limit.

  4. If you're not using service discovery, the theoretical maximum number of tasks you could run concurrently in a single cluster is 5,000, as this is the maximum number of Amazon EC2 instances that can be registered for each cluster.

  5. However, in practice, the number of concurrent tasks you can run is also affected by other factors such as the rate at which tasks can be launched. Fargate limits the Amazon ECS RunTask API requests to 20 calls per second (burst and sustained), with each call able to launch up to 10 tasks. This means you could theoretically launch up to 100 tasks per second, but sustained over time, this would be limited by other factors.

  6. The actual concurrent task limit you'll experience may be lower than these theoretical maximums due to factors like available private IPv4 addresses in your subnets (since each task requires a private IP), and other resource constraints.

For your specific use case of a service performing long-running tasks per user, if you're not using service discovery, you could potentially run thousands of concurrent tasks, up to the limits of your account's vCPU quota and available network resources. If you are using service discovery, you'd be limited to 1,000 concurrent tasks per service.

If you need to exceed these limits, you might consider strategies like sharding your workload across multiple services or clusters, or requesting quota increases where possible.
Sources
AWS Fargate throttling quotas - Amazon Elastic Container Service
Scale to 15,000+ tasks in a single Amazon Elastic Container Service (ECS) cluster | Containers
Handle Amazon ECS service quotas and API throttling limits - Amazon Elastic Container Service

answered 2 years ago

EXPERT

reviewed 2 years ago

0

Intresting question. The quota link you provided doesnt list the number of tasks you can launch. I don't see any documentated limit

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.