Serverless vs Container Cost Calculator
Work out serverless vs container cost instantly with clear inputs, formula shown and shareable results.
About Serverless vs Container Cost Calculator
Serverless cost is GB-seconds — requests times duration times memory in gigabytes — plus a per-request charge, so it scales exactly with usage and costs nothing when idle. Containers cost the same whether busy or not. The crossover therefore depends on utilisation: spiky low-duty-cycle workloads favour serverless, sustained high-volume workloads favour containers.
Formula
Serverless cost
GB-seconds = requests x duration x memory GB; cost = GB-seconds x per-GB-second rate + requests / 1e6 x per-million rate
Worked example
With the default values below, Serverless vs Container Cost Calculator returns Serverless monthly cost of $68.00. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Requests per monthminimum 0 millions
- 40 millions
- Average execution durationminimum 1 ms
- 180 ms
- Memory allocatedaccepts 64–10,240 MB
- 512 MB
- Monthly cost of the equivalent container fleetminimum 0
- 620
Results
- Serverless monthly cost
- $68.00
- GB-seconds consumed
- 3,600,000
- Cheaper option
- Serverless is cheaper at this volume
- Break-even request volume
- 364.7 millions
Step by step
- 1Values used
- 2Serverless cost
- 3Serverless monthly cost= 68.00
- 4GB-seconds consumed= 3,600,000
- 5Cheaper option= Serverless is cheaper at this volume
- 6Break-even request volume= 364.7 millions
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Does allocating more memory always cost more?
Not necessarily. More memory means proportionally more CPU, so a function may finish fast enough that GB-seconds fall. Always measure across memory settings.
What costs are missing from this comparison?
Cold-start latency, API gateway charges, and the operational cost of container orchestration. The last frequently outweighs the compute difference.
Related Calculators
You might also need
- CDN Cost CalculatorAlso in Cloud Sizing & Cost
- Cloud Exit Cost CalculatorAlso in Cloud Sizing & Cost
- Cloud Monthly Cost CalculatorAlso in Cloud Sizing & Cost
- Egress Cost CalculatorAlso in Cloud Sizing & Cost
- Fargate Cost CalculatorAlso in Cloud Sizing & Cost
- Licence Cost In Cloud CalculatorAlso in Cloud Sizing & Cost
