Guide · Cost Control
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.
Runaway functions should trip Cost Optimization alerts and Reliability timeouts. Primary control: Cost Optimization
Invocations don't ask permission
Lambda bills invocations × duration (and memory). Spikes usually mean recursive triggers, chatty event fans, oversized memory, or real growth with no concurrency cap—not mysterious AWS pricing. One team wrote S3 from a function that was itself triggered by S3 uploads; the weekend loop minted millions of invocations and a ~$15k invoice. Self-trigger guards and invocation alarms would have stopped it Saturday morning.
Find the hot function, then choke it
CloudWatch: Invocations, Duration, Errors by function name. Trace EventBridge/S3/API Gateway sources for cascades; X-Ray helps when recursion is subtle. Set reserved concurrency on anything that can fan out. Right-size memory—more RAM is more dollars per ms. Budget alerts at 50%/80%/100% plus an alarm on invocation rate.
Cost gates for serverless
APRF Cost Optimization wants spend ceilings and detection; Infrastructure expects event topologies that can't recurse forever. Fix the loop first, then keep the concurrency and budget alarms.
Next: Cost Optimization
Open the related pillar specification for mandatory checks, artifacts, and pass conditions. Self-attest is optional.
Related
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.