在 AWS Lambda 中使用 GraalVM 运行 Java
Using GraalVM to run Java in AWS Lambda
是否可以在 AWS Lambda 函数中使用 GraalVM 运行 Java?我阅读了很多关于 Java 具有 GraalVM AOT(提前)编译功能的应用程序冷启动和缩短持续时间的文章,我想尝试在我的 AWS Lambda 项目中使用它。
引入Custom AWS Lambda Runtimes at re:Invent 2018, this is now do-able. See further the AWS Lambda Runtime Interface
您可以使用在 https://docs.aws.amazon.com/lambda/latest/dg/runtimes-walkthrough.html 发布的 bootstrap shell 脚本来调用您的 GraalVM 本机映像,或者您可以在您的本机映像中实现 bootstrap 功能。
还有一个有趣的 article in Japanese on an approach which uses Micronaut which Google can translate for you, and corresponding https://github.com/kencharos/try-graal-lambda 虽然恕我直言,这里使用 Micronaut 的情况并不那么引人注目。
我有一个包含 Java+ GraalVM+ 自定义运行时的完整示例,甚至包含所有部署脚本。另外,我将性能与最流行的运行时进行了比较:
https://github.com/Aleksandr-Filichkin/java-graalvm-aws-lambda
是否可以在 AWS Lambda 函数中使用 GraalVM 运行 Java?我阅读了很多关于 Java 具有 GraalVM AOT(提前)编译功能的应用程序冷启动和缩短持续时间的文章,我想尝试在我的 AWS Lambda 项目中使用它。
引入Custom AWS Lambda Runtimes at re:Invent 2018, this is now do-able. See further the AWS Lambda Runtime Interface
您可以使用在 https://docs.aws.amazon.com/lambda/latest/dg/runtimes-walkthrough.html 发布的 bootstrap shell 脚本来调用您的 GraalVM 本机映像,或者您可以在您的本机映像中实现 bootstrap 功能。
还有一个有趣的 article in Japanese on an approach which uses Micronaut which Google can translate for you, and corresponding https://github.com/kencharos/try-graal-lambda 虽然恕我直言,这里使用 Micronaut 的情况并不那么引人注目。
我有一个包含 Java+ GraalVM+ 自定义运行时的完整示例,甚至包含所有部署脚本。另外,我将性能与最流行的运行时进行了比较:
https://github.com/Aleksandr-Filichkin/java-graalvm-aws-lambda