

# Viewing Lambda function recommendations
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](#lambda-recommendations-findings), 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](metrics.md).

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](requirements.md).

**Topics**
+ [

## Finding classifications
](#lambda-recommendations-findings)
+ [

## Estimated monthly savings and savings opportunity
](#lambda-savings-calculation)
+ [

## Current performance risk
](#lambda-current-performance-risk)
+ [

## Utilization graphs
](#lambda-utilization-graphs)
+ [

# Accessing Lambda function recommendations and details
](lambda-view-recommendations.md)

## 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](requirements.md#requirements-lambda-functions), or the function does not qualify for a recommendation. For this finding classification, Compute Optimizer displays one of the following finding reasons: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/compute-optimizer/latest/ug/view-lambda-recommendations.html)  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](https://docs.aws.amazon.com/compute-optimizer/latest/ug/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](https://docs.aws.amazon.com/compute-optimizer/latest/ug/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](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html) and [ Cost Optimization Hub](https://docs.aws.amazon.com/cost-management/latest/userguide/cost-optimization-hub.html) 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.  | 

# Accessing Lambda function recommendations and details
Accessing Lambda function recommendations

You can use one of the following procedures to access either the **Lambda function recommendations** or the **Lambda function details** pages in the AWS Console.

On the **Lambda function recommendations** page you can view the recommendations for your current functions. On the **Lambda function details** page you can view the details of a specific function and its recommendations.

## Procedures


### Accessing Lambda function recommendations page


**To access the Lambda function recommendations page**

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

1. Choose **Lambda functions** in the navigation pane.

   The 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.

1. You can perform the following actions on the recommendations page:
   + Filter recommendations by AWS Regions, Findings, or Finding reasons. To do this, first select the **Filter by one or more properties** text box. Then, choose the property and a value in the dropdown list that appears.
   + Filter your recommendations by tags. To do this, select the **Tag key** or **Tag value** text box. Then, enter the key or value you want to filter your Lambda function recommendations by.

     For example, to find all recommendations that have a tag with the key of `Owner` and the value of `TeamA`, specify `tag:Owner` for the filter name and `TeamA` for the filter value.
   + View recommendations for functions in another account. To do this, choose **Account**, and then select a different account ID.
**Note**  
If you're signed in to a management account of an organization and trusted access with Compute Optimizer is enabled, you can view recommendations for resources in other accounts. For more information, see [Accounts supported by Compute Optimizer](getting-started.md#supported-accounts) and [Trusted access for AWS Organizations](security-iam.md#trusted-service-access).
   + Clear the selected filters. To do this, choose **Clear filters** next to the filter.
   + Access the **Lambda function details** page for a specific function. To do this, choose the finding classification listed next to the function that you want to access.

   Modify the configured memory of your Lambda function when you're ready. For more information, see [Configuring Lambda function memory](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) in the *AWS Lambda Developer Guide*.

### Accessing Lambda function details page


**To access the Lambda function details page**

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

1. Choose **Lambda functions** in the navigation pane.

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

   The 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.

1. You can perform the following actions on the 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](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) in the *AWS Lambda Developer Guide*.