AWS Certified DevOps Engineer – Professional
Lambda reserved vs provisioned concurrency vs SnapStart
Reserved concurrency sets both the maximum and the minimum number of concurrent instances for one function, at no charge. Provisioned concurrency keeps a number of execution environments initialized so they respond without a cold start. The Lambda Developer Guide says SnapStart instead resumes new environments from a snapshot taken when a version is published.
What does reserved concurrency do?
By default an account has 1,000 concurrent executions per Region, shared by all functions on demand. When the pool runs out, functions are throttled. Reserved concurrency takes a share of that pool for one function. No other function can use it, and the function cannot scale past it.
Functions without reserved concurrency share what is left. In the AWS example, reserving 400 units each for two functions leaves 200 units of unreserved concurrency for everything else. Reserved concurrency counts toward the account limit and has no charge. It does not pre-initialize anything, so cold starts still happen.
What does provisioned concurrency do?
Provisioned concurrency is a number of pre-initialized execution environments that are ready to respond immediately. It is set on a published version or an alias, never on $LATEST. An event source must point at that version or alias, or the function does not use the provisioned environments.
You can provision up to the unreserved account concurrency minus 100. Provisioned units are taken from the pool even when unused. If a function has both settings, provisioned concurrency cannot exceed its reserved concurrency.
Application Auto Scaling can manage provisioned concurrency on an alias with scheduled scaling or target tracking. Lambda emits the ProvisionedConcurrencyUtilization metric only while the function is receiving requests, so target tracking alarms have no data during idle periods. Scheduled scaling suits predictable load changes.
When is SnapStart the better fit?
With SnapStart, Lambda initializes the function when you publish a version, takes an encrypted snapshot of the memory and disk state, and resumes new environments from the cached snapshot. It works only on published versions and aliases that point to them, not on $LATEST. It supports Java 11 and later, Python 3.12 and later, and .NET 8 and later.
SnapStart does not support provisioned concurrency, Amazon EFS, or ephemeral storage above 512 MB. One snapshot is the starting state of many environments, so unique IDs, secrets and random seeds must be generated after initialization, not during it. Network connections made during initialization must be checked and re-established.
For Java runtimes SnapStart has no extra cost. For other runtimes you pay to cache the snapshot of each published version, and for each restore, for as long as the version exists. Deleting unused versions stops the caching charge.
Where the exam catches people
- Believing reserved concurrency removes cold starts: it only reserves capacity. Pre-initialized environments come from provisioned concurrency.
- Believing reserved concurrency is only a floor: it is also the function's ceiling, and requests beyond it are throttled.
- Believing provisioned concurrency or SnapStart can be set on
$LATEST: both need a published version or an alias. - Believing SnapStart and provisioned concurrency can be combined on one version: SnapStart does not support provisioned concurrency.
- Believing target tracking scales provisioned concurrency down overnight: the utilization metric is not emitted while the function is idle. Use scheduled scaling.