Skip to content

AWS Technologies Blog

Menu
  • Home
  • KB
  • Services
  • Resources
  • Posts
  • Find
    • Categories
    • Tags
  • About
Menu

Lambda: Reserved concurrency vs provisioned

Posted on May 6, 2025May 6, 2025 by wpadmin
Understanding Lambda function scaling ...

AWS Lambda offers two primary concurrency controlsโ€”reserved concurrency and provisioned concurrencyโ€”each serving distinct purposes. Here’s a detailed comparison to help you understand their differences and use cases:(AWS Documentation)


๐Ÿ”น Reserved Concurrency

Purpose: Guarantees a specific number of concurrent executions for a function, ensuring it has dedicated capacity.

Key Characteristics:

  • Fixed Allocation: Allocates a set number of concurrent executions exclusively to the function.
  • No Additional Cost: Configuring reserved concurrency incurs no extra charges.
  • Impact on Account Limit: The reserved concurrency reduces the total available concurrency for other functions in your account.
  • No Auto-Scaling: Does not automatically adjust based on traffic patterns.(AWS Documentation)

Use Cases:

  • Ensuring critical functions always have the necessary capacity.
  • Preventing other functions from consuming all available concurrency.(AWS Documentation, AWS Documentation)

Example:

aws lambda put-function-concurrency \
  --function-name MyFunction \
  --reserved-concurrent-executions 100

๐Ÿ”น Provisioned Concurrency

Purpose: Prepares a specified number of execution environments in advance to reduce cold start latency.

Key Characteristics:

  • Pre-Initialization: Allocates and initializes execution environments before they are needed.
  • Additional Cost: Involves extra charges for the pre-initialized environments.
  • Cold Start Mitigation: Reduces or eliminates cold start times by having environments ready to handle requests.
  • Auto-Scaling Support: Can be managed using Application Auto Scaling to adjust based on demand.(AWS Documentation, AWS Documentation)

Use Cases:

  • Reducing latency for performance-sensitive applications.
  • Handling predictable traffic patterns with minimal cold starts.(Amazon Web Services, Inc.)

Example:

aws application-autoscaling register-scalable-target \
  --service-namespace lambda \
  --scalable-dimension lambda:function:ProvisionedConcurrency \
  --resource-id function:MyFunction:prod \
  --min-capacity 10 \
  --max-capacity 100

๐Ÿ” Comparison Overview

FeatureReserved ConcurrencyProvisioned Concurrency
PurposeGuarantee capacity for critical functionsReduce cold start latency
CostNo additional chargeAdditional charges apply
ScalingManual adjustment onlyCan be auto-scaled with Application Auto Scaling
Cold StartPossibleReduced or eliminated
Impact on AccountReduces total available concurrencyDoes not impact account concurrency limit

โœ… Recommendations

  • Use Reserved Concurrency: When you need to ensure that a function has dedicated capacity, preventing other functions from consuming all available concurrency.
  • Use Provisioned Concurrency: When you require consistent low-latency responses and can manage the associated costs.
  • Combine Both: For critical functions, you can set reserved concurrency to guarantee capacity and provisioned concurrency to reduce cold starts.

Configure provisioned concurrency

To configure auto scaling for AWS Lambda functions using Application Auto Scaling, you’ll need to set up provisioned concurrency and register your Lambda function as a scalable target. Here’s a step-by-step guide:AWS Documentation+2Amazon Web Services, Inc.+2AWS Documentation+2


๐Ÿ› ๏ธ Step 1: Create a Lambda Alias

First, create an alias for your Lambda function to specify which version you want to scale.Amazon Web Services, Inc.

bashCopyEditaws lambda create-alias \
  --function-name MyFunction \
  --name prod \
  --function-version 1 \
  --description "Production alias"

๐Ÿ“ˆ Step 2: Register the Scalable Target

Next, register your Lambda function alias as a scalable target with Application Auto Scaling.AWS Documentation+4AWS Documentation+4Amazon Web Services, Inc.+4

bashCopyEditaws application-autoscaling register-scalable-target \
  --service-namespace lambda \
  --scalable-dimension lambda:function:ProvisionedConcurrency \
  --resource-id function:MyFunction:prod \
  --min-capacity 0 \
  --max-capacity 100

This command sets the minimum and maximum provisioned concurrency for your function alias. Amazon Web Services, Inc.+2AWS Documentation+2AWS Documentation+2


๐Ÿ“… Step 3: Schedule Scaling Actions

You can schedule scaling actions using cron expressions. For example, to scale up at 11:45 AM UTC daily:theburningmonk.medium.com

bashCopyEditaws application-autoscaling put-scheduled-action \
  --service-namespace lambda \
  --scalable-dimension lambda:function:ProvisionedConcurrency \
  --resource-id function:MyFunction:prod \
  --scheduled-action-name scale-up \
  --schedule "cron(45 11 * * ? *)" \
  --scalable-target-action MinCapacity=50

This sets the minimum capacity to 50 at the specified time. Amazon Web Services, Inc.+1AWS Documentation+1


๐Ÿ“Š Step 4: Monitor and Adjust

Regularly monitor your Lambda function’s performance and adjust the scaling parameters as needed to optimize cost and performance.

  • Product List
  • Documentation

billing ciem containers cost cspm ebs ec2 ecs edge eks elb event Firewall fsx hybrid iam lambda NACL outpostd policies pop princing rds route53 s3 security serverless services SG siem storage vpc

  • Amazon FSx
  • aws
  • aws notes
  • billing
  • cloud
  • compute
  • containers
  • core
  • databases
  • development
  • ebs
  • ec2
  • ecs
  • edge
  • efs
  • eks
  • hybrid
  • iam
  • lambda
  • network
  • outposts
  • pricing
  • rds
  • route53
  • s3
  • security
  • serverless
  • services
  • storage
  • support
  • vpc
©2025 AWS Technologies Blog | Built using WordPress and Responsive Blogily theme by Superb