Introduction
On November 19, 2026, AWS doubled the maximum timeout for on-demand Lambda Event Functions (previously known simply as Lambda Functions) from 15 to 30 minutes (announcement). Anyone would read that and think: great, longer jobs can run on Lambda Functions now. That was my first thought too. Then a second question hit me: if we suddenly have twice the time, are we still paying for speed we no longer need?
Here's what I mean. With Lambda Functions, a function with more resources usually runs faster, but it also costs more. When a job crept toward the 15-minute limit, a common quick fix was to give the function more resources so it finished in time. Now that the limit is 30 minutes, could those functions run on fewer resources and cost less? And more broadly, with this much more room on the timeout, how should we think about sizing our functions from now on?
To find out, I dug into AWS's pricing, its own benchmarks, and recent independent measurements. The answer is more interesting than yes or no: the same change, running a Lambda Function on fewer resources, reduce costs, save nothing, or make it more expensive. It all depends on what your function spends its time doing.
In this post, I'll start by covering three basics of running Lambda Functions (resources, pricing, and the time limit). Then I'll share how I used to handle the old 15-minute limit. After that comes the heart of the matter: where fewer resources save money, where they don't, and where they cost you more. Finally, I'll share a simple test to help you decide whether fewer resources are worth it for your own functions.
The basics: resources, pricing, and the time limit
Let's start with three ideas that make the rest of this post easy to follow, even if you've never worked with Lambda Functions before.
How resources are configured: you set the memory, the CPU follows
Unlike a regular server, a Lambda Function has no CPU setting. Instead, CPU comes with memory: the more memory you give it, the more CPU it gets (memory docs).
| Memory | CPU you get | What it means |
|---|---|---|
| Below 1,769 MB | A fraction of one vCPU, in proportion to memory | Double the memory, double the CPU: work runs about twice as fast |
| 1,769 MB | One full vCPU | The most a single-threaded function can use |
| 1,769 to 10,240 MB | Extra cores, up to 6 vCPUs (AWS News Blog) | Only multi-threaded code gets faster; single-threaded code just costs more |
That's why giving a function more memory often makes it faster, even when it never uses the extra RAM.
How Lambda Event Functions are priced: you pay for memory × time
Lambda Event Functions are billed by the GB-second: one gigabyte of memory held for one second (pricing).
Think of it like renting a room, priced by size and by the hour. A bigger room costs more per hour, and keeping it longer costs more in total. And you pay for the room you reserved, even if you only use one corner of it.
What you pay for is the product of memory and duration, not either number alone:
| Memory | Duration | GB-seconds (memory × duration) | Cost per 1,000 runs (EU Ireland) |
|---|---|---|---|
| 1 GB | 10 s | 10 | $0.17 |
| 2 GB | 5 s | 10 | $0.17 |
| 512 MB | 20 s | 10 | $0.17 |
| 4 GB | 10 s | 40 | $0.67 |
The first three rows mix memory and time differently, but they cost exactly the same. The last one costs four times as much.
How long a function can run: you set the timeout, up to a hard ceiling
Every function also has a timeout: if it's still running when the timeout hits, it gets stopped. Until November 19, 2026, the highest timeout you could set was 15 minutes, and that limit shaped how we all designed our functions.
How I used to beat the 15-minute limit, and what it really cost
Whenever I built a new Lambda Function, I sized it for the job: enough memory for the work, and a timeout with room to spare. But jobs can grow and loads can change: a function that finishes in 4 minutes in its first weeks can creep toward 15 as its workload grows. When one got close to the 15-minute limit, or went past it, I had three kinds of fixes to choose from.
The fixes I had: redesign, optimize, or add memory
- Structural fixes: rethink whether one Lambda Function should handle the whole job, split the work across several functions orchestrated with a workflow service like AWS Step Functions, or move it to a container-based service with Amazon ECS.
- Code fixes: make the function itself faster, for example by profiling it, using a more efficient algorithm, running independent calls in parallel, or batching requests.
- Resource fixes, the quick one: give the function more memory, so it gets more CPU, runs faster, and finishes under the limit.
Structural and code fixes take time to design, build, and test, so the quick fix was often the pragmatic first step. It works in some cases, not in others. Which case you're in depends on what the function is actually doing while the clock runs.
Working vs waiting: when the quick fix pays off, and when it backfires
A function spends its time in one of two states:
- Working (CPU-bound): the processor is busy, so a faster CPU finishes sooner.
- Waiting (I/O-bound): it depends on something outside it, like an API call, a database query, or an S3 upload, so a faster CPU barely helps.
Picture a kitchen. A skilled chef chops a mountain of vegetables faster, but doesn't make the delivery truck arrive any sooner.
And here's the key point: Lambda Event Functions bill wall-clock time, not CPU time. In other words, a second spent waiting costs exactly as much as a second spent working.
You can see this clearly in real measurements:
In the top diagram, the function is working, so the extra memory bought time at no extra cost.
In the bottom diagram, it's waiting on a download, so the extra memory bought nothing and multiplied the bill: download speed stayed flat at about 620 Mbps.
So for a job that mostly waits, the quick fix can't help: you need a structural or code fix instead.
Mixed jobs: the quick fix works, but at a price
To make this concrete, let's follow one example through the rest of this post: a nightly report, the kind of job almost every team runs. Every night, a Lambda Function:
- Calls external APIs to fetch the day's data. These APIs are slow and rate-limited, so most of this step is waiting.
- Processes the data and builds the report. That's working.
- Uploads the report to S3. Waiting again.
A single Lambda Function is a common, sensible home for a job like this while it's small.
Now, if you give this function more memory, only the working part gets shorter. The waiting part stays exactly the same:
For jobs that mix working and waiting, extra memory often does the trick, but at a price: the higher rate also applies to every second of waiting. Looking back now, that's the part I keep thinking about. With twice the time available, can those jobs lower their memory and stop paying that price?
The new opportunity: stop paying for speed you no longer need
With 30 minutes available, a job no longer needs extra CPU just to finish in time. That means any memory that wasn't making the function proportionally faster can go. There are two places to look:
- Time spent waiting, which more memory never speeds up
- Work that can't make full use of extra cores
Waiting time: stop paying the high rate to wait
Let's start with the main one. For a mixed job, lowering memory lets the working part take longer, while the waiting part stays the same. So the saving comes almost entirely from the waiting part:
Back to the nightly report. Say it has grown to spend 9 minutes waiting on external APIs and needs 9 minutes of processing on one full vCPU (1,769 MB of memory). To keep things simple, I'm assuming the code can spread its work across several cores, so the working time depends on memory. At 4 GB (about 2.3 vCPUs) the processing takes about 3.9 minutes, and at 1 GB (about 0.6 vCPU) it takes about 15.5 minutes. Here's what happens when memory drops from 4 GB to 1 GB:
In numbers, using x86 pricing in EU (Ireland):
| Setting | Memory | Runtime | GB-s per run | Cost per 1,000 runs |
|---|---|---|---|---|
| Old: fits under 15 min with headroom | 4,096 MB | 12.9 min | 3,093 | $51.55 |
| New: fits under 30 min with headroom | 1,024 MB | 24.5 min | 1,473 | $24.55 |
That's 52% less. The working part costs about 933 GB-s in both cases, so the entire saving comes from the waiting part: 3 GB removed × 540 s = 1,620 GB-s.
Imperfect multi-core scaling: less memory, about 24% cheaper
The second place to look has nothing to do with waiting. Above 1,769 MB, extra memory buys extra cores, and many workloads can't use them all efficiently.
AWS's own PyTorch inference benchmark found that 5 GB cost the same as 1 GB while running 5x faster. At 10 GB, the function ran 7.6x faster but cost more: about $80 versus $61 per million invocations (AWS News Blog).
Now imagine a batch job that needed 10 GB to finish in 13 minutes. With the same ratios, it would take about 20 minutes at 5 GB: only possible under the new limit, and about 24% cheaper. One honest caveat: AWS measured short runs back in 2020, so I'm assuming the same ratio holds for longer jobs.
Not every function qualifies: when there's nothing to save
Of course, lowering memory isn't a free win. If a function is all work and no waiting, there's nothing to save: as the top diagram in “Extra memory buys time for working, but not for waiting” showed, dropping from 1,024 MB to 128 MB just makes the job 8x slower for the same cost. The idea also doesn't apply in these cases:
- The memory floor. If the job needs the RAM, you can't drop it. And memory needs can vary: a busy night with more data, or a larger input file, may need far more RAM than a typical run. Only lower memory if you're confident about the peak requirement, and check Max Memory Used across your largest runs, not just an average one. Running close to the limit invites garbage-collection slowdowns or out-of-memory errors.
- The free tier. Inside 400,000 GB-s a month, the saving is exactly $0. One 30-minute run at 1 GB uses 1,800 GB-s, so only about 222 such runs fit. In the nightly report example, 100 runs a month are free either way.
- Other compute types. Lambda Managed Instances don't bill per-request duration at all, and Web Functions are billed on active CPU time and stay capped at 15 minutes (pricing).
- Some event sources. Amazon MQ, DocumentDB, and Kafka mappings created before November 19, 2026 (unless in provisioned mode) remain limited to 14 minutes (announcement).
Going lower can backfire: when less memory ends up costing more
This is the part that's easy to miss: lowering memory can make things more expensive, either per run or in ways that never show up as GB-seconds.
A trap behind smaller sizes: the cost curve isn't a straight line
AWS's prime-number benchmark (Operating Lambda, part 2), shown in the top diagram of “Extra memory buys time for working, but not for waiting”, also tested two sizes in between, and both cost more than either end:
Going from 1,024 MB down to 512 MB would have raised the bill by about 9%. Measure, don't assume.
Synchronous callers: your savings, their extra cost
If another Lambda Function calls this one and waits for the answer, the caller is billed too, for every second it waits. So if your function now runs twice as long, the caller's cost doubles as well.
Longer runs: what you pay for outside the bill
Lower memory means longer runs, and longer runs bring costs that never show up as GB-seconds:
- More concurrent executions
- Slower stream processing
- Longer queue timeouts
- More work lost when a job fails late
AWS covers these in the “Considerations and best practices” section of its 30-minute timeout announcement, which is worth reading before you change anything.
How to tell which kind of function you have
So how do you know which kind of function you have? There's a simple way to get a first idea: halve its memory, run it again, and watch how the runtime reacts:
One rerun only points you in the right direction, though. Before changing anything for real, compare a few memory sizes on realistic inputs, including your biggest ones, keep headroom on both time and memory, and weigh the hidden costs of longer runs covered in “Going lower can backfire.”
Conclusion
The 30-minute limit is more than extra runway. It's a good moment to revisit how we size our Lambda Functions:
- Memory buys CPU, not shorter waits. Before adding memory, check where the time actually goes.
- Speed is now a choice, not a constraint. If a function spends much of its time waiting, you can trade a longer run for a smaller bill. If it's all work, there's nothing to trade.
- Measure before you change anything. The cost curve has bumps, and longer runs bring costs that never show up as GB-seconds.
There's a broader lesson here about provisioning: faster isn't automatically better.
- If nobody reads the results of a nightly Lambda Function until morning, a function that takes 25 minutes and costs half as much is the better design, even though "slower" sounds wrong.
- If someone needs the result right away, the faster, pricier setting may be worth every cent.
The rule to remember: you save roughly memory removed × waiting time. Run the quick test before changing anything.
In the end, that's what engineering comes down to. Not the fastest setting, not the cheapest one, but the one that fits your specific need. Understand what your workload actually does, choose for that, and revisit the choice when the rules change, as they just did.
Sources
A quick note on the numbers: the measurements come from AWS and Classmethod, while the nightly report example is a model I built on AWS's published prices.
- Announcing 30-minute timeout for on-demand AWS Lambda Event Functions, AWS Compute Blog, Nov 19, 2026
- Announcing AWS Lambda Web Functions, AWS News Blog (where existing Lambda functions were renamed Event Functions)
- AWS Lambda pricing
- Configure Lambda function memory, AWS docs
- New for AWS Lambda: Functions with up to 10 GB of memory and 6 vCPUs, AWS News Blog, 2020
- Operating Lambda: Performance optimization, part 2, AWS Compute Blog
- AWS Lambda scalable network bandwidth, AWS What's New, Aug 2026
- Raising Lambda's network bandwidth to 3,000 Mbps, measured, Classmethod DevelopersIO, Sep 2026
- Elastic Cloud Forwarder troubleshooting, Elastic docs






