Dev & engineering · free calculator
Container (ECS/EKS) vs Serverless (Lambda) cost
Compare monthly cost of running a workload on always-on containers vs serverless Lambda — break-even by request volume.
Lambda saves vs container
Show the work
- Container monthly cost$320
- Lambda monthly cost$114
- Break-even requests (M)140
Lambda or ECS — the volume crossover
Lambda is cheap at low volumes (often free) and expensive at high volumes. Containers are expensive at low volumes (always-on bill) and cheap at high volumes. The break-even depends on request rate, duration, and memory.
The math
GB-seconds per request = memory MB ÷ 1024 × duration ms ÷ 1000
total GB-seconds = requests × GB-seconds per request
Lambda cost = total GB-seconds × $0.0000166667 + requests × $0.0000002Default scenario: 50M requests/mo × 250ms × 512MB:
- GB-seconds: 50M × 0.125 = 6.25M
- Lambda cost: 6.25M × $0.0000166667 + 50M × $0.0000002 = $104 + $10 = $114/mo
- Container cost (1 small instance): $320/mo
- Lambda wins by $206/mo at this volume.
When containers win
- Sustained throughput → instance is "fully utilized" anyway
- Long-running connections (websockets, gRPC streams)
- Latency-sensitive (Lambda cold start adds 100-500ms first call)
- High memory (Lambda max 10GB; certain workloads need 32+ GB)
- Workloads needing GPU
When Lambda wins
- Bursty / unpredictable traffic
- Long idle periods
- Sub-second functions
- Event-driven (S3 → Lambda, SQS → Lambda)
- Cost optimization at low scale
The break-even
Default scenario: $320 / per-request cost ($0.00000228) = ~140M requests/mo before Lambda exceeds container cost. Above 140M req/mo: containers cheaper. Below: Lambda cheaper.
What this calc misses
- NAT Gateway / VPC costs (both apply differently)
- Cold start latency (real Lambda cost in user experience for low-traffic functions)
- Reserved instance discounts on containers (-40-60%)
- Lambda Provisioned Concurrency (eliminates cold start; costs more)
- API Gateway costs ($1.00 per million requests for REST API on top of Lambda)
Export
CSVPrintable PDFEmbedNot sure which calc you need? Ask →Related calculators