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 Lambda function 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 12 hours to be generated, and sufficient metric data must be accumulated. For more information, see Supported resources and requirements.

Finding classifications

The finding classifications on the Lambda functions recommendations page provide 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.

Utilization graphs

The Lambda function details page displays utilization metric graphs for your current function. The graphs display data for the analyzed period (up to 14 days). 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 Lambda function 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.

Viewing Lambda function recommendations

Use the following procedure to access the Lambda functions recommendations page, and view recommendations for your current functions.

  1. Open the Compute Optimizer console at https://console.aws.amazon.com/compute-optimizer/.

  2. Choose Lambda functions in the navigation pane.

    The Lambda functions recommendations page lists the specifications and finding classifications of your functions, along with the specifications of the recommended functions. The current functions listed are from the AWS Region that is currently selected, in the selected account.

  3. You can perform the following actions on the recommendations page:

    • To filter recommendations to one or more AWS Regions, enter the name of the Region in the Filter by one or more Regions text box, or choose one or more Regions in the drop-down list that appears.

    • To view recommendations for functions in another account, choose Account, and then select a different account ID.

      Note

      The ability to view recommendations for resources in other accounts is available only if you are signed in to a management account of an organization, and trusted access with Compute Optimizer is enabled. For more information, see Accounts supported by Compute Optimizer and Compute Optimizer and AWS Organizations trusted access.

    • To clear the selected filters, choose Clear filters next to the filter.

    • To access the Lambda function details page for a specific function, choose the finding classification listed next to the desired function.

    Modify the configured memory of your Lambda function when you're ready. For more information, see Configuring Lambda function memory in the AWS Lambda Developer Guide.

Viewing Lambda function recommendation details

Use the following procedure to access the Lambda function recommendation details page, and view details of a specific function and its recommendations.

  1. Open the Compute Optimizer console at https://console.aws.amazon.com/compute-optimizer/.

  2. Choose Lambda functions in the navigation pane.

  3. Choose the finding classification listed next to the function for which you wish to view detailed information.

    The Lambda function details page lists the top optimization recommendation for the function that you chose. It lists the specifications of your current function, the recommended function configuration, and utilization metric graphs.

  4. You can perform the following actions on the Lambda function details page:

    • Choose a recommendation option to view the utilization comparison between your current function and a recommended function.

      The utilization metric graphs for your current function are displayed at the bottom of the page.

    • To change the time range of the graphs, choose Time Range, and then choose Last 24 hours, Last 3 days, Last week, or Last 2 weeks.

      Choosing a shorter time range displays the data points at a higher granularity, which provides a higher level of detail.

    Modify the configured memory of your Lambda function when you're ready. For more information, see Configuring Lambda function memory in the AWS Lambda Developer Guide.