Skip to main content
ZapStack
Icon-Architecture/48/Arch_AWS-Lambda_48 Serverless

AWS Lambda Cost Optimization

Lambda pricing is based on invocations, duration, and memory allocated. The most common waste pattern is over-allocating memory because it is the only knob you can turn. Functions provisioned with 1GB of memory that only use 200MB are paying 5x more than necessary per millisecond of execution.

Common Lambda cost waste patterns

high impact

Over-allocated memory

Lambda charges per GB-second. Functions provisioned with more memory than they use are paying for unused capacity on every single invocation.

medium impact

Excessive Provisioned Concurrency

Provisioned Concurrency eliminates cold starts but charges you whether invocations happen or not. Over-provisioning means paying for idle capacity.

medium impact

Unoptimized function duration

Functions that take longer than necessary due to inefficient code, synchronous waits, or unnecessary SDK initialization inside the handler.

low impact

Unused functions still deployed

Old functions from experiments, migrations, or deprecated features that are still deployed and occasionally invoked by forgotten event sources.

How to reduce your Lambda costs

1

Right-size memory allocation

Save 20-50% medium

Use CloudWatch Logs Insights to check actual memory used vs. allocated. Tools like AWS Lambda Power Tuning can test your function at various memory sizes to find the optimal price-performance point.

2

Review Provisioned Concurrency settings

Save 30-60% easy

Check CloudWatch metrics for actual concurrent executions vs. provisioned amount. Scale down Provisioned Concurrency to match peak usage with a small buffer.

3

Optimize function cold starts

Save 10-30% advanced

Move SDK client initialization outside the handler function, minimize package size, and consider Graviton (arm64) runtime for better price-performance.

4

Clean up unused functions

Save 5-15% easy

Identify functions with zero invocations over the past 30 days. Remove them along with their event source mappings, CloudWatch log groups, and IAM roles.

How ZapStack finds Lambda waste

ZapStack automatically scans your AWS environment and surfaces Lambda cost savings you can action immediately.

  • Detects over-allocated Lambda memory vs. actual usage
  • Identifies unused functions with zero invocations
  • Flags excessive Provisioned Concurrency
  • Calculates per-function cost and savings potential
  • Recommends Graviton runtime for cost reduction

Frequently asked questions about Lambda costs

How much are you overspending?

Find out in less than 5 minutes. No credit card, no commitment.