Skip to main content

πŸ›‘οΈ AWS Lambda Function memory is overprovisioned🟒

  • Contextual name: πŸ›‘οΈ Function memory is overprovisioned🟒
  • ID: /ce/ca/aws/lambda/function-memory-overprovisioned
  • Tags:
  • Policy Type: BEST_PRACTICE
  • Policy Categories: COST

Stats​

not available

Logic​

Description​

Open File

Description​

This policy identifies AWS Lambda functions whose current $LATEST configuration has an AWS Compute Optimizer memory overprovisioning recommendation and a valid smaller memory option. Review these functions for potential cost savings and benchmark the proposed configuration before reducing memory.

Rationale​

Excess memory can increase Lambda compute costs. Compute Optimizer provides workload-based recommendations that distinguish memory overprovisioning from underprovisioning. Using the specific MemoryOverprovisioned reason avoids treating every NotOptimized finding as a downsizing opportunity.

The policy identifies candidates for review, rather than guaranteed savings. Prioritize functions with positive estimated savings and enough usage to justify the testing and deployment effort. A zero or unavailable savings estimate should not be treated as a confirmed financial benefit.

The 14-day analysis period, minimum invocation count, and supported memory range are eligibility checks, not a formula for calculating the recommended memory size. AWS bases Lambda sizing recommendations on workload history, including CPU time, duration, and memory usage. The Lambda recommendation API does not expose fixed utilization thresholds, memory headroom settings, or a maximum permitted duration increase. This policy therefore validates the recommendation and its smaller memory option without inventing a memory-utilization cutoff. Observed memory usage, projected duration, and savings provide evidence for reviewing the recommendation; they do not reproduce AWS's sizing model.

... see more

Remediation​

Open File

Remediation​

  1. Open AWS Compute Optimizer β†’ Lambda functions in the affected account and Region, and select the function. Confirm that the recommendation targets $LATEST, reports MemoryOverprovisioned, matches the current memory size, and still reflects the deployed code and configuration. If the function has changed since analysis, wait for a new recommendation.
  2. Review the smaller recommended memory option, projected duration, available performance risk, and estimated monthly savings, including applicable discounts. Performance risk can be empty for overprovisioned functions; do not interpret an empty risk value as a guarantee of safe downsizing. Prioritize changes with a worthwhile financial benefit; zero or unavailable estimated savings alone do not justify a production change.
  3. Benchmark the proposed memory size in a test environment with representative inputs, peak traffic, cold starts, and infrequent workloads. Compare execution duration, memory use, errors, timeouts, and total compute cost with the current configuration. Lower memory also reduces CPU allocation, so retain the current size if the proposed change does not meet performance requirements or reduce cost.

... see more

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Resource Right-Sizing22no data