144. Lambda Billing Changes, Cold Start Costs, and Log Savings: What You Need to Know
Summary
TLDRIn this episode of AWS Bites, Eoin and Luciano discuss recent updates to AWS Lambda's cost model, focusing on cost reductions and new changes. They explore the introduction of billing for Lambda's initialization phase, which was previously free, and the potential impact of this on businesses. The episode also covers changes to CloudWatch log pricing, including new tiered pricing and log destinations, such as S3 and Firehose, to optimize costs. Lastly, the hosts offer practical tips for reducing Lambda and logging costs, including efficient log retention and filtering.
Takeaways
- 😀 AWS offers multiple cost-saving options for Lambda, including tiered pricing, compute savings plans, and provisioned concurrency.
- 😀 You only pay for Lambda's cold start (init phase) when using custom runtimes, container image packaging, or provisioned concurrency.
- 😀 AWS has introduced billing for the init phase of Lambda functions for managed runtimes like Python, Node.js, Java, .NET, and Ruby.
- 😀 The cold start or init phase allows you to load AWS clients, secrets, and resources before processing events, but can also be exploited for free compute.
- 😀 Starting from May 2025, AWS has added a tiered pricing model for CloudWatch logs, offering discounts for high-volume log usage.
- 😀 New CloudWatch log destination options now include S3 and Firehose, which could reduce costs for customers transitioning logs to other services.
- 😀 If you have large-scale Lambda usage, consider exploring custom runtimes like Rust, Go, or C++ to reduce cold start duration and optimize performance.
- 😀 Using custom runtimes with compiled languages like Rust or C++ can reduce cold start duration and save on Lambda costs in some cases.
- 😀 Lambda log retention should be set to reasonable durations to avoid unnecessary costs, as logs can quickly accumulate and become expensive.
- 😀 AWS Power Tools for Lambda and advanced logging controls can help reduce costs by filtering out unnecessary or verbose logs like debug-level messages.
Q & A
What are the main cost factors for AWS Lambda?
-The main cost factors for AWS Lambda are the number of requests made and the execution duration. The execution time is billed in one millisecond increments, and the cost is proportional to the amount of memory allocated to the function.
How does AWS Lambda's tiered pricing work?
-AWS Lambda's tiered pricing, introduced in 2022, allows users to save up to 20% if they have high volumes of Lambda usage. This pricing structure is designed to provide better cost savings for those who regularly use Lambda.
What is the 'init phase' in AWS Lambda, and how does it affect cost?
-The 'init phase' is the initialization time Lambda functions take to load the runtime and handler code before processing a request. Until recently, this phase was not billed, but AWS now charges for it to prevent misuse, especially for tasks like number crunching or other non-standard uses.
What impact does the billing of the init phase have on users?
-For most users, the impact of billing the init phase will be minimal, as the init phase is usually very short compared to the execution phase. However, in some cases with a high number of cold starts or long init durations, users may see an increase in costs.
What are the benefits of using custom runtimes for Lambda?
-Custom runtimes, such as Rust, C++, and Go, can potentially reduce cold start times, leading to lower latency and improved performance. Additionally, compiled languages like these generally have a lower carbon footprint compared to other languages.
How has AWS changed CloudWatch logs pricing?
-AWS introduced tiered pricing for CloudWatch logs in May 2025. For accounts with over 10 terabytes of logs per month, pricing is reduced to 25 cents per gigabyte for standard access and 15 cents for infrequent access. There are additional lower rates for users with even larger volumes of logs.
What are some alternatives to CloudWatch for storing Lambda logs?
-AWS now allows Lambda logs to be sent directly to S3 or Firehose, providing users with more flexible and cost-effective storage options, especially for those who already have processes in place to handle log data from CloudWatch.
What are the potential costs associated with using S3 and Firehose for Lambda logs?
-Using S3 and Firehose for Lambda logs incurs a cost of up to $0.25 per gigabyte for log delivery. Additionally, users will incur costs associated with the S3 and Firehose services themselves, depending on their usage.
What are some strategies for reducing Lambda log costs?
-To reduce Lambda log costs, you can use frequent access storage, set a reasonable log retention period, use advanced logging controls to filter verbose logs, and remove unnecessary debug logs that may have been left behind from development.
How does AWS Bites recommend handling log retention for Lambda logs?
-AWS Bites recommends setting the log retention period to a reasonable value to avoid retaining logs indefinitely. This practice helps reduce unnecessary storage costs and prevents large bills due to log accumulation over time.
Outlines

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowMindmap

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowKeywords

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowHighlights

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowTranscripts

This section is available to paid users only. Please upgrade to access this part.
Upgrade NowBrowse More Related Video

AWS Cloud Economics | AWS Tutorial For Beginners | Simplilearn

Basics of Your AWS Bill and Cost Explorer | AWS Tutorial for Beginners, with the New UI Experience

Module 2 - Section 1 : Fundamentals of Pricing

Introduction to AWS Lambda - Serverless Compute on Amazon Web Services

AWS Glue 5.0 Announced: What's New and Why You Should Upgrade

AWS Batch on EKS
5.0 / 5 (0 votes)