Lädt...


🔧 Spring Boot 3 application on AWS Lambda - Part 11 Measuring cold and warm starts of Lambda function using Docker Container Image


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Introduction

In the article How to develop and deploy Lambda function using Docker Container Image and Java (21) runtime I gave step by step introduction about how to develop and deploy Lambda function using Docker container image and Java 21 runtime without using any frameworks. As Docker Container Image is generic format, we can simply take our Spring Cloud Function application introduced in the article Develop application with Spring Cloud Function AWS and deploy it using the same steps. So, I published the re-worked version of this application (adding the Dockerfle and changing the SAM template) to be deployed as a Docker image here. For all Lambda functions we use JAVA_TOOL_OPTIONS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" (which gives a reasonable trade-off between cold and warm start times) and give them 1024 MB memory. The same also works using AWS Serverless Java Container.

Measuring cold and warm starts of Lambda function using Spring Cloud Function and Docker Container Image as deployment format

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 GetProductByIdWithSpringBootJava21DockerImage 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
4558.68 4622.92 4749.37 5002.74 7183.64 7185.5 7.16 7.94 9.09 20.99 52.47 1313.08

Conclusion

In this article we measured cold and warms starts of the Lambda function using this approach AWS Lambda base Docker container image. We experienced much higher cold start and slightly higher warm start times compared to the measurement with Lambda function using Docker Container Image and Java (21) runtime without using Spring (Boot) framework but also compared to measuring cold start times with other approaches using Spring Boot: AWS Serverless Java Container, AWS Lambda Adapter and Spring Cloud Functions introduced in the past articles of this series.

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 23 which will be released in September.

...

🔧 Evaluation metric, objective function, loss function, cost function, scoring function, error function


📈 45.26 Punkte
🔧 Programmierung

🔧 Creating Docker Image of Spring Boot Application using Buildpacks


📈 38.56 Punkte
🔧 Programmierung

🔧 Reducing Cold Starts on AWS Lambda with Java Runtime - Future Ideas about SnapStart, GraalVM and Co


📈 37.38 Punkte
🔧 Programmierung

🔧 Reducing AWS Lambda Cold Starts


📈 36.12 Punkte
🔧 Programmierung

🔧 Reduce AWS Lambda Cold Starts in .NET


📈 36.12 Punkte
🔧 Programmierung

🔧 Turbocharging AWS Lambda: How to eliminate cold starts forever


📈 36.12 Punkte
🔧 Programmierung

🔧 Java CRUD Rest API using Spring Boot, Hibernate, Postgres, Docker and Docker Compose


📈 35.61 Punkte
🔧 Programmierung

🔧 Kotlin CRUD Rest Api using Spring Boot, Hibernate, Postgres, Docker and Docker Compose


📈 35.61 Punkte
🔧 Programmierung

🔧 How to package and deploy a Lambda function as a container image


📈 34.11 Punkte
🔧 Programmierung

📰 software-architektur.tv: GraalVM mit Spring Native, Spring Boot und Spring Cloud


📈 33.58 Punkte
📰 IT Nachrichten

🔧 Spring vs Spring MVC vs Spring Boot: A Detailed Comparison for Java Developers


📈 33.58 Punkte
🔧 Programmierung

🔧 Building Serverless Applications with Spring Boot and AWS Lambda


📈 32.49 Punkte
🔧 Programmierung

🔧 Sending Emails with Spring Boot, AWS SES, and Serverless Lambda for Scalable Solutions


📈 32.49 Punkte
🔧 Programmierung

🔧 How to Use Spring Boot Eureka Server in Spring Boot 3.3.0+


📈 32.28 Punkte
🔧 Programmierung

🔧 Enhancing AWS Lambda with AWS Lambda Powertools: A Complete Guide to CRUD Operations in DynamoDB


📈 30.19 Punkte
🔧 Programmierung

🔧 How to Import Pandas(library) in AWS Lambda Functions - AWS Lambda Layers


📈 30.19 Punkte
🔧 Programmierung

🔧 How to Use Spring Profiles in Your Spring Boot Application


📈 30.1 Punkte
🔧 Programmierung

🔧 Securing Your Spring Boot Application with Spring Security


📈 30.1 Punkte
🔧 Programmierung

🔧 WarmSwap: Share Dependencies for Faster Serverless Function Cold Starts


📈 30.08 Punkte
🔧 Programmierung

matomo