Provisioned Concurrency
What You'll Learn
You'll learn how to use provisioned concurrency to eliminate cold starts for critical functions that demand consistent performance.
The Core Concept
Provisioned concurrency keeps a specified number of function instances initialized and ready to respond instantly. Unlike default on-demand scaling where cold starts occur when functions are invoked after being idle, provisioned concurrency pre-warms your functions so they're always standing by.
Think of it like keeping a team of employees on standby during peak business hours instead of calling them in only when customers arrive. The response is immediate because they're already present and ready to work.
How It Works
When you configure provisioned concurrency, the cloud provider:
- Initializes the specified number of execution environments
- Runs your initialization code (outside the handler)
- Keeps these environments "warm" and ready
- Routes incoming requests to these pre-initialized instances
- Scales automatically if requests exceed provisioned capacity (reverting to normal cold start behavior for overflow)
When to Use It
You should enable provisioned concurrency for:
- Latency-sensitive APIs where cold starts are unacceptable
- Scheduled high-traffic events (product launches, sales)
- Critical customer-facing endpoints
- Functions with slow initialization (large libraries, database connections)
The Trade-Off
Provisioned concurrency trades cost for performance. You pay continuously for those pre-warmed instances, even during idle periods—unlike on-demand functions where you only pay per invocation. This makes it ideal for specific critical paths, not blanket application across all functions.
Key Takeaway: Provisioned concurrency eliminates cold starts by keeping function instances pre-initialized and warm, ensuring consistent low-latency responses for your most critical workloads at the cost of continuous charges.