AWS cost · Lambda
Is Lambda expensive? What you actually pay for
Lambda has a reputation for being cheap right up until the bill says otherwise. Both halves are true. For event-driven work it is genuinely cheap - you pay only while code runs, and the free tier is large enough that small workloads cost nothing. Where it turns expensive is subtle: the cost is requests times duration times memory, and that middle-and-last part is where a single careless setting multiplies across millions of invocations. A function with double the memory it needs is not a little wasteful. It is paying double, every time it runs, forever.
Lambda costs $0.20 per million requests plus $0.0000166667 per GB-second of compute (20% less on arm64), with 1M requests and 400,000 GB-seconds free every month. Cost scales with memory times duration, so the biggest leak is untuned memory. Tune it, switch to arm64, and cut duration - the rate is rarely the problem.
What do you actually pay for with Lambda?
Requests plus compute, with a free tier that never expires (us-east-1):
| Part | Rate | Unit |
|---|---|---|
| Requests | $0.20 | per 1M requests |
| Compute (x86) | $0.0000166667 | per GB-second |
| Compute (arm64) | 20% less | per GB-second |
| Free tier (never expires) | 1M req + 400k GB-s | every month |
Why is memory the setting that matters?
Because Lambda bills memory times duration, and it ties CPU to memory. Set the memory too high and every invocation pays for capacity it never uses. Set it too low and the function runs slower on weaker CPU, so it pays in duration instead. Neither extreme is obvious from the outside - the function works either way - which is why so many run for years at whatever number someone typed at the start. The right memory is the one where cost bottoms out, and it is rarely the default.
How do I cut a Lambda bill?
Tune memory to each function's sweet spot, switch to arm64 for 20% off the compute rate, and trim duration. Start by seeing where the memory is set today - the functions defined at 1 GB and above, running often, are where tuning pays off first:
# every function with its memory and architecture
aws lambda list-functions \
--query 'Functions[].{Name:FunctionName,MemoryMB:MemorySize,Arch:Architectures[0]}' \
--output tableThe arm64 switch is the same Graviton 20% discount that applies to EC2, and if your data layer is DynamoDB, the mode it runs in is its own cost decision.
Want to know if your Lambda bill is untuned memory or genuine volume? Connect your account read-only and see what it is wasting, in real dollars.
The role can only read - Get, Describe, List, nothing else. Read the exact permissions before you deploy it, and delete the stack whenever you want.
Frequently asked questions
Is AWS Lambda expensive?+
For event-driven and spiky workloads, Lambda is usually cheap - you pay only while code runs, and a generous free tier covers small usage. It gets expensive in two cases: very high, steady traffic where a container would be cheaper, and functions with over-allocated memory that inflates every single invocation.
How is Lambda priced?+
Three parts: $0.20 per million requests, plus compute at $0.0000166667 per GB-second on x86 (20% less on arm64), plus a free tier of 1 million requests and 400,000 GB-seconds every month that never expires. A GB-second is one second of runtime at 1 GB of memory, so cost scales with memory times duration.
What is a GB-second in Lambda pricing?+
It is the unit Lambda bills compute in: one second of execution at one gigabyte of allocated memory. A function with 512 MB running for 2 seconds uses 1 GB-second. Because memory is half the equation, the memory you set on a function directly scales what every invocation costs.
Does more Lambda memory always cost more?+
Not necessarily, and this is the trap in both directions. Lambda scales CPU with memory, so a function starved of memory can run slowly and rack up duration, while more memory can finish faster and cost the same or less. The point is to tune it - the wrong memory setting, too low or too high, is the most common Lambda waste.
How do I reduce Lambda costs?+
Tune each function's memory to its actual sweet spot rather than leaving it at a guess, switch functions to arm64 for 20% off the compute rate, and cut duration by removing slow cold-path work. For steady, high-volume functions, a Compute Savings Plan covers Lambda too.
Is Lambda cheaper than running a server?+
For bursty or low-volume work, almost always - you pay nothing when it is idle, versus a server billing 24/7. For constant high throughput, a well-utilized container or EC2 instance can be cheaper per unit of work. The break-even is about how busy the workload is: idle time favors Lambda, constant load favors a server.
Related cost breakdowns
Why EKS is expensive: the $73/month control plane
Every EKS cluster bills $0.10/hour - about $73/month - for the control plane before a single node runs, and $0.60/hour once it falls out of standard support. Idle and forgotten clusters are pure waste.
Why your stopped EC2 instance is still being charged
A stopped EC2 instance keeps billing for its attached EBS disk and any Elastic IP. One 8 GB volume quietly cost me ~$70 over six years. Here is what still charges when an instance is off.
Spot instances: what is safe to run on them, and what is not
Spot instances are up to 90% cheaper than on-demand - I moved almost everything to spot. The catch is a 2-minute interruption notice. Here is what is safe to run on spot and what is not.
Graviton (ARM) is ~20% cheaper than x86 for the same work
AWS Graviton instances cost about 20% less than comparable x86 at equal or better performance, and arm64 Lambda is a one-dropdown switch. Here is how to find migration candidates.