AWS Underutilized Lambda Function

Rule Description

Rule Code: AWS-Lambda-01

Ensure that your Amazon Lambda function is optimized with memory allocation.

There are many ways to optimize Lambda functions, but one of the most important choices is memory allocation. You can choose between 128 MB and 3008 MB, but this also impacts the amount of virtual CPU as memory increases. Since total cost is a combination of memory and duration, choosing more memory can often reduce duration and lower overall cost.

Audit / Verification

Step 01. Sign in to AWS Management Console. Navigate to Lambda dashboard that you need to check.

AWS Console login

Step 02: In Function section, check the function list and corresponding ARN

Step 03: Start power tuner with Lambda ARN and analyze the result

For example, this is what the results look like for two CPU-intensive functions, which become cheaper AND faster with more power:
How to interpret the chart above: execution time goes from 2.4s with 128MB to 300ms with 1GB, for the very same average cost.

Step 04: Change the other Lambda from the function list and repeat the audit process for other function.