Certopolis

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.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company's platform account in eu-west-1 runs about 60 AWS Lambda functions under the default concurrency quota. Most are event-processing functions that scale with incoming traffic. One function performs automated deployment rollbacks: an Amazon EventBridge rule invokes it when a release alarm fires, and an incident can need up to 50 copies at once. During a recent traffic spike, the event-processing functions used all of the account's concurrency and the rollback invocations were throttled. The rollback function must always be able to run 50 concurrent executions, and the company does not want to pay for pre-initialized execution environments. What should a DevOps engineer do to meet these requirements?

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: A is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Reserved concurrency of 50 carves those 50 units out of the pool for the rollback function only: no other function can use them, and the rollback function can always start up to 50 executions. Reserving concurrency is free of charge, which meets the cost requirement; it also caps the function at 50, which matches the stated need.

    Written from docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html

  2. A company's Git provider sends a webhook for every push to an AWS Lambda function URL on the unqualified function. The function starts builds through the company's build orchestrator, which accepts at most 25 concurrent requests, so the function has reserved concurrency of 25. The provider marks a delivery as failed if no response arrives within 10 seconds, and the function's initialization takes about 12 seconds. Pushes are rare overnight, and the first deliveries each morning fail. In the morning, at most 5 deliveries run at once; on release days up to 25 do, and none may be throttled. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: C is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Lambda attaches that only to a published version or an alias, so the function gets a live alias and the webhook moves to a function URL on that alias; the unqualified URL would never land on the warm environments. Release days need all 25 deliveries to run unthrottled while the orchestrator never sees more than 25, and the existing reservation of 25 already does both. The five warm environments are counted inside that 25 rather than added to it, so it stays where it is.

    Written from docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html

  3. A company runs a Python 3.12 AWS Lambda function behind an Amazon API Gateway REST API that invokes the function's live alias. Initialization imports large libraries and takes about 6 seconds. It also creates a random worker ID that prefixes every idempotency key the function writes, and each execution environment must have its own. The DevOps team's pipeline publishes a new version on every merge, about 25 a day, and then moves the alias. The team must cut cold start latency without provisioning capacity, and must stop paying for versions that are no longer in use. Which combination of steps should the DevOps engineer take to meet these requirements? (Select THREE.)

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: C,D,F is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Because every environment resumes from one snapshot, unique values must be created after initialization, so the worker ID moves into the handler and is generated on each environment's first invocation. For Python, each published version with SnapStart carries a snapshot caching charge while it remains active, so the pipeline deletes versions that no alias points to.

    Written from docs.aws.amazon.com/lambda/latest/dg/snapstart.html

Ask for something