Podcast Summary: AWS Bites – Episode 144
Title: Lambda Billing Changes, Cold Start Costs, and Log Savings: What You Need to Know
Date: May 22, 2025
Hosts: Eoin Shanaghy & Luciano Mammino
Main Theme & Purpose
This episode focuses on the recent changes to AWS Lambda billing, particularly around cold start (INIT phase) costs, updates to logging cost structures, and practical recommendations for saving on AWS bills. Eoin and Luciano break down how these changes impact day-to-day development, discuss opportunities to optimize AWS spend, and provide insights into smarter logging strategies. The tone is practical, occasionally technical, and full of actionable advice.
Key Discussion Points & Insights
1. Introduction to Lambda Cost Models
-
Lambda Cost Structure:
- You pay for the number of requests (smaller component) and execution duration, billed in tiny 1ms chunks.
- Cost is proportional to allocated memory.
- Savings plans (compute and year-based) can provide discounts:
- Up to 20% with year pricing (for high volumes),
- Up to 12% with compute savings plans.
- Provisioned concurrency offers lower rates than on-demand.
-
Cold Start (INIT Phase) Explained:
- The INIT phase is the time Lambda spends loading the runtime and your handler code before invoking the function.
- Previously, init duration was not billed for AWS’s managed runtimes (Python, Node.js, Java, .NET, Ruby).
- “Those using custom runtimes or container image packaging never had this free INIT phase.” (A, 01:40)
- During INIT, you always get 2 vCPUs, regardless of memory, which is a performance boost.
- INIT phase timeout is 10 seconds, after which the function times out and gets retried.
Memorable Quote
“For a long time there has been a bit of a free lunch when it comes to lambda billing...the cold start duration, also known as the INIT phase.”
— Eoin Shanaghy [00:48]
2. AWS’s Response: Billing the INIT Phase
- Problem:
- Developers could exploit the unbilled INIT phase for “free compute,” e.g., putting heavy work in INIT and forcing re-initialization.
- Change:
- As of now, AWS bills the INIT phase for managed runtimes, closing this loophole and making billing consistent.
- This extra charge now affects all Lambda users equally, regardless of runtime.
Notable Explanations
“You can imagine that people could do all sorts of nasty things or maybe just use it as free compute...”
— Luciano Mammino [03:18]
- Impact:
- For most legitimate use cases, the impact will be minimal.
- Only users with very high cold start rates or unusual init-to-execution ratios may notice significant cost increases.
- For performance-sensitive cases or high-throughput APIs, compiling to Rust/C/Go may make sense for both speed and lower INIT phase costs.
- Carbon Footprint:
- Compiled languages like Rust offer environmental benefits due to increased efficiency.
Notable Quote
“If you're really looking for reducing that cold start, either for cost reasons or maybe because you have like APIs that are running in lambda…using languages like Rust C or Go can make a little bit of a difference.”
— Luciano Mammino [06:18]
3. Lambda Logging Cost Reductions and Changes
-
Old Situation:
- CloudWatch Logs used to be the only option: $0.50/GB for collection, ~$0.03/GB for storage.
- AWS added an infrequent access tier later, reducing storage by 50%.
-
New Pricing Update (Effective May 2025):
- Tiered Pricing:
- Over 10TB/month/account: $0.25/GB (standard) or $0.15/GB (infrequent).
- Additional tiers for higher usage, as low as $0.05/GB over 50TB, for either storage class.
- Limitation:
- High thresholds mean most savings benefit large-scale users.
- Tiered Pricing:
Quote
“If you've got a massive CloudWatch logs bill because of your extensive use of Lambda, it can make a big difference.”
— Eoin Shanaghy [08:20]
Resource
- Eric Pullen (Duckbill Group) shared an article & calculator script for estimating savings.
4. New Log Destinations for Lambda
- Now Possible:
- Send Lambda logs directly to S3 or Firehose, not just CloudWatch.
- Useful for teams who process logs with third-party tools or rarely read from CloudWatch directly.
- Reduces double handling (“CloudWatch as a transition store”) and can cut costs and complexity.
Details & Caveats:
- Log delivery is not free: up to $0.25/GB to S3 or Firehose; you still pay S3/Firehose storage costs.
- More options for integration and observability; architecture can be simplified.
Quote
“Now you can skip all of that cost and maybe use Firehose to send the data directly to…your final storage to consume the logs. And this is generally something that can happen if you use, for instance, third party tools for observability.”
— Luciano Mammino [09:51]
5. Practical Tips for Reducing Lambda and Log Costs
[10:51]
-
Use Infrequent Access for Logs:
- Set this as the default; compatible with Logs Insights searches.
- Some limitations: no Live Tail, embedded metrics, or metric filters.
-
Set Log Retention Periods:
- Do not retain logs indefinitely; set appropriate time windows to prevent accumulating unnecessary costs.
-
Leverage Advanced Logging Controls:
- Lambda now supports built-in filtering (e.g., omit debug logs).
- Power tools allow debug log sampling.
-
Clean Up Old Debug Logs:
- Remove verbose logs after development.
- Real-world horror stories of accidentally racking up thousands in unnecessary logging costs.
Notable Quote
“I've heard stories from people who… discovered that they were paying thousands every month for logs that say ‘I'm here on line 23’ and that was put in for debug logging during feature development…”
— Eoin Shanaghy [11:52]
Notable Quotes & Timestamps
- [00:48] Eoin: “For a long time there has been a bit of a free lunch when it comes to lambda billing...the cold start duration, also known as the INIT phase.”
- [03:18] Luciano: “You can imagine that people could do all sorts of nasty things or maybe just use it as free compute...”
- [06:18] Luciano: “If you're really looking for reducing that cold start, either for cost reasons or maybe because you have like APIs that are running in lambda…using languages like Rust C or Go can make a little bit of a difference.”
- [08:20] Eoin: “If you've got a massive CloudWatch logs bill because of your extensive use of Lambda, it can make a big difference.”
- [09:51] Luciano: “Now you can skip all of that cost and maybe use Firehose to send the data directly to…your final storage to consume the logs…”
- [11:52] Eoin: “I've heard stories from people who… discovered that they were paying thousands every month for logs that say 'I'm here on line 23’...”
Conclusion
The episode provides a clear, actionable overview of evolving AWS Lambda billing, especially regarding the new INIT phase charges and tiered log pricing. The hosts stress the importance of regularly revisiting serverless cost strategies and offer practical steps for optimizing log-related spend. Advanced users may want to explore compiled runtimes for further optimizations. Above all, the key lesson is to be proactive with AWS cost management and take advantage of new features and optimizations as they’re released.
If these changes impact your AWS usage, or if you have additional tips, the hosts invite you to share your feedback and stories for future episodes.
