← All posts

aws · lambda · pricing

AWS Lambda Pricing: Where the Bill Actually Comes From

By ·

AWS Lambda pricing has two parts, and only one of them matters for most bills. You pay $0.20 per million requests, and you pay for compute in GB-seconds: the memory you gave the function, in GB, times how long it ran, billed to the millisecond. On x86 in US East that second part is $0.0000166667 per GB-second for the first 6 billion GB-seconds a month. Those are the numbers on AWS’s Lambda pricing page, which we checked on 2026-10-12 against the AWS Price List API.

The free tier covers 1 million requests and 400,000 GB-seconds every month, for the whole account.

A worked example

Take an API backend that gets 20 million requests a month. Each one runs on 1 GB of memory and takes 400 ms on average. That is 8 million GB-seconds. After the free tier:

  • compute: 7.6 million GB-seconds × $0.0000166667 = $126.67
  • requests: 19 million × $0.20 per million = $3.80

So about $130 a month, and 97% of it is compute. People look at the request price, see twenty cents, and think Lambda is nearly free. The request line almost never is the problem.

Now look at what is inside those 400 ms. In a typical API handler maybe 60 to 100 ms is your code doing something. The rest is waiting: for Postgres, for Stripe, for an S3 read, for whatever third-party API the endpoint calls. Lambda bills the waiting exactly like the working. If the same function finished in 100 ms, the bill would be $30.47 instead of $130.47, with the same traffic.

That is the single biggest thing we look for in a Lambda bill. A slow query costs you twice: once in the database and again in every function that sits there waiting for it.

Reading the REPORT line

Every invocation writes a line like this to CloudWatch Logs:

A Lambda REPORT log line annotated: billed duration includes the 412 ms cold start, and 1024 MB is configured while only 87 MB is used

Two fields tell you most of what you need. Billed Duration is what you pay for. Max Memory Used next to Memory Size tells you whether the memory setting means anything. A function configured with 1024 MB that never uses more than 90 MB is a common sight in projects where someone picked a number once and never looked again.

Halving memory does not automatically halve the cost, though. Lambda gives a function CPU in proportion to its memory (the docs explain the scaling), so CPU-heavy code at 512 MB can run twice as long and cost the same. Code that mostly waits on the network is different: it does not get faster with more CPU, so for that kind of function less memory is nearly free money. In our example, 512 MB at the same 400 ms would be $63.80 instead of $130.47. Don’t guess which kind of function you have. AWS Lambda Power Tuning runs it at several memory sizes and plots cost against speed. It takes about ten minutes to set up.

Cold starts are billed now

This one changed recently. Until August 2025, functions packaged as ZIP files on managed runtimes (most Node and Python functions) did not pay for the INIT phase, the time Lambda spends loading your code and running everything outside the handler. Since August 1, 2025 they do. AWS announced it on the Compute blog, and the REPORT line now includes the INIT time inside Billed Duration.

For a busy function this is small. If 2% of those 20 million requests start cold and INIT takes 800 ms, that is 320,000 GB-seconds, about $5.33 a month. Where it hurts is the opposite case: a function that gets a few thousand requests a day, so most of them land on a cold environment, and that loads a big SDK or opens a database connection pool at startup. There the INIT time can be larger than the run time itself. Trimming imports and lazy-loading the heavy client inside the handler helps more than any setting.

Arm is 20% cheaper

Arm (Graviton) costs $0.0000133334 per GB-second, 20% less than x86, and the request price is the same. Our example drops from $130.47 to $105.13 just by switching the architecture. Pure JavaScript or Python functions usually move with a one-line change. Anything with native binaries (sharp, bcrypt, Puppeteer’s Chromium, some database drivers) needs an Arm build in the deployment package first, which is where switches go wrong. Test it on a staging alias before you flip production.

The lines next to Lambda

Lambda rarely shows up alone on the bill, and sometimes its neighbours cost more than it does.

If the function sits behind an API Gateway REST API, those 20 million requests cost $3.50 per million, $70 a month, against Lambda’s $3.80 request line. An HTTP API does most of what people use REST APIs for at $1.00 per million, which is $20 here. Prices from the API Gateway pricing page, checked 2026-10-12.

Logs are the other one. CloudWatch charges $0.50 per GB ingested in the Standard log class. A handler that logs 2 KB of JSON per request writes 40 GB a month at 20 million requests, so $20, every month, for logs nobody reads. Set a retention period on the log group while you are in there; the default keeps everything forever and storage is billed too.

And if your functions run inside a VPC and call the internet through a NAT gateway, that traffic is billed per GB on top of an hourly charge, and for a chatty function that line can end up bigger than the Lambda line itself.

You can put your own numbers into our AWS Lambda pricing calculator, which adds the cold start line and shows the same traffic on the other architecture. If the Lambda part of your AWS bill looks wrong, send us the bill.

Want us to look at your bill?

No upfront fee: for six months you pay half of what we save you each month, then you keep all of it. Nothing saved, nothing owed.