Viewing Lambda function recommendations - AWS Compute Optimizer

Viewing Lambda function recommendations

AWS Compute Optimizer generates memory size recommendations for AWS Lambda functions. Recommendations for your functions are displayed in the following pages of the Compute Optimizer console:

  • The Lambda functions recommendations page lists each of your current functions, their finding classifications, finding reasons, current configured memory, current usage, and current cost. The top recommendation from Compute Optimizer is listed next to each of your functions, and it includes the recommended configured memory, recommended cost, and the price difference between your current function and the recommendation. Note that the recommended cost is a range that is displayed under the Recommended cost (high) and Recommended cost (low) columns in the console. Use the recommendations page to compare your current functions with their top recommendation, which can help you to decide if you should up-size or down-size the configured memory of your function.

  • The Lambda function details page, which you can access from the Lambda function recommendations page, lists the top optimization recommendation for a function. It lists the configuration for your current function and the recommendation option. The details page also displays utilization metric graphs for the current function.

The recommendations are refreshed daily. They're generated by analyzing the specifications and utilization metrics of the current function over a period of the last 14 days. For more information, see Metrics analyzed by AWS Compute Optimizer.

Keep in mind that Compute Optimizer generates recommendations for Lambda functions that meet a specific set of requirements, recommendations could take up to 24 hours to be generated, and sufficient metric data must be accumulated. For more information, see Resource requirements.

Finding classifications

The Finding column on the Lambda functions recommendations page provides a summary of how each of your functions performed during the analyzed period.

The following findings classifications apply to Lambda functions.

Classification Description

Not optimized

A Lambda function is considered not optimized when Compute Optimizer has identified that its configured memory or CPU power (which is proportional to the configured memory) is under-provisioned or over-provisioned. In this case, Compute Optimizer generates a recommendation that can provide better performance or cost for your workload.

When a function is not optimized, Compute Optimizer displays a finding reason of either Memory under-provisioned or Memory over-provisioned.

Optimized

A Lambda function is considered optimized when Compute Optimizer determines that its configured memory or CPU power (which is proportional to the configured memory) is correctly provisioned to run your workload.

Unavailable

Compute Optimizer was unable to generate a recommendation for the function. This could be because the function has not met the requirements of Compute Optimizer for Lambda functions, or the function does not qualify for a recommendation.

For this finding classification, Compute Optimizer displays one of the following finding reasons:

  • Insufficient data when the function does not have sufficient metric data for Compute Optimizer to generate a recommendation.

  • Inconclusive when the function does not qualify for a recommendation because the function has configured memory greater than 1,792 MB, or Compute Optimizer cannot generate a recommendation with a high degree of confidence.

Note

Functions with a finding of Unavailable are not listed in the Compute Optimizer console.

Estimated monthly savings and savings opportunity

Estimated monthly savings (after discounts)

This column lists the approximate monthly cost savings that you experience by migrating your workloads from the current Lambda function memory specification to the recommended memory specification under the Savings Plans pricing model. To receive recommendations with Savings Plans discounts, the savings estimation mode preference needs to be activated. For more information, see Savings estimation mode.

Note

If you don't activate the savings estimation mode preference, this column displays the default On-Demand pricing discount information.

Estimated monthly savings (On-Demand)

This column lists the approximate monthly cost savings that you experience by migrating your workloads from the current Lambda function memory specification to the recommended memory specification under the On-Demand pricing model.

Savings opportunity (%)

This column lists the percentage difference between the price of the current Lambda function memory specification and the price of the recommended specification. If savings estimation mode is activated, Compute Optimizer analyzes the Savings Plans pricing discounts to generate the savings opportunity percentage. If savings estimation mode isn’t activated, Compute Optimizer only uses On-Demand pricing information. For more information, see Savings estimation mode.

Important

If you enable Cost Optimization Hub in AWS Cost Explorer, Compute Optimizer uses Cost Optimization Hub data, which includes your specific pricing discounts, to generate your recommendations. If Cost Optimization Hub isn't enabled, Compute Optimizer uses Cost Explorer data and On-Demand pricing information to generate your recommendations. For more information, see Enabling Cost Explorer and Cost Optimization Hub in the in the AWS Cost Management User Guide.

Estimated monthly savings calculation

For each recommendation, we calculate the cost to operate a new Lambda function using the recommended memory specification. Estimated monthly savings are calculated based on the number of running hours for the current Lambda function and the difference in rates between the current memory specification and the recommended memory specification. The estimated monthly savings for Lambda functions displayed on the Compute Optimizer dashboard is a sum of the estimated monthly savings for all Lambda functions in the account with a finding classification of Not optimized.

Current performance risk

The Current performance risk column on the Lambda functions recommendations page defines the likelihood of each current Lambda function not meeting the resource needs of its workload. The current performance risk values range from very low, low, medium, and high. A very low performance risk means that the current Lambda function is predicted to always provide enough capability. The higher the performance risk is, the more likely you should consider the recommendation generated by Compute Optimizer.

Utilization graphs

The Lambda function details page displays utilization metric graphs for your current function. The graphs display data for the analysis period. Compute Optimizer uses the maximum utilization point within each five-minute time interval to generate Lambda function recommendations.

You can change the graphs to display data for the last 24 hours, three days, one week, or two weeks.

The following utilization graphs are displayed on the details page:

Graph name Description

Duration (milliseconds)

The amount of time that your function code spends processing an event.

Errors (count)

The number of invocations that result in a function error. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime. The runtime returns errors for issues such as timeouts and configuration errors.

Invocations (count)

The number of times your function code is executed, including successful executions and executions that result in a function error.