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 arti…


This content originally appeared on DEV Community and was authored by Vadym Kazulkin

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.


This content originally appeared on DEV Community and was authored by Vadym Kazulkin


Print Share Comment Cite Upload Translate Updates
APA

Vadym Kazulkin | Sciencx (2024-10-28T14:37:39+00:00) Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts. Retrieved from https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/

MLA
" » Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts." Vadym Kazulkin | Sciencx - Monday October 28, 2024, https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/
HARVARD
Vadym Kazulkin | Sciencx Monday October 28, 2024 » Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts., viewed ,<https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/>
VANCOUVER
Vadym Kazulkin | Sciencx - » Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/
CHICAGO
" » Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts." Vadym Kazulkin | Sciencx - Accessed . https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/
IEEE
" » Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts." Vadym Kazulkin | Sciencx [Online]. Available: https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/. [Accessed: ]
rf:citation
» Lambda function with GraalVM Native Image – Part 3 Measuring cold and warm starts | Vadym Kazulkin | Sciencx | https://www.scien.cx/2024/10/28/lambda-function-with-graalvm-native-image-part-3-measuring-cold-and-warm-starts/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.