Keel

Fargate or EC2 for ECS: which is cheaper for a small SaaS?

By the Keel team · Last checked · 4 min read

Short answer

Per unit of CPU and memory, EC2 can be cheaper than Fargate, especially when instances are well packed, because you buy whole instances. But with EC2 you manage the servers and the packing of containers onto them. For most small SaaS teams, Fargate tends to have the lower total cost once you count the hours nobody spends looking after instances.

How do Fargate and EC2 costs differ for ECS?

Fargate bills for what each task is configured to use, while the EC2 launch type bills for the instances in your cluster whether or not they are full.

AWS says Fargate charges for vCPU, memory, operating system, CPU architecture and storage, per second, rounded up, with a one-minute minimum for Linux.

Fargate and the EC2 launch type compared
FargateEC2 launch type
You pay forvCPU, memory and storage configured per task, per secondThe instances in the cluster, used or not
ServersAWS runs themYou choose, patch, scale and replace them
Wasted capacityLittle, if tasks are right-sizedCommon, from poor packing
DiscountsCompute Savings Plans, Fargate SpotSavings Plans, Reserved Instances, Spot
Extras billed separatelyLogs, public IPv4 addresses, data transferThe same

Why can EC2 look cheaper than Fargate?

EC2 can look cheaper because you pay for raw instance capacity and keep the packing margin for yourself.

If you fill instances well, the price per unit of CPU and memory can come out lower than Fargate's, which also includes AWS running the hosts for you.

The catch is that the saving only exists if the instances are full. AWS describes Fargate as removing the need to choose server types, decide when to scale clusters or optimise cluster packing, which is exactly the work that decides whether EC2 comes out ahead. Idle headroom on a half-empty instance is a cost Fargate does not have.

When is EC2 worth the extra work?

EC2 is worth it when the workload is large and steady enough that well-packed instances beat Fargate by more than the time spent running them.

It is also the route when you need instance types or hardware that Fargate does not offer.

  • Large, steady workloads where instances stay well packed.
  • Workloads needing specific instance types, such as GPUs.
  • A team that already has someone looking after servers.
  • Compute spend that has become one of your largest costs, so a small percentage saving is real money.

How do you cut Fargate costs?

Cut Fargate costs by making tasks smaller, cheaper in architecture, interruptible where possible and committed where steady.

Each lever below comes from how AWS prices Fargate.

  1. Right-size tasks, because you pay for the vCPU and memory you configure, not what the container uses.
  2. Use Linux/ARM where your images support it; the Fargate price table lists ARM as its own rate, and ARM is available only on ECS. See whether Graviton is worth it.
  3. Use Fargate Spot for interruption-tolerant tasks; AWS says it is up to 70% off the regular price, and it is Linux only. See Spot instances for a small SaaS.
  4. Buy a Compute Savings Plan for the steady baseline; AWS says a one or three year commitment can reduce Fargate usage costs by up to 50%.
  5. Scale non-production down outside working hours, since a stopped task stops billing.

How do you right-size Fargate tasks?

Check what each service actually uses over a few weeks, then reduce the task size to fit with headroom.

Look at peaks, not just averages, because a task sized to the average falls over at the peak.

aws cloudwatch get-metric-statistics \
  --namespace AWS/ECS \
  --metric-name MemoryUtilization \
  --dimensions Name=ClusterName,Value=app Name=ServiceName,Value=api \
  --start-time 2026-10-14T00:00:00Z \
  --end-time 2026-11-11T00:00:00Z \
  --period 3600 \
  --statistics Maximum

Run the same query for CPUUtilization, set the task definition to the smallest supported CPU and memory combination that covers the peak with headroom, redeploy, and watch error rates and response times for a week. Illustrative only: a task configured with 2 GB of memory that never passes 600 MB is paying for memory it does not use, so a smaller supported size is a safe first try.

How do you compare the real cost, including time?

Add the engineering time that EC2 needs to the AWS bill before comparing.

With EC2 someone patches and replaces instances, scales the cluster, handles capacity problems and debugs host-level faults, none of which appears on an invoice.

Illustrative only: if instance care takes three hours a month, ask what those hours cost you and what they stop you building. At small scale that is often more than the difference in compute price. As the AWS bill grows, the balance shifts, which is why the choice is worth revisiting.

Can you mix Fargate and EC2, and when should you revisit?

Yes, an ECS cluster can use capacity providers for both, so a steady baseline can run on EC2 while spikes run on Fargate.

That mixed setup only pays off when the baseline is big enough to keep instances full.

Revisit the choice when compute becomes one of your largest costs, when the workload becomes large and steady, or after a commitment decision. A calm yearly check is enough; the monthly AWS cost review checklist is a good place to put it, and ECS or EKS is the other big choice to settle first.

Is your ECS compute bill under control?

Tick each item that is true today.

  • You know whether each service runs on Fargate or EC2, and why.
  • Task CPU and memory were checked against peak use in the last quarter.
  • Interruptible work runs on Fargate Spot, or you have decided it should not.
  • Your steady baseline is covered by a commitment, or you have decided against one.
  • Non-production scales down outside working hours.
  • Time spent looking after EC2 instances, if any, is counted in the comparison.

Decision point: Five or six ticks: your compute choice is deliberate. Three or fewer: you are probably paying for capacity you do not use.

Sources

  1. AWS docs, AWS Fargate for Amazon ECS (checked November 2026)
  2. AWS, AWS Fargate pricing (checked November 2026)
  3. AWS docs, Amazon ECS capacity providers for the Fargate launch type (checked November 2026)

Keep reading

Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.