Skip to content

Cost comparison: ECS on EC2 vs AWS Fargate

0

Hi everyone,

I’m trying to understand the cost differences between running my ECS workloads on EC2 instances versus AWS Fargate.

Here's my scenario:

  • I need around 10 vCPUs and 20 GB of memory for a continuously running containerized workload.
  • I'm evaluating whether it would be more cost-effective to use ECS on EC2 (with my own instance types) or ECS on Fargate.

My questions are:

  • Approximately how much cheaper would ECS on EC2 be compared to Fargate for this level of compute and memory?
  • How would the comparison change if I used a Reserved Instance (RI) or a Compute Savings Plan for the EC2 option?
  • Does Fargate Savings Plan provide comparable cost savings to EC2 Reserved Instances or Compute Savings Plans?

I’m mainly looking for a high-level cost comparison that illustrates the trade-off between flexibility and cost efficiency

2 Answers
1
Accepted Answer

Based on the cost analysis of ECS deployment options:

For compute-intensive workloads, ECS on EC2 is generally much cheaper than Fargate. For your specific resource needs (10 vCPUs and 20GB memory), Fargate would be more expensive since it charges separately for vCPU and memory usage, while EC2 offers combined resource pricing.

Regarding cost savings with commitment options:

  • Standard Reserved Instances offer the highest potential savings of up to 75% off On-Demand pricing
  • EC2 Instance Savings Plans provide up to 72% savings
  • Compute Savings Plans offer up to 66% savings and can apply across EC2, Lambda, and Fargate usage
  • Convertible Reserved Instances provide up to 54% savings with more flexibility to change instance attributes

The trade-off consideration is that while EC2 requires more maintenance effort and infrastructure management, it provides better cost optimization potential. Fargate removes the need to manage infrastructure but comes at a premium price for the added convenience and automation.

One important limitation to note is that Fargate only supports up to 4 vCPUs and 30 GB memory per task , so for your 10 vCPU requirement, you would need to split the workload across multiple Fargate tasks, which could further impact costs.

AWS
answered 24 days ago
AWS
EXPERT
reviewed 22 days ago
1

Hi Pavlo, Without knowing the details, it is likely RI for EC2 is the way to go for you. If you want to explore cost details you can always use the free pricing calculator from AWS: https://calculator.aws/#/addService

fyi Fargate is serverless and you would not have EC2 instances at that point, thus not benefitting from RI

answered a month ago
AWS
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.