FunctionPriceBook

The hidden costs of serverless

By Editorial team · 2026-04-08

In short: The per-request fee is the smallest part of a serverless bill. The hidden costs are egress (~$0.09/GB on hyperscalers, $0 on Cloudflare), API Gateway and NAT Gateway charges on AWS, GB-seconds inflated by over-provisioned memory and slow I/O wait, and platform minimums ($5/mo Workers Paid, $20/seat Vercel Pro). Right-size memory, watch egress, and prefer CPU-time billing for I/O-bound code.

Serverless marketing leads with “pay only for what you use” and a tiny per-request price. Then the bill arrives and it’s nothing like the headline rate. Here’s where the money actually goes.

1. GB-seconds from over-provisioned memory

The biggest line on most serverless bills is GB-seconds = requests × duration × memory. Allocate 1 GB when 256 MB would do, and you’ve quadrupled your compute cost for nothing. Right-sizing memory is the single highest-leverage optimisation — see the cheapest-per-GB-second ranking.

2. Egress

PlatformEgress
Cloudflare Workers$0
AWS Lambda~$0.09/GB after 100 GB free
Google Cloud Runtiered, billed separately
Vercel$0.06/GB Fast Origin Transfer

Snapshot captured June 2026. For a content- or API-heavy app, egress can exceed compute. Cloudflare’s zero-egress policy is a genuine structural advantage.

3. The AWS extras: API Gateway and NAT Gateway

On AWS, Lambda is often fronted by API Gateway (billed per request and per GB) and runs in a VPC behind a NAT Gateway (hourly + per-GB). Neither is in the Lambda price. They routinely double a “cheap” Lambda bill.

4. Platform minimums

Below a certain scale these fixed costs dominate, so the “cheapest per request” platform isn’t always the cheapest overall.

5. Wall-clock vs CPU-time billing

Platforms that bill wall-clock GB-seconds (Lambda, Azure Functions) charge you while the function waits on I/O. Platforms that bill CPU time (Cloudflare Workers, Vercel active CPU) don’t. For I/O-bound endpoints that’s a large, invisible difference. See cold starts and pricing models.

Bottom line

Model the whole bill, not the sticker rate. Estimate yours with the calculator, and read when serverless is cheaper than a VPS before assuming serverless is always the cheap option.

Frequently asked questions

Why is my serverless bill higher than the per-request price suggested?

Because requests are rarely the biggest line. GB-seconds (memory × duration) usually dominate, and egress, API Gateway, NAT Gateway and platform minimums pile on top. A function billed at $0.20/1M requests can still cost far more in GB-seconds and ~$0.09/GB egress.

How do I reduce serverless costs?

Lower memory to the smallest size that still performs (GB-seconds scale linearly with memory), shorten duration, cut cold paths, and move egress-heavy workloads to a platform that doesn't charge for egress (like Cloudflare Workers). On AWS, watch API Gateway and NAT Gateway charges, which are billed separately from Lambda.

Related articles

Last updated: 2026-04-08