“Running it in a container will reduce costs,” is that thought,
true? Let’s check the numbers directly.
>
π― What this article covers
- Why ECS and EC2 have different pricing models
- Which is cheaper based on the same performance criteria
- Why the conclusion changes depending on cluster utilization
- A realistic comparison considering discount options like Savings Plan and Spot
- What is the position of the new ECS Managed Instances released in 2025
π Introduction β Is the question “ECS vs EC2” itself flawed?
When using AWS, this question naturally arises:
“Which is cheaper: deploying the same application directly on EC2,
or deploying it with ECS (containers)?”
However, there’s a trap in this question. ECS and Fargate are not competitors. ECS is a container orchestration service, and Fargate is one of the compute options for running ECS tasks.
In other words, the correct comparison targets are as follows:
| Comparison Target | Description |
| Pure EC2 | Directly deploy apps on VM, manage all infrastructure yourself |
| ECS on EC2 | Run containers on EC2 instances, ECS handles scheduling |
| ECS on Fargate | Serverless, AWS manages all infrastructure |
Let’s compare these three based on the same performance criteria.

π First, understand the pricing structure
π‘ EC2 (Pure or ECS on EC2)
EC2 is billed per instance. Whether the utilization is 20% or 100%, the cost is incurred for as long as the instance is running.
λΉμ© = μΈμ€ν΄μ€ μκ°λΉ μκΈ Γ μ€ν μκ°
Example: t3.medium (2 vCPU / 4GB) β approx. $0.0416/hr (us-east-1 On-Demand standard)
π‘ ECS on Fargate
Fargate is billed for the vCPU and memory usage requested by the task, from the time the container image is pulled until the ECS task terminates.
λΉμ© = (vCPU μκΈ Γ μ¬μ© vCPU Γ μκ°) + (λ©λͺ¨λ¦¬ μκΈ Γ μ¬μ© GB Γ μκ°)
Example: Running a 1 vCPU + 2GB task for 730 hours (1 month)
- vCPU: $0.04048 Γ 1 Γ 730 = $29.55
- Memory: $0.004445 Γ 2 Γ 730 = $6.49
- Total: approx. $36.04/month
Same spec EC2 (t3.small 2vCPU/2GB): $0.0208/hr Γ 730 = approx. $15.18/month
π Based on specs alone, EC2 is about 2 times cheaper. But that’s not the whole story.
βοΈ Utilization is key
The decisive variable in cost comparison is EC2 instance utilization.
EC2-based ECS pays a fixed cost for the memory and capacity of the chosen instance type. Regardless of how much the workload actually uses, the full instance cost is paid. Fargate, on the other hand, is billed only for the CPU and memory consumed by a single task, so costs can be more closely aligned with actual resource requirements.
Scenario comparison (based on 10 vCPU / 20GB workload)
| Utilization | ECS on EC2 (On-Demand) | ECS on Fargate | Cheaper Option |
| 90% or more | Approx. $350/month | Approx. $520/month | β EC2 |
| 50~60% | Approx. $350/month | Approx. $520/month | β EC2 |
| 30% or less | Approx. $350/month (waste occurs) | Billed proportional to actual usage | β Fargate advantageous |
| Intermittent execution | Maintenance cost remains the same | Billed only for execution time | β Fargate overwhelmingly advantageous |
Up to a certain threshold, Fargate’s precise billing is more cost-effective than EC2-based. However, beyond that threshold, managing your own EC2 fleet becomes more cost-effective than Fargate.
π» Practical Simulation β Based on the same app
Let’s compare directly under the following conditions:
- One web application, operating 24/7
- Required specs: 2 vCPU, 4GB memory
- Region: ap-northeast-2 (Seoul)
- Basis: 1 month (730 hours)
Direct EC2 operation (t3.medium, On-Demand)
# Check t3.medium On-Demand price in Seoul region
aws pricing get-products
--service-code AmazonEC2
--filters 'Type=TERM_MATCH,Field=instanceType,Value=t3.medium'
'Type=TERM_MATCH,Field=location,Value=Asia Pacific (Seoul)'
--query 'PriceList[0]'
- t3.medium (2vCPU / 4GB): approx. $0.052/hr
- Monthly cost: $0.052 Γ 730 = approx. $37.96
- Reserved Instance (1 year): approx. $22~25/month (approx. 40% savings)
ECS on Fargate (2 vCPU / 4GB, always running)
# Calculate Fargate monthly cost in Seoul region
# vCPU: $0.04656/hr (Seoul standard)
# Memory: $0.00512/GB/hr (Seoul standard)
python3 -c "
vcpu_cost = 0.04656 * 2 * 730
mem_cost = 0.00512 * 4 * 730
print(f'vCPU λΉμ©: ${vcpu_cost:.2f}')
print(f'λ©λͺ¨λ¦¬ λΉμ©: ${mem_cost:.2f}')
print(f'μ΄ Fargate μ λΉμ©: ${vcpu_cost + mem_cost:.2f}')
"
# vCPU cost: $67.98
# Memory cost: $14.95
# Total Fargate monthly cost: $82.93
###
Summary of Results
| Option | Monthly Cost | Notes |
| EC2 On-Demand | ~$38 | Requires direct management |
| EC2 Reserved (1 year) | ~$23 | Requires long-term commitment |
| Fargate On-Demand | ~$83 | No management required |
| Fargate Spot | ~$25 | Potential for interruption |
| Fargate Savings Plan (1 year) | ~$55 | Approx. 30% savings |
π For a single, always-on workload, EC2 is 2-3 times cheaper.
π New Option in 2025 β ECS Managed Instances
Amazon ECS Managed Instances, announced in September 2025, combine the operational convenience of Fargate with the flexibility of EC2. AWS manages the infrastructure while allowing access to various EC2 instance types.
Managed Instances add a management fee of $0.02/hr to EC2 pricing. The fee is the same regardless of the instance type. This means whether you use t3.micro or m5.24xlarge, an additional $0.02/hr will be incurred.
If you find direct EC2 management burdensome but Fargate pricing too high, this could be a good middle ground.
π Fargate Spot β The Hidden Card
Workloads that can tolerate interruptions, such as batch jobs, development environments, or stateless services, can achieve up to 70% savings by running on Fargate Spot.
For development/test environments or asynchronous batch processing, Fargate Spot can actually be cheaper than EC2.
β οΈ Hidden Costs β Non-compute items
Estimating costs based solely on Fargate compute charges often leads to underestimation by 30-50%. In addition to compute costs, the following are added:
- ALB (Application Load Balancer): Approx. $16-25/month fixed + traffic costs
- NAT Gateway: $0.059/hr + $0.059/GB for data processing
- CloudWatch Logs: $0.76/GB for log ingestion, $0.033/GB/month for storage
- ECR: $0.10/GB/month for container image storage
For EC2, operational personnel costs must also be considered. Patching, security configuration, and autoscaling setup are invisible costs.
β Summary β When to choose what?
| Situation | Recommendation |
| 24/7 operation, utilization 60% or more | EC2 (On-Demand or Reserved) |
| No infrastructure management resources, quick start | ECS Fargate |
| Intermittent/batch workloads | Fargate Spot |
| EC2 economy + management convenience | ECS Managed Instances (New in 2025) |
| Irregular traffic with frequent Scale Up/Down | ECS Fargate |
Key Conclusions in Three Lines:
- If it’s a simple comparison based on specs, EC2 is 2-3 times cheaper than Fargate.
- If utilization is low or traffic is variable, Fargate can be more advantageous.
- From a TCO (Total Cost of Ownership) perspective, the true answer comes from calculating including operational personnel costs.
The most accurate way is to directly compare your workload specs using the AWS Pricing Calculator (calculator.aws). As an official tool, it allows for detailed simulations by region and purchase option.

Leave a Reply