AWS Builder Center

πŸš€ Amazon ECS Limits You Should Know Before Scaling

Amazon ECS can scale significantly, but it is not unlimited. Learn about the key ECS quotas and hard limits that can affect task placement, deployments, networking, and scaling before they become a bottleneck.

Series: ECS Made Practical (3 articles)

  1. 3
    πŸš€ Amazon ECS Limits You Should Know Before Scaling This article
DevOps Enginer
Ever scaled an ECS service and thought:
I still have CPU and memory available… so why can't my task start?
That's where things get interesting. Amazon ECS can scale to thousands of tasks and services, but it still has quotas and limits that can affect task placement, deployments, networking, and scaling. And some of these limits aren't adjustable. Let's take a look at the ones worth knowing before they become a production problem. πŸ‘‡

ο»Ώ

🧠 Hard Limit vs. Adjustable Quota

First things first: not every AWS limit is the same. Some limits are non-adjustable . Others are adjustable quotas that you can request an increase for through AWS Service Quotas. Why does this matter? Because if you hit an adjustable quota, you may be able to increase it. If you hit a non-adjustable limit, you need to work around it or rethink the architecture. Here's a quick overview:
ECS resource
Limit
Adjustable?
🧩 Tasks per service
5,000
❌ No
πŸ“¦ Services per cluster
5,000
❌ No
πŸ–₯️ Container instances per cluster
5,000
❌ No
🎯 Target groups per service
5
❌ No
⏳ Tasks in PROVISIONING per cluster
500
❌ No
🌐 Subnets per awsvpcConfiguration
16
❌ No
πŸ” Security groups per awsvpcConfiguration
5
❌ No
☁️ Clusters per account
10,000
βœ… Yes
⚠️ AWS quotas can change. Always check the current AWS documentation and Service Quotas console before using these values for capacity planning.

ο»Ώ

1️⃣ Up to 5,000 Tasks per Service

A single ECS service can have up to 5,000 tasks. Sounds like a lot, right? πŸ˜… For most applications, it absolutely is. But imagine a large worker service or a high-throughput application that keeps scaling:
10 tasks
↓
100 tasks
↓
1,000 tasks
↓
5,000 tasks 🚨
At this point, the question isn't just:
β€œCan ECS run more tasks?”
It becomes:
πŸ’‘ β€œShould all these tasks really belong to the same service?”
If you're getting close to this boundary, splitting the workload across multiple services may be a better architectural approach.

ο»Ώ

2️⃣ Up to 5,000 Services per Cluster

ECS supports up to 5,000 services per cluster. That might sound impossible to reach.
Until you start thinking about a platform running hundreds or thousands of workloads. You could end up with something like:
ECS Cluster
β”‚
β”œβ”€β”€ checkout
β”œβ”€β”€ payments
β”œβ”€β”€ notifications
β”œβ”€β”€ inventory
β”œβ”€β”€ worker-a
β”œβ”€β”€ worker-b
└── ... hundreds more
At scale, the question becomes:
🧐 β€œDoes everything really need to live in the same cluster?”
Multiple clusters can provide better isolation, ownership boundaries, and operational organization.

ο»Ώ

3️⃣ Up to 5,000 Container Instances per Cluster

If you're running ECS on EC2, this one matters. An ECS cluster can have up to 5,000 container instances. And here's where things get interesting: You might think:
β€œThe service needs more capacity? Just add more EC2 instances.” πŸ’­
Usually, yes. But what happens when the cluster itself is approaching its container-instance limit?
Adding another EC2 instance won't solve that particular problem. You may need to distribute the workload across multiple clusters instead.

πŸ’‘ The lesson

Capacity planning isn't only about instance size. You also need to think about cluster-level boundaries.

ο»Ώ

4️⃣ 🚨 CPU Available Doesn't Always Mean Task Capacity

This is one of my favorite ECS concepts. Imagine:
EC2 instance
ο»Ώ
CPU βœ… Available
Memory βœ… Available
ENI ❌ Exhausted
Can ECS place another Β awsvpcΒ  task? No. Why? Because with Β awsvpcΒ , tasks receive their own network interface. So you can have plenty of CPU and memory available while still being unable to place another task. That's why an ECS placement failure doesn't automatically mean:
❌ β€œI need a bigger EC2 instance.”
Sometimes the real problem is:
🌐 β€œI ran out of network capacity.”
This is especially important for ECS on EC2.

ο»Ώ

5️⃣ 🌐 Β awsvpcΒ  Has Networking Limits Too

An Β awsvpcConfigurationΒ  can currently specify:
  • πŸ•ΈοΈ Up to 16 subnets
  • πŸ” Up to 5 security groups
