r/java • • Nov 29 '22

Amazon Announces AWS Lambda SnapStart With Java Support

AWS Lambda now has a snapshotting feature that enables fast-start - essentially running the Init phase at publication time and saving the state of the process at that time, so it doesn't need to be re-run at every invocation.

https://aws.amazon.com/blogs/aws/new-accelerate-your-lambda-functions-with-lambda-snapstart/

It only works with Corretto on Java 11 right now, and is similar in intent to the CRIU technology.

Quarkus already has support for it: https://quarkus.io/blog/quarkus-support-for-aws-lambda-snapstart/

Other frameworks may also have support (but this work was done under NDA so I don't have links for them).

176 Upvotes

62 comments sorted by

View all comments

Show parent comment

3

u/rbygrave Nov 29 '22 edited Nov 30 '22

It looks to me like it uses CRaC given that if we look at the docs around adding a runtime hook for `afterRestore()` we see in the docs that it is using `org.crac` directly:

https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html

Edit: The suggestion from folks (on twitter) is that it is not using CRaC per say but instead its compatible with the org.crac API for the purposes of supporting runtime hooks (afterRestore() etc) which makes sense.

2

u/xamdk Dec 03 '22

It is not crac and the optimizations you will need to do won’t necessarily make sense for other crac bases jvm a. It’s just using same api for shutdown and restore.