September 13, 2025AWS

EC2 vs Serverless: Complete Cost Analysis

A side-by-side AWS cost breakdown of EC2 vs serverless across five real workload scenarios — plus the 15% rule for telling which one is actually cheaper for your traffic.

After migrating 50+ applications from EC2 to serverless, here's what we learned: The choice between EC2 and serverless isn't just about cost—it's about workload patterns, utilization, and hidden expenses.

The Bottom Line: When Each Option Wins

EC2 Wins When:

  • Consistent high utilization (>30%)
  • Long-running processes (>15 min)
  • Predictable, steady traffic
  • Need custom OS/kernel access

$74/month — High traffic example (t3.large)

Serverless Wins When:

  • Low/sporadic utilization (<15%)
  • Short-lived requests (<15 min)
  • Variable, unpredictable traffic
  • Event-driven workloads

$42/month — 10M requests/month example

Real-World Cost Breakdown

Here's the actual cost data from our AWS migration case study for a healthcare platform:

ScenarioEC2 Monthly CostServerless Monthly CostSavings
Low Traffic API (100K requests/month)$7.49 (t3.micro)$2.1072% savings
Medium Traffic API (1M requests/month)$14.98 (t3.small)$8.5043% savings
High Traffic API (10M requests/month)$29.95 (t3.medium)$42.00EC2 cheaper
Very High Traffic (100M requests/month)$74.88 (t3.large)$420.00EC2 much cheaper
Cron Jobs (Runs 1hr/day)$7.49 (always running)$0.3595% savings
The 15% Rule: If your EC2 utilization is below 15%, serverless will almost always be cheaper. We've seen this pattern across dozens of migrations. Use our Lambda cost calculator to verify.

Hidden Costs Analysis

EC2 Hidden Costs:

  • Data Transfer: $0.09/GB outbound (same for both)
  • EBS Storage: $0.10/GB-month for gp3 volumes
  • Load Balancer: $16.20/month + $0.008/LCU-hour
  • Auto Scaling: No cost, but complexity overhead
  • Operational Costs: Server management, patching, monitoring

Serverless Hidden Costs:

  • API Gateway: $3.50 per million requests (if needed)
  • CloudWatch Logs: $0.50/GB ingested
  • NAT Gateway: $45/month + $0.045/GB (if VPC needed)
  • Provisioned Concurrency: $0.000041667/GB-second

Decision Framework

Use this framework to make the right choice for your workload. For complete architectural guidance, check our serverless vs traditional architecture guide.

Choose EC2 When:

  • Traffic is predictable and consistent
  • Utilization exceeds 30% of instance capacity
  • Processes run longer than 15 minutes
  • You need Reserved Instances for 1-3 year commitment savings (up to 72%)
  • Application requires persistent connections or stateful processing

Choose Serverless When:

  • Traffic is sporadic or unpredictable
  • Workloads are event-driven
  • Each request completes in under 15 minutes
  • You want zero infrastructure management
  • Development speed matters more than marginal cost differences

Real Migration Case Study

We migrated a healthcare platform from EC2 to serverless. Here's what happened:

  • Before: 3x t3.medium instances ($90/month) running 24/7
  • After: Lambda + API Gateway ($38/month) for actual usage
  • Savings: 58% monthly cost reduction
  • Bonus: Auto-scaling, zero maintenance, better reliability

The platform handled 5M requests/month with 95% of those requests happening during business hours. EC2 instances sat idle 70% of the time—perfect serverless candidate.

Read the full story in our 85% AWS cost reduction case study.

Optimization Tips

For EC2:

  • Use Reserved Instances for predictable workloads (save 30-72%)
  • Right-size instances based on CloudWatch metrics
  • Use Spot Instances for fault-tolerant workloads (save 90%)
  • Leverage Auto Scaling to match demand

For Serverless:

  • Optimize Lambda memory for best price/performance ratio
  • Use ARM (Graviton2) for 20% better price-performance
  • Batch requests when possible to reduce invocations
  • Monitor and eliminate cold starts for latency-sensitive apps

Planning a build?

We're a small app development studio that ships production software — not slide decks. Get an honest estimate with no strings attached.

Get a Free Project Estimate