Logo

dev-resources.site

for different kinds of informations.

Lambda function with GraalVM Native Image - Part 3 Measuring cold and warm starts

Published at
10/28/2024
Categories
java
aws
serverless
graalvm
Author
vkazulkin
Categories
4 categories in total
java
open
aws
open
serverless
open
graalvm
open
Author
9 person written this
vkazulkin
open
Lambda function with GraalVM Native Image - Part 3 Measuring cold and warm starts

Introduction

In the part 2 of the series we explored how to develop and deploy pure Lambda function (without using any frameworks like Spring Boot 3) with Custom Runtime containing GraalVM Native Image with GraalVM 21 runtime .

In this article we'll measure performance (cold and warms starts) of the Lambda function using this approach.

Measuring cold and warm starts of Lambda function with Custom Runtime containing GraalVM Native Image

For our measurements we'll use our sample application from the part 2 and give all Lambda functions 1024 MB memory.

The results of the experiment below were based on reproducing more than 100 cold and approximately 100.000 warm starts for the duration of 1 hour with Lambda function GetProductByIdWithPureJava21GraalVMNativeImageLambda which is mapped to the Java Lambda handler class which is responsible for retrieving the product (stored in the DynamoDB) by its id. For it I used the load test tool hey, but you can use whatever tool you want, like Serverless-artillery or Postman.

Cold (c) and warm (m) start time in ms:

c p50 c p75 c p90 c p99 c p99.9 c max w p50 w p75 w p90 w p99 w p99.9 w max
525.77 532.12 542.32 632.56 635.73 636.11 4.16 4.69 5.46 12.30 37.25 211.83

Conclusion

In this article measured performance (cold and warms starts) of the pure Lambda function having 1024 MB of memory using Custom Runtime containing GraalVM Native Image with GraalVM 21 runtime.

Comparing these performance measurements with from the article Measuring cold and warm starts with Java 21 using different Lambda memory settings which we did with SnapStart enabled and using priming of DynamoDB request we see that we have by far the lowest cold and warm start times using GraalVM Native Image comparing to using the pure Lambda function with SnapStart and described priming. Of course, both approaches SnapStart and GraalVM Native Image also have different advantages and disadvantages that we'll explore in the separate article.

At the time of publishing also newer versions became available (like GraalVM 23 runtime) so you case make the version changes and re-compile GraalVM Native image following the instructions from the part 2 of the series and re-measure the Lambda performance.

In the next article of the series, we'll explore the impact of different Lambda memory settings (from 256 to 1536 MBs) on the Lambda performance, as the memory setting also heavily influences the cost of running the Lambda functions.

graalvm Article's
30 articles in total
Favicon
Java Can Be Serverless Too: Using GraalVM for Fast Cold Starts
Favicon
Kotlin Native and GraalVM - The Story So Far
Favicon
Native Image Quick Reference — GraalVM for JDK 23 - graalvm
Favicon
GraalVM: The Swiss Army Knife of the JVM World
Favicon
Wednesday Links - Edition 2024-10-23
Favicon
Lambda function with GraalVM Native Image - Part 4 Measuring cold and warm starts using different Lambda memory settings
Favicon
Graalvm to run wasm from spring boot
Favicon
Lambda function with GraalVM Native Image - Part 3 Measuring cold and warm starts
Favicon
Wednesday Links - Edition 2024-09-25
Favicon
Lambda function with GraalVM Native Image - Part 2 How to develop and deploy Lambda function with Custom Runtime
Favicon
Lambda function with GraalVM Native Image - Part 1 Introduction to GraalVM and its native image capabilities
Favicon
Enhancing Performance with Static Analysis, Image Initialization and Heap Snapshotting
Favicon
Turbocharge Java Microservices with Quarkus and GraalVM Native Image
Favicon
Memory Management in GraalVM Native Image
Favicon
How to build spring boot native binary
Favicon
Exploring Graal: Next-Generation JIT Compilation for Java
Favicon
Registering Reflection in Quarkus Extensions
Favicon
Even more Opentelemetry!
Favicon
O quão difícil é um Hello World em Java?
Favicon
Mi experiencia con GraalVM y Spring Boot
Favicon
Ktor build with graalvm
Favicon
Wednesday Links - Edition 2023-06-28
Favicon
Wednesday Links - Edition 2023-06-21
Favicon
Graalvanizando un script de Groovy
Favicon
Wednesday Links - Edition 2023-02-22
Favicon
Wednesday Links - Edition 2023-01-11
Favicon
GraalVM: running C/C++ application safely in the Java world
Favicon
GraalVM Native Image for Mobile Development
Favicon
Wednesday Links - Edition 2022-11-02
Favicon
Wednesday Links - Edition 2022-10-19

Featured ones: