Nov 17, 20264 min read

Lambda Provisioned Concurrency: Cold Starts, Auto Scaling and How to Set It Up

Keep initialized Lambda environments ready with provisioned concurrency, attach it to a version or alias, scale it on a schedule, and when a warm container platform is a better fit.

Illustration for Lambda Provisioned Concurrency: Cold Starts, Auto Scaling and How to Set It Up

Lambda provisioned concurrency keeps a chosen number of execution environments initialized so the next request does not pay the full cold-start cost of downloading the code and running the init path.

It is not free, and it is not attached to $LATEST. You pay for the provisioned environments whether they are serving traffic or waiting, and you point the setting at a published version or an alias.

This guide publishes a version, attaches provisioned concurrency, and sets a scheduled scale. Encore does not run your API on Lambda, so the Encore section explains that boundary and the container path it uses instead.

Provisioned concurrency at a glance

On-demand LambdaProvisioned concurrencyEncore on Fargate or Cloud Run
Cold startThe first request to a new environment pays initEnvironments are initialized ahead of timeA new task or instance has its own startup path; not a Lambda model
Attached to$LATEST or a versionA published version or alias onlyThe service image Encore deploys
Idle costYou do not pay for idle environmentsYou pay for provisioned environments while they existYou pay for the compute you configured, including min instances on Cloud Run if you set them
ScalingAccount and function concurrencyApplication Auto Scaling, up to reserved concurrencyThe compute platform's autoscaling

Publish a version and attach concurrency

Deploy the function, publish a version, and point an alias at it. Then set provisioned concurrency on the alias, as shown in the provisioned concurrency documentation:

~
$ aws lambda publish-version --function-name checkout$ aws lambda create-alias --function-name checkout --name live --function-version 12$ aws lambda put-provisioned-concurrency-config \ --function-name checkout --qualifier live \ --provisioned-concurrent-executions 5

API Gateway, an alarm, or a client should invoke the alias, not $LATEST, or traffic will miss the provisioned environments. Initialization still happens when you raise the provisioned amount; status moves from IN_PROGRESS to READY when those environments are up. If init fails, the provisioned count will not become ready, and the cause is usually in the function's init code or a missing permission.

Use Application Auto Scaling when traffic is spiky or diurnal: a scheduled action can raise the amount before a known peak and lower it afterwards. Provisioned concurrency cannot exceed the function's reserved concurrency, and reserved concurrency cannot exceed the account limit.

Billing for provisioned concurrency is separate from on-demand duration and requests. Read the current Lambda pricing for your region before you leave a large amount provisioned overnight.

Best fit: latency-sensitive Lambda functions with a predictable floor of traffic, where the cost of ready environments is acceptable.

Encore does not run on Lambda

Encore

Encore brings infrastructure from code and deploys your service to Fargate on AWS or Cloud Run on GCP in your own account. It does not provision Lambda functions or provisioned concurrency. Encore provisions an IAM role for the service, or a service account on GCP.

If a Lambda sits beside an Encore service, for example as a trigger you already own, configure provisioned concurrency on that function as above. For the API itself, encore run starts local infrastructure, and a deploy starts the service on the compute platform you chose. Cold-start behavior then follows Fargate task startup or Cloud Run instance startup, not Lambda provisioned concurrency.

A coding agent working in the Encore repository changes application code and declared infrastructure, not a put-provisioned-concurrency-config call.

Best fit: APIs you want to run as a container in your own AWS or GCP account, with Lambda left for existing event-driven functions.

How to choose

Use provisioned concurrency when the function must stay on Lambda and cold starts are the problem you are measuring. Use scheduled auto scaling when the load is predictable. Use Encore when the API belongs on Fargate or Cloud Run in your account and you want infrastructure declared in the application code.

Frequently asked questions

What is Lambda provisioned concurrency?

Provisioned concurrency keeps a requested number of execution environments initialized and ready to respond, which reduces cold starts for those environments. You attach it to a published function version or an alias, not to $LATEST, and you pay for the provisioned capacity even when no requests are in flight.

Why can I not turn on provisioned concurrency for $LATEST?

$LATEST is a mutable pointer at the unpublished function, and provisioned environments are tied to a specific, immutable version so AWS can initialize the exact code and configuration you chose. Publish a version and attach provisioned concurrency to that version or to an alias that points at it.

Does provisioned concurrency scale automatically?

You can use Application Auto Scaling to change the provisioned amount on a schedule or against a target metric, as described in the Lambda documentation. The reserved concurrency limit of the function still applies, and provisioned concurrency cannot exceed it.

Does Encore use Lambda provisioned concurrency?

No. Encore deploys services to Fargate on AWS or Cloud Run on GCP in your account, not to Lambda. If you already run a Lambda next to an Encore service, provisioned concurrency is configured on that Lambda, not by Encore.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders