Containers and orchestration
Serverless cost crossover
Serverless is cheap when traffic is spiky and expensive when it is steady and high. Compare the request and GB-second math with an always-on container before you choose.
Serverless bills per request and per GB-second. An always-on container bills for the time it stays up. Which is cheaper depends on how busy the service is. Spiky or idle traffic favors serverless. Steady, high traffic favors containers. Do the math before you choose.
The billing formula
cost ≈ invocations × price per invocation
+ GB-seconds × price per GB-second
(+ provisioned concurrency × time, if you use it)GB-seconds are memory in GB multiplied by duration in seconds. The rest is counting.
Worked crossover at 5 requests per second
Take an API that averages 5 requests per second all month. Each request takes 100 ms on Lambda with 1 GB of memory. This sketch ignores free tiers and data transfer.
Invocations per month ≈ 5 × 86,400 × 30 = 12,960,000
Request charges ≈ 13 × $0.20 ≈ $2.60
GB-seconds per month ≈ 12,960,000 × 0.1 s × 1 GB = 1,296,000
Compute charges ≈ 1,296,000 × $0.0000167 ≈ $21.64
Lambda total (ballpark) ≈ $24.20 per monthThe prices are rough public list prices, as of 2025–2026. Check current numbers before you budget.
For comparison, one small always-on container at 1 vCPU and 1 GB, running all month, costs roughly $30 to $50 or more. That is before extra replicas for high availability. At 5 requests per second, the two options are in the same range. The traffic shape decides it. Serverless wins when traffic is bursty and idle much of the time, because it scales to zero.
Now raise the load to 500 requests per second with the same request time:
GB-seconds per month ≈ 100 × 1,296,000 = 129,600,000
Compute charges ≈ 129,600,000 × $0.0000167 ≈ $2,160 per monthAt steady high volume, a small set of warm containers with an autoscaler is usually cheaper. It also puts less load on the database.
Tip
A rule of thumb: spiky or low average use favors serverless. High steady use favors containers with an autoscaler. Revisit the decision each quarter with your FinOps numbers.
Common mistakes
- Forgetting what the sketch leaves out. Free tiers, data transfer and logging all add cost in a real budget.
- Pricing a container at one replica. High availability needs more.
- Trusting old prices. Check the current price list before you decide.
Check yourself
- At 5 requests per second, which option is cheaper? Answer: they are close. Lambda is about $24 a month, and one small container is about $30 to $50. Traffic shape decides it.
- Why does 500 requests per second cost so much more on Lambda? Answer: GB-seconds grow with total busy time. A hundred times the traffic means about a hundred times the compute cost.
Key takeaways
- Serverless cost is requests plus GB-seconds.
- Spiky or idle traffic favors serverless. Steady, high traffic favors containers.
- Compute GB-seconds before you choose, and recheck the choice each quarter.
- Return to the serverless overview for the full decision checklist.
Further learning
AWS Lambda pricingAWS Lambda PricingAmazon Web Services, Inc. Cloud Run pricingGoogle Cloud
Related
Serverless and managed runtimes
Lambda, Cloud Run and friends - what you give up, what you gain and the cost crossover versus always-on containers.
Cloud cost and FinOps
Where cloud money goes, the levers that usually cut a bill, and how engineers own unit cost without waiting for a finance spreadsheet. Start here for the map of cost pages.
Kubernetes in production
Requests and limits, probes, autoscaling, disruption budgets, packaging and the mistakes that cause outages.