AI Summary - 20-sec read - Reviewed by experts
- ECS runs your containers on one of two launch types: Fargate (serverless, you pay per vCPU and GB per second for each task) or EC2 (you run the instances and pay for them whole, full or empty).
- The deciding number is utilization. If you keep instances 70 to 85 percent full around the clock, EC2 is usually cheaper per unit of work. If your load is spiky, bursty, or part-time, Fargate wins because you pay nothing for idle capacity.
- Fargate also removes the work of patching, scaling, and bin-packing the instance fleet. That saved engineering time is a real cost most comparisons ignore.
- You do not have to choose once. A common pattern is EC2 for the steady baseline and Fargate for spikes and batch jobs, with Spot on both to cut the rate further.
- Short on time? Book a free call.
Short on time? Book a free call.
Two teams run the exact same container image on AWS ECS and get bills that differ by 40 percent. The image is identical. The difference is the launch type underneath it, and whether it matches how the workload actually behaves. Pick the wrong one and you either pay for servers that sit half-empty or pay a premium rate on capacity you run flat-out all day. Most teams pick once, early, and never revisit it.
This is the comparison that settles it. Not Fargate versus EC2 as a religion, but a single question - what does your utilization curve look like - that tells you which one is cheaper for your specific workload.
What you are actually paying for in each
Both run containers; the billing models are opposites.
- Fargate is serverless containers. You declare how much vCPU and memory each task needs, and AWS bills you per second for exactly that, from when the task starts to when it stops. There are no instances to size, patch, or fill. You pay for the task, not the host.
- EC2 launch type means ECS schedules your containers onto EC2 instances that you own and pay for by the hour or second, whether your containers fill them or not. You manage the fleet - capacity, patching, scaling - and in return you get a lower rate per vCPU and the ability to pack many tasks onto one instance.
So the trade is clean: Fargate charges a premium per unit but bills only for what each task uses; EC2 charges less per unit but bills for the whole instance, including the empty space. Which is cheaper depends entirely on how much of that instance you keep busy.
Utilization is the whole decision
Here is the mental model. EC2 only beats Fargate when you fill the instances. An EC2 box running at 30 percent utilization is paying full price for 70 percent air - and at that point Fargate, which never bills for air, is almost certainly cheaper despite its higher unit rate. Flip it: an EC2 fleet held at 75 to 85 percent utilization spreads its lower rate across genuinely used capacity, and EC2 pulls ahead.
So before you compare price sheets, look at your own graphs:
- Steady, high, predictable load - a service that runs the same busy level all day. You can keep instances full. EC2 territory.
- Spiky or bursty load - quiet nights, peak mornings, traffic that triples during a campaign. Filling instances for the peak means paying for idle the rest of the time. Fargate territory.
- Part-time or batch - jobs that run for minutes then stop, cron tasks, queue workers. Per-second billing with zero idle is exactly Fargate's strength.
If you have never measured your real CPU and memory utilization, that is the first task, and it is the same discipline as right-sizing EC2 to stop overpaying - you cannot choose a launch type honestly without knowing how full your current capacity runs.
Not sure which launch type your bill is paying for?
Get a free audit. Send us your ECS setup and utilization and we will tell you whether Fargate or EC2 is cheaper for each service, with the numbers behind it. No pitch, reply in 2 hrs, no card needed, NDA on request.
Get a free auditThe cost most comparisons leave out: operations
Per-vCPU rates are only half the bill. The other half is engineering time, and it lands almost entirely on the EC2 side.
With EC2 you own the fleet. That means choosing instance types, patching the operating system, handling AMI updates, sizing the cluster, and tuning the scaling so the right amount of capacity is available without waste. Bin-packing - fitting tasks onto instances efficiently - is an ongoing job, not a one-time setup. None of that is free; it is hours of skilled time every month.
Fargate deletes that work. No instances to patch, no fleet to scale, no bin-packing. For a small team, that reclaimed time can be worth more than the per-unit price difference. The honest comparison is not Fargate's rate versus EC2's rate; it is Fargate's rate versus EC2's rate plus the cost of the people keeping the fleet healthy.
Takeaways
- Measure utilization first. High and steady favours EC2; spiky, bursty, or part-time favours Fargate.
- EC2 only wins when you actually fill the instances. A half-empty EC2 fleet is usually pricier than Fargate.
- Count operations. Fargate removes patching, scaling, and bin-packing - real saved time that belongs in the comparison.
- Use Spot on either launch type for fault-tolerant work, and consider mixing EC2 for baseline with Fargate for spikes.
Spot and Graviton cut the rate on both sides
Whichever launch type you land on, two levers lower the rate further:
- Spot. Both Fargate and EC2 offer Spot capacity at a steep discount in exchange for the possibility of interruption. For stateless web tasks, queue workers, and batch jobs that can be restarted, Spot is one of the largest savings available on either side. Keep a baseline on on-demand or reserved capacity for resilience and run the elastic, interruptible part on Spot.
- Graviton (ARM). AWS's Graviton processors typically give better price-performance than the equivalent x86. If your image builds and runs on ARM, choosing Graviton-backed capacity is a quiet, repeatable discount on the same workload, available on both Fargate and EC2.
These stack with the launch-type decision rather than replacing it. The goal is always the same as any AWS cost work: pay for used capacity at the lowest defensible rate, which is the thread running through cutting your S3 bill with storage classes and lifecycle rules and diagnosing your AWS data-transfer and NAT gateway costs.
Want your ECS bill cut without breaking your workloads?
Talk to a team that picks launch types, sizes fleets, and layers in Spot and Graviton for UK and US businesses running production containers on AWS. We will model the cheaper option for each service. No pitch, reply in 2 hrs.
Book a free callYou do not have to choose just once
The launch type is set per service, not per cluster, so a mixed strategy is not only allowed, it is often the cheapest. A frequent pattern: run the steady baseline of a busy service on a well-utilized EC2 capacity provider, and let ECS overflow the spikes and any short-lived batch jobs onto Fargate. The baseline gets EC2's low rate at high utilization; the bursts get Fargate's zero idle cost. ECS capacity providers can blend these automatically, so you are not hand-managing the split.
One caveat before you optimise: make sure ECS is even the right orchestrator for you. If you are weighing the broader container platform choice, that decision sits upstream of this one - the comparison in ECS vs EKS for ecommerce containers covers it, and if some of your workloads are short request-response functions rather than long-running services, Lambda vs ECS for AI workloads may move part of the load off containers entirely. Settle the platform first, then optimise the launch type within it.
FAQ
Is Fargate always more expensive per vCPU than EC2?
Per vCPU at list price, generally yes. But that is the wrong unit to compare. The number that matters is cost per unit of actual work, and that depends on utilization. A lightly used EC2 fleet can cost more per useful vCPU-hour than Fargate, because you are paying for the idle portion too. Compare effective cost on real utilization, not sticker rates.
When is EC2 clearly the better choice?
When you have steady, predictable, high-volume load that keeps instances 70 to 85 percent full, when you need instance-level control such as GPUs or specific instance families, or when you run at a scale where the per-unit savings outweigh the fleet-management effort and you have the team to manage it. High and steady is EC2's home ground.
Does Fargate have any performance downside?
Fargate tasks have slightly longer cold-start times than a container scheduled onto an already-running EC2 instance, and you have less control over the underlying host. For most web services and batch jobs this is irrelevant. For latency-critical workloads that need the host warm and tuned, EC2 gives you finer control.
Can I move from EC2 to Fargate without rewriting my containers?
In most cases yes. The same container image runs on both; you are changing the launch type and the task definition's CPU and memory settings, not the application. Watch for anything that assumes access to the host, such as certain daemons or host networking modes, since Fargate abstracts the host away. Test those before you switch.
The takeaway: stop arguing Fargate versus EC2 in the abstract and pull up your utilization graphs. Steady and full means EC2 with reservations; spiky, bursty, or part-time means Fargate with zero idle. Mix them where it pays, layer Spot and Graviton on top, and the same containers cost you noticeably less by the end of the month.
Founder and CEO of Braincuber. Has scoped and shipped 500+ Odoo, AI, and cloud projects for US mid-market and global brands. Takes every founder call personally — no SDR layer between buyers and the people building the system.
