Fargate vs EC2 for Amazon ECS: how to choose
An honest comparison of Fargate, the EC2 launch type and ECS Managed Instances, covering what each costs, what it can run and how much work it leaves to you.
Every ECS task needs somewhere to run, and ECS gives you three choices: Fargate, where AWS runs each task on capacity you never see; the EC2 launch type, where tasks run on instances you own and operate; and ECS Managed Instances, a newer middle ground where tasks run on EC2 instances that AWS provisions, patches and scales for you.
The control plane is free in all three cases. ECS has no cluster fee, so the decision comes down to compute cost, what your workload needs from the host and how much infrastructure you want to own.
The short answer
- Pick Fargate when you want no servers to manage, your load varies, or your team is small. It is the default for good reason.
- Pick EC2 when you have large, steady workloads you can pack densely, need GPUs or host-level access, or already run a well-oiled AMI pipeline.
- Pick Managed Instances when you want EC2 pricing and instance choice but not the patching and scaling work.
The rest of this post explains where those lines come from.
What you pay
Fargate bills per second for the vCPU and memory a task asks for. In us-east-1, Linux on x86 costs about $0.04048 per vCPU-hour and $0.004445 per GB-hour. Arm (Graviton) tasks cost roughly 20% less, and Fargate Spot is up to 70% cheaper for work that can be interrupted.
A task with 2 vCPU and 8 GB on Fargate therefore costs about $0.117 an hour. An m6i.large with the same 2 vCPU and 8 GB costs $0.096 an hour on demand. On paper EC2 is about 20% cheaper.
In practice you rarely fill an instance completely:
- The ECS agent and the operating system need some memory, so a “8 GB” instance offers your tasks a bit less.
- Bin packing leaves gaps. Two tasks that each need 5 GB will not share an 8 GB instance.
- Rolling deployments need spare room for the new tasks while the old ones drain.
- Auto scaling adds instances in whole steps, not by the task.
Try it with your own task size. Toggle the deployment to see the extra room a rolling update needs:
Packing tasks onto EC2 instances
3 × m6i.large: $0.288/h, with 100% of the CPU and 75% of the memory reserved. The same 6 tasks on Fargate: $0.323/h.
On-Demand Linux prices in us-east-1, October 2026. 90% of an instance's memory is counted as usable for tasks.
A cluster running at 70 to 80% reservation erases most of EC2’s price advantage. Teams that run large, steady fleets and invest in packing them well do save real money on EC2. Teams with a handful of services usually don’t.
Both models qualify for Compute Savings Plans, so commitment discounts don’t change the comparison much. Managed Instances bill the normal EC2 price plus a per-instance management fee, which varies by instance type. Check the ECS pricing page for your region.
To compare your own task sizes in your region, try the ECS cost calculator. It prices a service on Fargate, Fargate Spot, ARM and the cheapest EC2 instances that fit. If EC2 wins, the EC2 instance finder ranks the instance types that fit your tasks.
What each one can run
Fargate trades flexibility for simplicity. On Fargate you can’t:
- run privileged containers or use host networking (every task gets its own network interface in
awsvpcmode), - use GPUs,
- run daemon services, so per-host agents become sidecars in every task,
- go beyond 16 vCPU and 120 GB per task,
- rely on a warm image cache. Every task pulls its image, so large images start noticeably slower.
EC2 and Managed Instances give you the whole EC2 catalogue, including GPU, memory-optimized and network-optimized types, plus host-level features. Managed Instances also support Managed Daemons for per-host agents.
What you have to operate
With Fargate there is nothing below the task to look after. AWS patches the hosts, and the platform version is the only knob.
With the EC2 launch type you own:
- the AMI and its patching, usually the ECS-optimized AMI rebuilt on a schedule,
- an Auto Scaling group and a capacity provider with managed scaling,
- instance draining during scale-in and AMI rollouts,
- the ECS agent version.
None of this is hard on its own, but it is ongoing work, and it is the part that tends to break at 2 a.m.
Managed Instances remove most of that list. You describe the instances you want (vCPU and memory ranges, CPU vendor, generation), and ECS launches, patches and replaces them. You still think about instance types and packing, but not about AMIs.
Mixing them
You don’t have to choose once per company. A cluster can use several capacity providers, and each service picks its own. A common setup runs most services on Fargate, puts interruptible batch work on Fargate Spot and keeps a few GPU or high-throughput services on EC2 or Managed Instances.
A quick decision checklist
- Do you need GPUs, privileged containers or host networking? Use EC2 or Managed Instances.
- Is the workload spiky, small or still changing shape? Use Fargate.
- Is it large and steady, and can you keep instances 80% or more reserved? EC2 or Managed Instances will likely be cheaper.
- Do you have people who want to own AMIs and scaling? If not, prefer Fargate or Managed Instances over the EC2 launch type.
Whichever you choose, keep an eye on reservation versus actual usage. A task that reserves 2 vCPU and uses 0.2 costs the same on every launch type.