TalksAWS re:Invent 2025 - The bill shock that taught me cost optimization (DEV208)

AWS re:Invent 2025 - The bill shock that taught me cost optimization (DEV208)

AWS re:Invent 2025 - The Bill Shock That Taught Me Cost Optimization

Startup Culture and the Cost Optimization Journey

  • Rejoice, a technical lead at a fintech startup in South Africa, shares her experience with a "bill shock" that led her to optimize AWS Lambda costs.
  • In the startup world, the focus is on velocity, lean teams, and shipping features quickly (MVP1, MVP2, etc.), often without proper architectural planning.
  • Rejoice's company had a single Lambda function performing sentiment analysis on Amazon Connect call center data, costing $86.67 per day.

Understanding Lambda Pricing Drivers

  • The three key drivers of Lambda function cost are:
    1. Memory configuration: How much memory is allocated to the function.
    2. Function size: The size of the Lambda function code.
    3. Number of invocations: Lambda bills per millisecond of execution time.
  • The critical issue was that the Lambda function was "idle" while waiting for other services (Comprehend, Transcribe), still incurring charges.

Right-Sizing Lambda Functions

  • A quiz demonstrates that larger memory configurations don't always mean higher costs - it depends on the execution time.
  • The AWS Lambda Power Tuning tool helps identify the optimal memory configuration by providing performance and cost data.
  • Examples show how increasing memory can decrease execution time and overall cost, highlighting the importance of right-sizing.

Optimizing Lambda Logging

  • AWS introduced tiered pricing for Lambda logs, where the more you log, the cheaper the cost per GB.
  • Recommendations:
    • Be realistic about log retention periods (e.g., dev 7-14 days, staging 30 days, production 3-12 months).
    • Use the new feature to send logs directly to S3 or Amazon Data Firewall for long-term storage.
    • Log only key identifiers, not entire payloads, to reduce log size and cost.

The Impact of Cost Optimization

  • By breaking the monolithic Lambda function into smaller, more focused functions (transcriber, sentiment, storage), the team was able to reduce the cost from $8,667 per day to less than $2 per day - a 97.7% decrease.
  • This translated to an annual cost reduction from over $31,600 to just $730 for that single function.
  • The significant savings allowed the company to focus on other costs and services without the burden of the excessive Lambda bill.

Actionable Recommendations

  1. Audit your Lambda functions and analyze the costs in AWS Cost Explorer.
  2. Use the AWS Lambda Power Tuning tool to optimize memory configurations.
  3. Set up cost alerts and budgets to avoid unexpected spikes.
  4. Optimize Lambda logging by retaining only necessary logs and leveraging features like log archiving to S3.

The key takeaway is that even in a startup environment with a focus on speed and shipping features, taking the time to understand and optimize Lambda costs can lead to substantial savings and a healthier overall cloud spend.

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.