# Overprovisioned Memory Allocation for Lambda Functions

Canonical: https://www.pointfive.co/efficiency-hub/inefficiencies/overprovisioned-memory-allocation-for-lambda-functions

[Cloud Efficiency Hub](https://www.pointfive.co/efficiency-hub) 

# Overprovisioned Memory Allocation for Lambda Functions

## Explanation

Each Lambda function must be configured with a memory setting, which indirectly controls the amount of CPU and networking performance allocated. In many environments, memory settings are defined arbitrarily or left unchanged as functions evolve. Over time, this leads to overprovisioning - with functions running well below their allocated memory and incurring unnecessary compute costs. Systematic right-sizing using performance benchmarks can significantly reduce spend without sacrificing performance or reliability. This is especially important for frequently invoked functions or those with long execution times.

## Relevant Billing Model

Lambda is billed based on:

- Number of invocations

- Duration (ms) x memory size (MB)

- Larger memory settings increase vCPU and I/O, but also cost more per millisecond

Overprovisioning memory leads to unnecessary cost without meaningful performance improvement, especially if functions complete within modest CPU and memory bounds.

## Detection

- Analyze memory usage metrics for Lambda functions to identify consistently low utilization

- Use performance profiling (e.g., Lambda Power Tuning) to model cost vs. performance tradeoffs

- Check for functions using default or inherited memory values without workload-specific tuning

- Look for functions with high invocation volume and long durations to prioritize optimization impact

## Remediation

- Use tools like AWS Lambda Power Tuning to benchmark and optimize memory and vCPU settings

- Incorporate right-sizing into CI/CD workflows to evaluate configuration during deployment

- Apply consistent tagging or governance to track functions requiring periodic review

- Consider automated tuning pipelines for environments with frequent code changes or dynamic usage patterns

## Relevant Documentation

- [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning)

- [Lambda Resource Configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html)

[Submit Feedback](https://hub.pointfive.co/inefficiencies/overprovisioned-memory-allocation-for-lambda-functions)

## At a glance

Reference

CER-0103

Cloud provider

AWS

Service

AWS Lambda

Category

[Compute](https://www.pointfive.co/efficiency-hub/service-category/compute)

Inefficiency type

Overprovisioned Resource

## Contributed by

- Shireen Maini 

### Shireen Maini

DevOps Team Lead @ BroadPeak Partners

[LinkedIn](https://www.linkedin.com/in/shireen-maini/)

---
Source: the public page above. Product screenshots and illustrative interfaces are examples, not live customer data.