But there's another networking resource you need to keep an eye on:

IP addresses.

Every task using Β awsvpcΒ  needs networking capacity.
So imagine:
20 tasks
↓
100 tasks
↓
300 tasks
↓
Subnet IPs exhausted πŸ’₯
Your EC2 instances may still have CPU. Your memory may still look fine. But the tasks can't get the network resources they need.

πŸ’‘ Always think about:

Compute capacity + Network capacity Not just compute.

ο»Ώ

6️⃣ 🎯 Up to 5 Target Groups per Service

An ECS service can currently use up to 5 target groups.
For example:
ECS Service
β”‚
β”œβ”€β”€ Target Group 1
β”œβ”€β”€ Target Group 2
β”œβ”€β”€ Target Group 3
β”œβ”€β”€ Target Group 4
└── Target Group 5
Need a sixth one?
That's where knowing whether a quota is adjustable becomes important.
This isn't something you simply solve by requesting a quota increase.
You need to reconsider the architecture.

ο»Ώ

7️⃣ ⏳ The 500 Β PROVISIONINGΒ  Task Limit

Here's a limit that can become interesting during large scaling events.
For ECS on EC2 using an Auto Scaling group capacity provider, the cluster can have up to 500 tasks in Β PROVISIONINGΒ .
Think about a sudden scale-out:
Desired count increases
↓
ECS scheduler
↓
Tasks enter PROVISIONING
↓
Capacity becomes available
↓
Tasks move to RUNNING
Now imagine hundreds of tasks waiting for capacity.
You can end up with a situation where:
β€œThe service wants more tasks, but the cluster can't provision them as expected.”
That's why it's important to look at task state and service events, not just desired count.

ο»Ώ

8️⃣ ☁️ Fargate Has Different Limits

Using Fargate?
The picture changes.
Fargate has quotas related to things such as:
  • vCPU resource counts
  • On-Demand capacity
  • Spot capacity
  • task launch rates
These quotas are generally adjustable, unlike some of the ECS hard limits we've discussed above.
So if you suddenly scale:
20 tasks
↓
200 tasks
↓
500 tasks πŸš€
The question isn't only:
β€œCan I run 500 tasks?”
It's also:
⚑ β€œCan Fargate launch them at the rate I need?”
That's an important distinction for workloads that experience sudden traffic spikes.

ο»Ώ

πŸ”Ž What Should You Check Before Scaling?

Before making a significant ECS scaling change, I like to think about four areas:

πŸ—οΈ Cluster

  • Number of services
  • Number of container instances
  • Capacity providers
  • Tasks in Β PROVISIONINGΒ 

πŸ–₯️ EC2

  • CPU
  • Memory
  • ENI capacity
  • Instance type
  • Β awsvpcTrunkingΒ 
  • Auto Scaling capacity

🌐 Networking

  • Available subnet IPs
  • ENI capacity
  • Security groups
  • Subnets

☁️ Fargate

  • vCPU quotas
  • Launch rates
  • On-Demand quotas
  • Spot quotas

ο»Ώ

🚨 The Important Part

When an ECS task doesn't start, don't immediately assume:
β€œThere isn't enough CPU.”
There are many possible constraints:
Task won't start
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
↓ ↓ ↓
CPU Memory Networking
β”‚ β”‚ β”‚
↓ ↓ ↓
Capacity Capacity ENI / IPs
β”‚
↓
ECS Quotas / Limits
The bottleneck might be somewhere else.
And that's exactly why understanding ECS limits is useful.

ο»Ώ

πŸ’­ Final Thoughts

Amazon ECS is highly scalable, but scalable doesn't mean unlimited.
You can have:
βœ… CPU available βœ… Memory available ❌ No ENI capacity
Or:
βœ… EC2 Auto Scaling configured ❌ Cluster approaching a hard limit
Or:
βœ… Desired count increased ❌ Tasks stuck in Β PROVISIONINGΒ 
The goal isn't to memorize every AWS quota.
It's to know where the boundaries are, how to recognize them, and what options you have when you reach them.

πŸš€ Before scaling ECS, ask:

β€œWhat resource will become my bottleneck first?”
Because sometimes, the answer isn't CPU or memory.
It's the limit you weren't looking at. πŸ‘€

ο»Ώ

πŸ“š References

For the most up-to-date values, always check the official AWS documentation:
  • Amazon ECS Service Quotas
  • Amazon ECS account settings
  • Amazon ECS Β awsvpcΒ  networking
  • Amazon EC2 network interface limits
  • AWS Fargate service quotas

Series: ECS Made Practical (3 articles)

  1. 3
    πŸš€ Amazon ECS Limits You Should Know Before Scaling This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article