Fargate task right-sizing cost: stop over-allocating vCPU and memory
Fargate bills for exactly the vCPU and memory you allocate to a task, so over-allocating is pure waste that scales with task count. Right-sizing tasks to real usage often cuts Fargate spend by 30 to 50 percent. Here is how to size tasks to what they actually use.
Quick answer
Fargate charges for the vCPU and memory you allocate to each task (about $0.04048 per vCPU-hour and $0.004445 per GB-hour in us-east-1), regardless of how much the task actually uses. So a task allocated 1 vCPU and 2 GB that only uses 0.3 vCPU and 800 MB wastes most of its allocation, and that waste multiplies across every running copy. Right-sizing means measuring real CPU and memory use and dropping the task to the smallest valid vCPU/memory combination that covers the peak with a safety margin. Because tasks often run in large numbers, this commonly cuts Fargate spend 30 to 50 percent with no performance loss. The rule: allocate to real usage plus headroom, not to a round number.
Fargate's pricing is refreshingly direct: you pay for the vCPU and memory you allocate to a task, per second, for as long as it runs. That directness is also the trap. Because you set the allocation and pay for it whether or not the task uses it, over-allocation is pure, silent waste, and it multiplies across every task in the service. Right-sizing tasks is one of the highest-return Fargate optimizations.
How Fargate allocation bills
| Allocation | Hourly cost | Monthly (24/7) |
|---|---|---|
| 0.25 vCPU, 0.5 GB | ~$0.0123 | ~$9 |
| 0.5 vCPU, 1 GB | ~$0.0247 | ~$18 |
| 1 vCPU, 2 GB | ~$0.0494 | ~$36 |
| 2 vCPU, 4 GB | ~$0.0987 | ~$72 |
At about $0.04048 per vCPU-hour and $0.004445 per GB-hour, a 1 vCPU / 2 GB task costs about $0.0494 per hour, roughly $36 a month running continuously. Drop it to 0.5 vCPU / 1 GB and it costs about $18 a month, half as much. If that task really only uses a third of a vCPU and under a gigabyte, the larger allocation was paying for headroom the task never touched.
The multiplier effect
The reason task right-sizing matters so much is scale. Over-allocating a single task by $18 a month is minor, but a service running 20 replicas of that task wastes $360 a month, and an organization with dozens of over-allocated services wastes thousands. Because the same task definition is deployed in quantity, every unit of over-allocation is multiplied by the replica count, so a small per-task fix produces a large total saving.
Measuring real usage
Right-sizing starts with data. Container Insights or CloudWatch metrics show each task's actual CPU and memory utilization over time. Look at the sustained peak, not the average, since you must cover the busy moments, then add a modest safety margin (say 20 to 30 percent). A task peaking at 0.35 vCPU and 700 MB fits comfortably in a 0.5 vCPU / 1 GB allocation, not the 1 vCPU / 2 GB it may have been given by default. This is the same discipline as right-sizing Kubernetes pods.
Mind the valid combinations
Fargate only allows certain vCPU and memory pairings: each vCPU size supports a defined memory range. You cannot pick arbitrary values, so right-sizing means choosing the smallest valid combination that covers your peak. Sometimes memory forces a larger vCPU tier or vice versa, so check both dimensions against the allowed pairs. Even constrained to valid combinations, most over-allocated tasks can drop at least one tier.
Making right-sizing stick
Measure usage, drop each task to the smallest valid allocation that covers its peak with headroom, and re-check periodically as the workload changes. Combine right-sizing with Fargate Spot for interruptible tasks and a Compute Savings Plan on the steady baseline for compounding savings. Because task definitions live in your infrastructure code, the allocation is set at deploy time, so catch over-allocation before it ships. Price your task definitions against the resource catalog so the vCPU and memory cost is visible in the pull request, not discovered across a fleet of oversized tasks on the bill.
FAQ
How does Fargate task sizing affect cost?
Fargate charges for exactly the vCPU and memory you allocate to a task (about $0.04048 per vCPU-hour and $0.004445 per GB-hour), regardless of how much the task uses. So an over-allocated task, say 1 vCPU and 2 GB for a workload that only needs 0.3 vCPU and 800 MB, wastes most of its allocation. Right-sizing to real usage can halve a task's cost, and that saving multiplies across every running replica.
How much can I save by right-sizing Fargate tasks?
Commonly 30 to 50 percent, because over-allocation multiplies across replicas. Dropping a task from 1 vCPU / 2 GB (about $36 a month) to 0.5 vCPU / 1 GB (about $18) halves its cost, and a service running 20 such replicas saves about $360 a month. Across many over-allocated services, right-sizing to real usage adds up to thousands per month with no performance loss when done with a safety margin.
How do I right-size a Fargate task?
Measure the task's actual CPU and memory utilization over time using Container Insights or CloudWatch, look at the sustained peak rather than the average, add a modest safety margin of 20 to 30 percent, then choose the smallest valid Fargate vCPU and memory combination that covers that peak. A task peaking at 0.35 vCPU and 700 MB fits comfortably in 0.5 vCPU / 1 GB, not the 1 vCPU / 2 GB it may have been given by default.
Why can't I pick any vCPU and memory for a Fargate task?
Fargate only allows certain vCPU and memory pairings: each vCPU size supports a defined memory range, so you cannot choose arbitrary values. Right-sizing therefore means selecting the smallest valid combination that covers your peak. Sometimes a memory requirement forces a larger vCPU tier or vice versa, so check both dimensions against the allowed pairs, though most over-allocated tasks can still drop at least one tier.
How does C3X help right-size Fargate tasks?
C3X prices your Fargate task definitions from Terraform against a live catalog, so the vCPU and memory cost of each task, multiplied by its replica count, is visible in the pull request before you deploy. That helps you catch over-allocation at design time and choose a smaller valid combination, rather than discovering a fleet of oversized tasks quietly wasting money across the monthly bill.
What to do next
Size Fargate tasks to real usage before they multiply. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.