Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vhcraig's avatar

Laravel Vapor - AWS Lambda Cold Boot

I've been trying to figure out how to prevent cold boots on AWS Lambda (with Laravel Vapor) and it seems there are two options:

From my understanding, provisioned concurrency is kept "warm" by AWS and are billed for the duration it is kept alive. While prewarming is Vapor pinging the site every few minutes to keep it warm?

I'm trying to determine which one is more cost effective and which one is more functional.

I may be way off, so hopefully someone can shed some light.

0 likes
3 replies
aligajani's avatar
Level 7

Vapor prewarms the app every 5 minutes. You don't need to do anything. AWS concurrency feature is more expensive and you shouldn't need it if your app has like a few K users at most. Right now, out of the box, Vapor achieves the pre-warm functionality using Cloudwatch events.

vhcraig's avatar

Thanks, does indeed seem to be the case. It's worth noting that it only pre-warms a single instance. If you have a site with a considerable amount of traffic, it can result in cold boots. This is when you should consider provisioned concurrency.

JonKF's avatar

According to the documentation you can specify how many web Lambdas are kept prewarm:

https://docs.vapor.build/1.0/projects/environments.html#prewarming

Increasing the number the number of prewarmed workers (within reason) should in theory only have a very small increase in the monthy bill since you are only paying for the few seconds per hour where the worker is actively working and not the time it's being kept warm.

Please or to participate in this conversation.