The serverless pitch sounds perfect: pay only for what you use, scale infinitely, zero infrastructure management. For the right workload at the right scale, it delivers on every promise.
For the wrong workload at the wrong scale, it costs 5–10x more than an equivalent dedicated server and introduces latency, cold start unpredictability, and debugging complexity that teams don't see coming.
The decision between server and serverless isn't a philosophical one. It's arithmetic — and the arithmetic depends on a specific traffic number that most architects don't calculate before making the choice.
The Core Economics
Serverless (AWS Lambda): Charged per invocation + per GB-second of compute. Current AWS pricing (2025): $0.20 per 1 million requests + $0.0000166667 per GB-second.
Dedicated server (EC2): Fixed cost regardless of traffic. A t3.medium ($0.0416/hr = ~$30/month) runs 24/7 whether handling 1 request or 10,000 requests per hour.
The crossover point — where serverless becomes more expensive than a dedicated instance — depends on request volume, duration, and memory allocation.
Monthly Request Volume → Server vs. Serverless Cost
Assumptions: Lambda at 512MB, 100ms average duration. EC2 instances as cost baseline (on-demand, us-east-1). Application-level compute only — no RDS, storage, or egress.
| Monthly Requests | Lambda Cost | t3.micro ($11/mo) | t3.small ($17/mo) | t3.medium ($30/mo) | t3.large ($60/mo) |
|---|---|---|---|---|---|
| 100,000 | $0.10 | $11.00 | $17.00 | $30.00 | $60.00 |
| 500,000 | $0.50 | $11.00 | $17.00 | $30.00 | $60.00 |
| 1,000,000 | $1.68 | $11.00 | $17.00 | $30.00 | $60.00 |
| 5,000,000 | $8.38 | $11.00 | $17.00 | $30.00 | $60.00 |
| 10,000,000 | $16.67 | $11.00 | $17.00 | $30.00 | $60.00 |
| 20,000,000 | $33.33 | $11.00 | $17.00 | $30.00 | $60.00 |
| 50,000,000 | $83.33 | $11.00 | — (underpowered) | $30.00 | $60.00 |
| 100,000,000 | $166.67 | — | — | $30.00 | $60.00 |
| 500,000,000 | $833.33 | — | — | — | $60.00 |
The t3.medium crossover: ~18 million requests/month. Below that, Lambda is cheaper. Above it, the dedicated server wins — and the gap grows rapidly with scale.
At 100M requests/month, Lambda costs $167 vs. a $30 t3.medium. That's 5.5x more expensive, for a workload a medium instance handles comfortably.
The Duration Variable
Lambda pricing is highly sensitive to function duration. Longer-running functions are where serverless economics deteriorate fastest.
| Function Duration (avg) | Lambda cost at 10M req/mo | Lambda cost at 100M req/mo |
|---|---|---|
| 10ms | $4.87 | $48.67 |
| 50ms | $10.87 | $108.67 |
| 100ms | $16.67 | $166.67 |
| 500ms | $54.67 | $546.67 |
| 1,000ms (1 second) | $104.67 | $1,046.67 |
A Lambda function averaging 500ms at 100M requests/month costs $547 vs. a $60 t3.large. That's 9x more expensive.
Long-running operations — image processing, PDF generation, complex database queries — are the worst candidates for Lambda on cost grounds.
When Serverless Wins
Serverless is genuinely superior in specific conditions:
Low or unpredictable traffic: An API that handles 50,000 requests/month (a SaaS product in early stages) costs $0.05 on Lambda. It would cost $11–$30/month on the cheapest viable EC2 instance. Serverless saves 99% at this scale.
Bursty traffic with long idle periods: A batch job that runs for 2 hours daily uses 8.3% of a dedicated server's capacity. Lambda charges only for those 2 hours.
Event-driven architectures: S3 triggers, SQS processors, Kinesis consumers — these are the workloads Lambda was designed for, and the economics are excellent.
Zero-ops teams: Lambda eliminates instance management, patching, and capacity planning. For small teams, the operational savings (1–2 days/month of engineer time) can offset higher compute costs at moderate traffic levels.
The Cold Start Problem
Beyond cost, serverless introduces a latency characteristic that dedicated servers don't have: cold starts.
When a Lambda function hasn't been invoked recently, the next request incurs a cold start penalty — typically 100–500ms for Node.js/Python, up to 3–10 seconds for Java or .NET. For user-facing APIs where p99 latency matters, cold starts are a serious consideration.
Mitigation options: Provisioned Concurrency (pre-warms instances, eliminates cold starts) costs ~$0.0000041/GB-second even when idle — adding $30–$100/month for typical configurations, which shifts the Lambda vs. EC2 crossover point lower.
The Hybrid Architecture
Most production systems at meaningful scale use a hybrid model:
- Lambda / serverless: Background jobs, event processing, rarely-triggered endpoints, scheduled tasks
- Dedicated instances: Core API handlers, high-throughput services, anything with consistent load and sub-100ms P99 latency requirements
This is not complexity for its own sake. It's matching cost structure to traffic pattern — using the cheaper option in each context.
Calculate It Yourself
The Server Cost Calculator lets you enter your expected request volume, function duration, memory, and traffic pattern to compare Lambda vs. EC2 costs at your specific scale — and find the exact crossover point where it makes sense to switch architectures.