Back to guides

Why Is My AWS Lambda Bill High?

Your Lambda bill spiked. Runaway invocations, high memory, recursive triggers. Here's how to find and fix it.

What this problem means

AWS Lambda charges for invocations and duration. A sudden spike can come from: runaway invocations (loop, recursive trigger), high memory allocation, or simply scaling usage. Without monitoring, you find out when the bill arrives.

Why this is dangerous

- Runaway costs: A recursive trigger can generate millions of invocations in hours.

- No warning: Lambda doesn't cap spend—you pay for what runs.

- Hard to trace: Without CloudWatch, you don't know which function or trigger caused it.

Real-world example

A startup had a Lambda triggered by S3 uploads. The Lambda wrote back to S3, which triggered another Lambda. Recursive loop. Millions of invocations in a weekend. $15,000 bill. They added logic to prevent self-triggers and set up invocation alerts.

How to fix it

1. CloudWatch metrics: Check Invocations, Duration, Errors. Identify which function spiked.

2. Event triggers: Review EventBridge, S3, API Gateway. Look for recursive or cascading triggers.

3. Reserved concurrency: Limit concurrency for critical functions. Prevents runaway scaling.

4. Memory: Right-size memory. Higher memory = higher cost per invocation.

5. Alerts: Set up CloudWatch alarms for invocation spikes. Budget alerts at 50%, 80%, 100%.

Tools and configurations

- CloudWatch: Invocations, Duration, Errors by function.

- AWS X-Ray: Trace invocations and find recursive patterns.

- Reserved concurrency: Limit max concurrent executions.

- Budget alerts: AWS Budgets at 50%, 80%, 100%.

Common mistakes

- Recursive triggers (Lambda writes to S3, S3 triggers Lambda).

- No concurrency limits—runaway scaling.

- No alerts—discovering when the bill arrives.

- Over-provisioned memory.

Quick checklist

- [ ] Check CloudWatch for invocation spikes

- [ ] Review event triggers for recursive patterns

- [ ] Set reserved concurrency for critical functions

- [ ] Right-size memory

- [ ] Set up invocation and budget alerts

Need help with production readiness? Get a free 30-minute audit.

Book Free 30-Min Production Audit

View our DevSecOps services

Check if your system has this risk

Take the 60-second production readiness assessment to identify gaps in your infrastructure.

Start Assessment

Frequently asked questions

Why did my Lambda bill spike?
Common causes: recursive triggers (Lambda triggers itself), runaway event rules, high memory allocation, or scaling usage. Check CloudWatch for invocation spikes.
How do I prevent Lambda recursive triggers?
Avoid Lambda writing to the same S3 bucket or resource that triggers it. Use a different prefix or bucket for output. Add logic to ignore self-generated events.
How do I limit Lambda costs?
Set reserved concurrency to cap scaling. Right-size memory. Set up CloudWatch alarms for invocation spikes. Use budget alerts.