Lambda waste check

Over Provisioned Lambda

over_provisioned_lambda

Medium riskAir-Gapped and onlineValidation L2In the local scan

What it finds

Finds Lambda functions given far more memory than they use, which multiplies the cost of every run.

One of the Lambda checks, in the serverless optimization group.

How it is detected

Memory of 512 MB or more with average duration under 500 ms over 30 days

Detection confidence: MEDIUM. This is the criterion from our public docs. It runs in a local scan with your own read-only credentials.

Signal
CloudWatch Duration and Invocations for the function (AWS/Lambda), with its configured memory from ListFunctions
Statistic
Average of Duration and Sum of Invocations
Threshold
Memory of 512 MB or more with an average duration under 500 ms. A function with no invocations is judged by the unused check instead.
Window
30 days
Monthly figure
The GB-seconds billed at the current memory minus the GB-seconds at half that memory, over the window's invocations, priced at the Lambda per-GB-second rate.
How to fix
Lower the memory setting after testing the function at the smaller size, for example with AWS Lambda Power Tuning, since less memory also means less CPU.

AWS's own tools

AWS flags this too, under "AWS Lambda over-provisioned functions for memory size".

Checked against the AWS documentation.

Run it yourself

Nothing leaves your machine unless you choose to share a summary at the end.