AWS Lambda SnapStart


Sick of AWS Lambda cold boot times?

AWS just dropped Lambda SnapStart.

Normally, when a Lambda is booted “cold,” AWS pulls a base image, then pulls the code and boots up the image with the code running on it and keeps it alive as long as requests are coming in.

With SnapStart, right after you publish the code, it boots up a Firecracker MicroVM with the code running in it and takes a snapshot of the disk state and memory of the booted-up environment.

It then uses that snapshot to spin up a new container when the lambda is invoked.

Does it come with a cost?

Yes.

“For every function version that you publish with SnapStart enabled, you pay for the cost of caching and maintaining the snapshot. The price depends on the amount of memory that you allocate to your function. You're charged for a minimum of 3 hours.”

Additionally, there is a restoration that appears to get applied every time a cold boot happens.

In the end, it's a great way to have low-latency cold boots on Lambda, but it comes with additional fees, so keep an eye on that.

Need help with your latency issues?

Feel free to reach out to my team and I.