Lambda memory report to tell you if you over provisioned

Returns a report that looks at innvocations as calculates if you are using the correct amount of memory or not

Cloudwatch Log Insights snippet that returns a report that shows you the smallest, average and max memory used across innvocations, as well as the amount of memory over provisioned

filter @type = "REPORT"
| stats max(@memorySize / 1000 / 1000) as provisonedMemoryMB,
  min(@maxMemoryUsed / 1000 / 1024) as smallestMemoryRequestMB,
  avg(@maxMemoryUsed / 1024 / 1024) as avgMemoryUsedMB,
  max(@maxMemoryUsed / 1024 / 1024) as maxMemoryUsedMB,
  provisonedMemoryMB - maxMemoryUsedMB as overProvisionedMB
                                


< Back to snippets

GitHub icon View this snippet on GitHub


Running the CloudWatch snippet

Click on the button below to open up the snippet directly into your AWS account.

Manually running the CloudWatch snippet

2. Select Logs, and then choose Logs Insights.
3. In the Select log group(s) drop down, choose one or more log groups to query.
4. Copy snippet into query text area.
5. Click "Run Query"

Created by:

David Boyne

David Boyne

Helping people learn about event-driven architectures and serverless

Follow on LinkedIn