-
Notifications
You must be signed in to change notification settings - Fork 90
Add support for CRaC (AWS Snapstart) #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@scottgerring I would like to take a CRaCk at this :) Describe the solution you'd like Describe alternatives you've considered Additional context |
Hey @subhash686 glad you're interested! I'm no longer a maintainer here, but: @msailes @dreamorosi @jeromevdl can anyone point @subhash686 in the right direction? |
I think SnapStart priming can be done in Powertools for several use cases:
|
Hey @Vadym79, thanks for engaging in the discussion 🎉 I really like these points and thank you for providing these examples and articles. Regarding the first point, I believe that this is a good starting point to gain "kind of automatic" performance advantages when it comes to priming within Powertools itself. Hey @subhash686! Sorry for getting back to you so late. I am a maintainer here now. Would you still be interested in working on this? I think we can start with a small proof-of-concept for one submodule. Maybe Idempotency is a good candidate for this. We could "invoke-prime" the DynamoDBPersistence automatically. What do you think? |
Another note: When we implement this we should add documentation about https://github.com/aws/aws-lambda-snapstart-java-rules.
|
I'm going to take a look at this in the next two weeks as part of our I will focus on priming of the Powertools utilities themselves (use-case 1 mentioned by @Vadym79). |
Hi @phipag Looks like I missed your comment that was for me. I did some work following the original article, but did not change anything yet per the new guidance. I can certainly take a look at Idempotency Dynamo persistence in the next 2 weeks to meet your timeline as well. Please let me know how I can help. Thanks. |
Hey @subhash686, welcome back and awesome that you would like to contribute. It might be a good idea to start with the idempotency module like you suggested as a proof-of-concept. Based on the context provided by @msailes and @Vadym79 I see two opportunities for the library itself to integrate with Snapstart:
Generally, it would be nice if this works automatically without the user to call any library methods / change their code. I think we can combine both approaches but let's start with Option (2) because the manual priming can be done module-by-module. Here are some thoughts / next steps for you @subhash686:
I am happy to support during the progress @subhash686, for example, when it comes to the load tests and we can iterate together on a PR. Please make sure to base all your work on the |
Yesterday, AWS published a blog article about invoke priming (manual priming) and class priming (automatic priming): https://aws.amazon.com/blogs/compute/optimizing-cold-start-performance-of-aws-lambda-using-advanced-priming-strategies-with-snapstart/ They also provide a GitHub repository with example code: https://github.com/aws-samples/lambda-priming-crac-java-cdk |
@phipag I have added the class priming for |
Hey @subhash686, awesome progress. A popular load testing tool is artillery which was also used in the blog post I linked in my previous message. Looking at the GitHub repository linked at the end of this blog post you might be able to use this as an example (https://github.com/aws-samples/lambda-priming-crac-java-cdk/blob/main/infrastructure/loadtest.yaml). Essentially, you would deploy a Lambda function with SNAPSTART enabled in your AWS account and run the load test once against a Lambda containing your priming code and then another time removing the priming code you added. The ideal result would be a shorter restore duration of the Lambda containing your priming code. I am happy to do the load testing for you, I would rather focus on the code and I can run the load testing as a validation step once we are working on a PR. |
Hey @subhash686, do you have any updates to share already? |
Hi @phipag - Yes, I've added manual priming on Dynamo as well. My commits are waiting internal organization review before I could push those out. I'll nudge the concerned team again and most likely get the PR out this week. Thanks for your patience and prompt support. |
Thanks, @subhash686, for your continued engagement. I'll stay tuned for your PR. |
Is your feature request related to a problem? Please describe.
We should add support for CRaC priming. This will improve the startup performance of applications using Powertools. @msailes has written a helpful guide here. I think we should do this before v2 is released.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: