


Lambda function using Docker Container Image -Part easuring cold and warm starts of Lambda function with Java ( runtime
Introduction
In the first article of our small series we explored how to develop and deploy Lambda function using Docker Container Image and Java runtime. We explored 2 use cases:
- AWS Lambda base Docker container image
- AWS OS-only base image
In this article we'll measure cold and warms starts of the Lambda function using this approach AWS Lambda base Docker container image.
Measuring cold and warm starts of Lambda function using AWS Lambda base Docker container image and Java (21) runtime
For our measurements we'll use our sample application from the first part and use Java 21 runtime for our Lambda functions. For all Lambda functions we give 1024 MB memory and use JAVA_TOOL_OPTIONS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" as this compilation option provides a very good-trade of between the cold and warm start times.
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 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 |
---|---|---|---|---|---|---|---|---|---|---|---|
3093.26 | 3219.44 | 3314.12 | 4632.16 | 6513.35 | 6517.71 | 5.47 | 6.20 | 7.39 | 17.14 | 43.03 | 1386.07 |
Conclusion
In this article, we measured cold and warms start times of the Lambda function using this approach AWS Lambda base Docker container image. We experienced quite significant cold start and quite competitive warm start times compared to Measuring cold and warm starts with Java 21 using different Lambda memory settings for Lambda with 1024 MB memory and Lambda Java 21 managed runtime.
AWS Lambda SnapStart which significantly reduces cold start times is currently only available for Java Corretto managed runtimes (11, 17 and 21) and not for Docker container images. You can explore jlink tool to assemble and optimize a set of modules and their dependencies into a smaller custom runtime image and Class data sharing (CDS) though which helps reduce the startup time for Java programming language applications, in particular smaller applications, as well as reduce footprint. The advantage of using the Docker Image as deployment artifact for Java is the ability to use recent Java runtime like Java 22 (Java 23 will be released in September 2024).
The above is the detailed content of Lambda function using Docker Container Image -Part easuring cold and warm starts of Lambda function with Java ( runtime. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Field mapping processing in system docking often encounters a difficult problem when performing system docking: how to effectively map the interface fields of system A...

Start Spring using IntelliJIDEAUltimate version...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...
