awsfargateec2ecscontainerscost-optimization

Fargate vs EC2 cost: the crossover is utilization, not the rate

Fargate costs 15-50% more per vCPU and GB than EC2, but you pay for zero idle capacity. Here's where the crossover actually is, why dense fleets favor EC2, and when Fargate's premium is the cheapest line on the bill.

The C3X Team··8 min read

Quick answer

Fargate costs 15-50% more than EC2 per vCPU and GB, but you pay for zero idle capacity. The crossover is utilization: if your EC2 instances run above ~70% packed, EC2 is cheaper; below that, the headroom you pay for on EC2 wipes out its per-unit advantage and Fargate wins. Use Fargate for spiky or small workloads, EC2 launch type for dense, steady fleets you can cover with Savings Plans.

Every ECS or EKS decision eventually hits the same fork: run containers on Fargate and let AWS manage the capacity, or run them on EC2 launch type and manage the instances yourself. The pricing pages make Fargate look expensive and EC2 look cheap. The real answer depends almost entirely on one number you can't see on either pricing page: how densely you pack your instances.

How each one is priced

Fargate bills for the vCPU and memory each task requests, per second, while the task runs. In us-east-1 that's about $0.04048 per vCPU-hour and $0.004445 per GB-hour. A 1 vCPU / 2 GB task running around the clock is:

(1 vCPU × $0.04048) + (2 GB × $0.004445)  = $0.04937/hour
$0.04937 × 730 hours                       ≈ $36.04/month

EC2 launch type bills for the instances, not the tasks. You pay for the whole instance whether your containers fill it or not. A c6i.large (2 vCPU, 4 GB) is about $0.085/hour, ~$62/month — and if it only runs one 1 vCPU task, half of that is idle headroom you're paying for.

The crossover is utilization, not the rate

Compare like for like. To serve 8 vCPU of tasks on Fargate you pay for 8 vCPU. To serve them on EC2 you buy instances totaling at least 8 vCPU, and in practice more, because you can never bin-pack perfectly and you need headroom for scaling. The question is what fraction of the instance you actually use:

  • High utilization (70%+): EC2's lower per-unit price dominates. A dense fleet of always-busy services is cheaper on EC2, especially with a Savings Plan.
  • Low or spiky utilization: Fargate wins. You stop paying the moment a task stops, and you never pay for an instance's empty half. Cron jobs, bursty APIs, and per-PR preview environments are textbook Fargate.

Don't forget the operational cost

The EC2 launch type is cheaper on paper partly because it pushes work onto you: patching AMIs, draining instances on deploy, capacity providers, and the cluster autoscaler. For a small team, the engineering hours to run that reliably can dwarf the per-unit savings. Fargate's premium is partly a managed-capacity fee — sometimes the cheapest line item on the bill is the one you don't have to operate.

Where the discounts land

Both launch types are covered by Compute Savings Plans (up to ~50% for a 1-3 year commitment), so a steady Fargate workload isn't stuck at on-demand rates. For interruptible work, Fargate Spot is ~70% off and EC2 Spot can reach 90% off. See when spot instances actually save money and Reserved Instances vs Savings Plans for the commitment math.

A decision rule that holds up

  1. Running fewer than ~10 always-on tasks, or anything spiky? Use Fargate. The operational simplicity is worth the premium and you won't pack instances well enough for EC2 to win.
  2. Running a large, steady fleet you can pack above 70%? Use EC2 launch type and cover the baseline with a Savings Plan.
  3. Mixed? Run the steady baseline on EC2 and burst onto Fargate. ECS capacity providers support exactly this split.

FAQ

Is Fargate more expensive than EC2?

Per unit of vCPU and memory, yes — Fargate charges a premium of roughly 15-50% over the equivalent on-demand EC2 instance. But Fargate bills only for the resources your tasks request while they run, with no idle capacity. EC2 is cheaper per unit only if you keep instances densely packed (70%+ utilization). Below that, the idle headroom you pay for on EC2 usually erases the per-unit advantage.

How is AWS Fargate priced?

Per vCPU-hour and per GB-hour of the resources a task requests, billed per second with a one-minute minimum. In us-east-1 it's about $0.04048 per vCPU-hour and $0.004445 per GB-hour. A 1 vCPU / 2 GB task running 24/7 costs about $36/month.

When should I use EC2 launch type instead of Fargate?

When you run enough containers to keep EC2 instances densely packed, when you need GPUs or instance types Fargate doesn't offer, when you want to amortize cost with Reserved Instances or Savings Plans, or when per-task startup latency matters. High, steady utilization is where EC2's lower per-unit price wins.

Does Fargate Spot save money?

Yes — Fargate Spot runs interruptible tasks at roughly 70% off on-demand Fargate. It's right for fault-tolerant, stateless workloads. EC2 Spot can go deeper (up to 90% off) but you manage the capacity and interruptions yourself.

Do Savings Plans cover Fargate?

Yes. Compute Savings Plans apply to Fargate usage as well as EC2 and Lambda, at up to ~50% off for a 1-3 year commitment. That narrows the per-unit gap with EC2 for steady Fargate workloads you're confident you'll keep running.

How does C3X estimate Fargate vs EC2 cost?

C3X prices an aws_ecs_service on Fargate from the task CPU and memory you request, and an EC2-backed service from the underlying aws_instance or node group. That lets you compare the two launch types on your real Terraform before deploying either.

What to do next

Don't guess the crossover — measure it on your own definitions. C3X estimates an aws_ecs_service on either launch type, and an aws_eks_node_group for the EC2-backed Kubernetes equivalent, so you can compare both against your real task sizes. The quickstart gets you to a number in under five minutes.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.