>5B invocations/month: EC2 Spot/Reserved wins (60–80% cheaper than Fargate)
Rule of thumb: If you need 24/7 compute, move off Lambda. If you have 100+ concurrent requests, use Fargate or EC2.
Feature Comparison
Feature
Lambda
Fargate
EC2
Cold start latency
300–1000ms (first invocation)
5–10s (container startup)
Instant (already running)
Max execution time
15 minutes
As long as needed
As long as needed
Concurrency
1,000 concurrent (can increase)
Unlimited (per task)
Unlimited
Networking
No direct public IP (NAT Gateway $45/mo)
Full VPC networking
Full VPC networking
Persistence
/tmp (512MB, temporary)
EBS volumes available
EBS/instance store
Auto-scaling
Automatic (Lambda API)
Manual (ECS target scaling)
Manual (Auto Scaling groups)
Cost visibility
Per invocation (easy to optimize)
Per container hour (fixed)
Per instance hour (fixed)
5 Cost Reduction Tactics
1. Lambda Memory Right-Sizing (20–50% savings for CPU-bound workloads)
Lambda CPU scales linearly with memory. Find your optimal balance:
Charge model: $0.0000166667 per GB-second. Allocate 128MB–3GB (you pay per execution time).
Test: Run same function at 512MB, 1GB, 2GB, 3GB. Find where cost/duration product is lowest.
Real example: Image processing function: 3GB allocation (finishes in 10s, $0.000025 cost) vs 512MB (takes 60s, $0.000010 cost per execution but 3K invocations/day = $30/day vs $10/day = $7K/year savings)
Savings: Typically 20–40% by right-sizing to optimal GB-second ratio
2. Lambda to Fargate Migration (30–60% savings for sustained workloads)
If Lambda concurrency is consistently high, Fargate is cheaper and simpler:
Threshold: If you have >1,000 concurrent Lambda executions OR >10M invocations/month, Fargate wins
Migration effort: 2–4 weeks (refactor event handlers to HTTP server, containerize, deploy to ECS)
⚠️ Lambda Cold Start Trap: Cold starts (300–1000ms) add up for event-driven workloads. At 100M invocations/month with 10% cold start rate = 10M cold starts = massive latency tail. Use Fargate or keep Lambda warm with scheduled invocations if cold starts matter.
Independent research on what SaaS costs: pricing pages, comparisons, guides and free calculators. Prices change, so confirm with the vendor before you buy.