π 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)
- 3π Amazon ECS Limits You Should Know Before Scaling This article
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 moreAt 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 β
AvailableMemory β
AvailableENI β ExhaustedCan 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 5Need 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 RUNNINGNow 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 / LimitsThe 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)
- 3π Amazon ECS Limits You Should Know Before Scaling This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article