SlideShare a Scribd company logo
1 of 69
Download to read offline
How to reduce cold starts for
Java Serverless applications in AWS
GraalVM, AWS SnapStart and Co
by Vadym Kazulkin, ip.labs GmbH, 17.10.2023
Contact
Vadym Kazulkin
ip.labs GmbH Bonn, Germany
Co-Organizer of the Java User Group Bonn
v.kazulkin@gmail.com
@VKazulkin
https://dev.to/vkazulkin
https://github.com/Vadym79/
https://www.linkedin.com/in/vadymkazulkin
https://www.iplabs.de/
ip.labs
https://www.iplabs.de/
Java popularity
https://distantjob.com/blog/programming-languages-rank/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
Life of the Java (Serverless) developer
on AWS
AWS Java Versions Support
• Corretto Java 8
• With extended long-term support until 2026
• Coretto Java 11 (since 2019)
• Coretto Java 17 (April 2023)
• Only Long Term Support (LTS) by AWS
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: https://aws.amazon.com/de/corretto/
Java ist very fast
and mature
programming
language…
Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea
… but Serverless
adoption of Java
looks like this
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://www.datadoghq.com/state-of-serverless-2021
https://www.datadoghq.com/state-of-serverless/
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Percent of AWS Lambda invocations by language 2021 vs 2023
2021 2023
Developers love Java and will be happy
to use it for Serverless
But what are the challenges ?
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Serverless with Java challenges
• “cold start” times (latencies)
• memory footprint (high cost in AWS)
AWS Lambda Basics
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Creating AWS Lambda with Java 1/3
:
Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
Full CPU access only
approx. at 1.8 GB
memory allocated
Creating AWS Lambda with Java 2/3
:
Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
Creating AWS Lambda with Java 3/3
:
Source https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
Challenge Number 1 with Java is a
big cold-start
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: https://www.serverless.com/blog/keep-your-lambdas-warm
Function lifecycle- a full cold start
Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go
Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
• Start Firecracker VM
• AWS Lambda starts the JVM
• Java runtime loads and initializes
handler class
• Static initializer block of the handler class is
executed (i.e. AWS service client creation)
• Init-phase has full CPU access up to 10 seconds for
free for the managed execution environments
• Lambda calls the handler method
Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go
Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
Michael Hart: „Shave 99.93% off your Lambda bill with this one weird trick“ https://hichaelmart.medium.com/shave-99-93-off-your-lambda-bill-with-this-one-weird-trick-33c0acebb2ea
Lambda demo with common Java
application frameworks
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Cold starts with pure Java
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Runtime/Optimization Frame-
work used
p50 ms p90 ms p99 ms
Amazon Corretto
Java 17
No 2500 3100 4000
Amazon Corretto
Java 17
Quarkus 2532 3150 4100
Amazon Corretto
Java 17
Micronaut 4480 4900 5450
Amazon Corretto
Java 17
Spring
Boot
5300 5710 6204
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
1000
2000
3000
4000
5000
6000
Pure Java
Cold starts p90
No Framework Quarkus Micronaut SpringBoot
Best Practices and Recommendations
Using Tiered Compilation
Achieve up to 60% faster startup times can use level 1 compilation with
little risk of reducing warm start performance
Mark Sailes: "Optimizing AWS Lambda function performance for Java”
https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-function-performance-for-java/
• Switch to the AWS SDK 2.0 for Java
• Lower footprint and more modular
• Allows to configure HTTP Client of your choice (i.e. Java own Basic HTTP Client or
newly introduced AWS Common Runtime async HTTP Client)
Source: https://aws.amazon.com/de/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/
Vadym Kazulkin: https://dev.to/aws-builders/aws-sdk-for-java-2x-asynchronous-http-clients-and-their-impact-on-cold-start-times-and-memory-consumption-of-aws-lambda-366p
S3AsyncClient.builder()
.httpClientBuilder(AwsCrtAsyncHttpClient.builder()
.maxConcurrency(50))
.build();
Best Practices and Recommendations
• Less (dependencies, classes) is more
• Include only required dependencies (e.g. not the whole AWS SDK 2.0 for Java, but the
dependencies to the clients to be used in Lambda)
• Exclude dependencies, which you don‘t need at runtime e.g. test frameworks like Junit
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.10.86</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.10.86</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Best Practices and Recommendations
AWS Lambda cold starts by memory size,
runtime and artifact size
Source: Mike Roberts "Analyzing Cold Start latency of AWS Lambda" https://blog.symphonia.io/posts/2020-06-30_analyzing_cold_start_latency_of_aws_lambda
Artifact Size:
• Small zip (1KB)
• Large zip (48MB)
• Large uberjar (53MB)
Provide all known values (for building clients i.e. DynamoDB client) to
avoid auto-discovery
• credential provider, region, endpoint
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withRegion(Regions.US_WEST_2)
.withCredentials(new ProfileCredentialsProvider("myProfile"))
.build();
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
• Initialize dependencies during initialization phase
• Use static initialization in the handler class, instead of in the handler method (e.g.
handleRequest) to take the advantage of the access to the full CPU core for max 10 seconds
• In case of DynamoDB client put the following code outside of the handler method:
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build();
DynamoDB dynamoDB = new DynamoDB(client);
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
Best Practices and Recommendations
• Prime dependencies during initialization phase (when it worth doing)
• „Fake“ the calls to pre-initalize „some other expensive stuff“
• In case of DynamoDB client put the following code outside of the handler method to pre-
initialize the Jackson Marshaller:
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build();
DynamoDB dynamoDB = new DynamoDB(client);
Table table = dynamoDB.getTable(„mytable");
Item item = table.getItem("Id", 210);
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
getItem() call forces Jackson Marshallers to initialize
Avoid:
• reflection
• runtime byte code generation
• runtime generated proxies
• dynamic class loading
Use DI Frameworks which aren‘t reflection-based
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8
Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/
Best Practices and Recommendations
GraalVM enters the scene
Source: https://www.graalvm.org/
GraalVM
Goals:
Low footprint ahead-of-time mode for JVM-based languages
High performance for all languages
Convenient language interoperability and polyglot tooling
Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
GraalVM
Architecture
Sources: Practical Partial Evaluation for High-Performance Dynamic Language Runtimes http://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf
„The LLVM Compiler Infrastructure“ https://llvm.org/
SubstrateVM
Source: Oleg Šelajev, Thomas Wuerthinger, Oracle: “Deep dive into using GraalVM for Java and JavaScript”
https://www.youtube.com/watch?v=a-XEZobXspo
GraalVM on SubstrateVM
A game changer for Java & Serverless?
Java Function compiled into a native executable using GraalVM
on SubstrateVM reduces
• “cold start” times
• memory footprint
by order of magnitude compared to running on JVM.
Current challenges with native
executable using GraalVM
• AWS doesn’t provide GraalVM (Native Image) as Java Runtime out of
the box
• AWS provides Custom Runtime Option
Custom Lambda Runtimes
Support of GraalVM native images in
Frameworks
Spring Native project for Spring (Boot)
Quarkus: a Kubernetes Native Java framework developed by Red Hat tailored for
GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards.
Micronaut: a modern, JVM-based, full-stack framework for building modular,
easily testable microservice and serverless applications.
Helidon: a cloud-native, open-source set of Java libraries for writing
microservices that run on a fast web core powered by Netty.
Common principles for all frameworks
• Rely on as little reflection as possible
• Avoid runtime byte code generation, runtime generated proxies and
dynamic class loading as much as possible
• Process annotations at compile time
• Provide GraalVM Native Image support out of the box (Gradle and Maven
plugins)
Cold starts: Pure Java vs GraalVM Native
Image
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Runtime/Optimization Frame-
work used
p50 ms p90 ms p99 ms
Amazon Corretto
Java 17
No 2500/433 3100/470 4000/531
Amazon Corretto
Java 17
Quarkus 2532/467 3150/600 4100/802
Amazon Corretto
Java 17
Micronaut 4480/638 4900/722 5450/961
Amazon Corretto
Java 17
Spring
Boot
5300/621 5710/685 6204/722
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
1000
2000
3000
4000
5000
6000
Pure Java GraalVM Native
Image
Cold starts p90
No Framework Quarkus Micronaut SpringBoot
Frameworks Ready for Graal VM Native Image
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://www.graalvm.org/native-image/libraries-and-frameworks/
Graal VM Conclusion
• GraalVM and Frameworks are really powerful with a lot of potential
• GraalVM Native Image improves cold starts and memory footprint
significally
• GraalVM Native Image is currently not without challenges
• AWS Lambda Custom Runtime requires Linux executable only
• Building Custom Runtime requires some additional effort
• e.g. you need to scale CI pipeline to build memory-intensive native image yourself
• Build time is a factor
• You pay for the init-phase of the function packaged as AWS Lambda Custom and Docker
Runtime
• Init-phase is free for the managed runtimes like Java 8 , Java 11 and Java17 (Corretto)
Options to reduce cold start time
• GraalVM (Native Image)
• AWS SnapStart
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Source: https://www.serverless.com/blog/keep-your-lambdas-warm
AWS SnapStart
Vadym Kazulkin @VKazulkin , ip.labs GmbH
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/
C
Create
Snapshot
Firecracker microVM
create & restore snapshot
is based on CRIU
CRIU (Checkpoint/Restore in Userspace)
• Linux CRIU available since 2012 allows a running application to be paused and
restarted at some point later in time, potentially on a different machine.
• The overall goal of the project is to support the migration of containers.
• When performing a checkpoint, essentially, the full context of the process is saved:
program counter, registers, stacks, memory-mapped and shared memory
• To restore the application, all this data can be reloaded and (theoretically) it
continues from the same point.
• Challenges
• open files
• network connections
• sudden change in the value of the system clock
• time-based caches
https://criu.org/Main_Page
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
AWS SnapStart Deployment Phase
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
AWS SnapStart Invocation Phase
(before the end of September 2023)
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
AWS SnapStart Invocation Phase
(after the end of September 2023)
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
Cold starts: Pure Java vs GraalVM Native
Image vs AWS SnapStart
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Runtime/Optimization Frame-
work used
p50 ms p90 ms p99 ms
Amazon Corretto
Java 17
No 2500/433/
1514
3100/470/
1649
4000/531/
1860
Amazon Corretto
Java 17
Quarkus 2532/467/
1727
3150/600/
1907
4100/802/
2189
Amazon Corretto
Java 17
Micronaut 4480/638/
1852
4900/722/
2125
5450/961/
2401
Amazon Corretto
Java 17
Spring
Boot
5300/621/
1920
5710/685/
2321
6204/722/
2538
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
1000
2000
3000
4000
5000
6000
Pure Java GraalVM Native
Image
AWS SnapStart
Cold starts p90
No Framework Quarkus Micronaut SpringBoot
AWS SnapStart Deployment and Invocation
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/
Lambda uses
the CRaC APIs
for runtime
hooks
C
Create
Snapshot
Firecracker microVM
create & restore snapshot
is based on CRIU
• Speed up warmup time of the Java applications
• The C2 compiler is used for very hot methods, which uses profiling data
collected from the running application to optimize as much as possible.
• Techniques like aggressive method inlining and speculative optimizations can
easily lead to better performing code than generated ahead of time (AOT)
using a static compiler.
• JVM needs both time and compute resources to determine which methods to
compile and compiling them. This same work has to happen every time we
run an application
• Ideally, we would like to run the application and then store all the state about
the compiled methods, even the compiled code and state associated with the
application and then we’d like to be able to restore it
https://www.azul.com/blog/superfast-application-startup-java-on-crac/ https://github.com/CRaC/docs
Ideas behind CRaC (Coordinated Restore
at Checkpoint)
AWS SnapStart enabled with Pure Java Priming
<groupId>io.github.crac</groupId>
<artifactId>org-crac</artifactId>
<version>0.1.3</version>
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
AWS SnapStart enabled with Micronaut Priming
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
Cold starts: Pure Java vs GraalVM Native
Image vs SnapStart vs SnapStart with Priming
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Runtime/Optimization Frame-
work used
p50 ms p90 ms p99 ms
Amazon Corretto
Java 17
No 2500/433/
1514/726
3100/470/
1649/829
4000/531/
1860/1067
Amazon Corretto
Java 17
Quarkus 4000/467/
1727/872
3150/600/
1907/996
4100/802/
2189/1090
Amazon Corretto
Java 17
Micronaut 4480/638/
1852/1007
4900/722/
2125/1232
5450/961/
2401/1332
Amazon Corretto
Java 17
Spring
Boot
5300/621/
1920/1024
5710/685/
2321/1525
6204/722/
2538/1850
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
1000
2000
3000
4000
5000
6000
Pure Java GraalVM Native
Image
AWS SnapStart AWS SnapStart
with invoke
DynamoDB
priming
Cold starts p90
No Framework Quarkus Micronaut SpringBoot
AWS SnapStart with Quarkus extended Priming
Source: Vadym Kazulkin
https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
Cold starts: Pure Java vs GraalVM Native
Image vs ASS vs ASS w. Priming vs ASS w ext.
Priming
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
Runtime/Optimization Frame-
work used
p50 ms p90 ms p99 ms
Amazon Corretto
Java 17
No 2500/433/
1514/726/726
3100/470/
1649/829/829
4000/531/
1860/1067/1067
Amazon Corretto
Java 17
Quarkus 4000/467/
1727/872/827
3150/600/
1907/996/961
4100/802/
2189/1090/1080
Amazon Corretto
Java 17
Micronaut 4250/638/
1852/1007/935
4900/722/
2125/1232/1012
5450/961/
2401/1332/1102
Amazon Corretto
Java 17
Spring
Boot
5300/621/
1920/1024/844
5750/685/
2321/1525/1043
6204/722/
2538/1850/1290
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
1000
2000
3000
4000
5000
6000
Pure Java GraalVM
Native Image
AWS SnapStartAWS SnapStart
with invoke
DynamoDB
priming
AWS SnapStart
with
framework
web model
priming
Cold starts p90
No Framework Quarkus Micronaut SpringBoot
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://github.com/aws-samples/serverless-java-frameworks-samples
0
500
1000
1500
2000
2500
3000
3500
4000
4500
Pure Java GraalVM
Native Image
AWS SnapStartAWS SnapStart
with invoke
DynamoDB
priming
Cold starts of Lambda function with Java
17 runtime
p50 p90 p99
AWS SnapStart Challenges & Limitations
• SnapStart supports the Java 11 and 17 (Corretto) managed runtime only
• Deployment with SnapStart enabled takes more than 2-2,5 minutes additionally
• Snapshot is deleted from cache if Lambda function is not invoked for 14 days
• SnapStart currently does not support :
• Provisioned concurrency
• arm64 architecture (supports only x86)
• Amazon Elastic File System (Amazon EFS)
• Ephemeral storage greater than 512 MB
Vadym Kazulkin @VKazulkin , ip.labs GmbH
https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
AWS SnapStart Possible Next Steps
• Perform Priming out of the box without writing the logic on our own
• If snapshot not found do regular cold start as long as new snapshot has been
fully taken under the hood
• Snapshot creation on first Lambda function invocation instead of during the
deployment phase
• Regular cold start as long as the snapshot hasn’t been fully taken
• Trade off between duration of the deployment phase and several regular
bigger cold starts until the snapshot is taken and SnapStart becomes
effective (and therefore much shorter cold starts)
Vadym Kazulkin @VKazulkin , ip.labs GmbH
Lambda Provisioned Concurrency
https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/
• Requires manually managing
start and end time when
Provisioned concurrency should
apply (can be tricky for spikey
workloads)
• You pay for unused capacity
NEW: Lambda Proactive initialization
In June 2023 AWS updated the documentation for the Lambda Function lifecycle
and included this new statement: for functions using unreserved (on-demand)
concurrency, Lambda may proactively initialize a function instance, even if there's
no invocation. When this happens, you can observe an unexpected time gap
between your function's initialization and invocation phases. This gap can appear
similar to what you would observe when using provisioned concurrency.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html
https://aaronstuyvenberg.com/posts/understanding-proactive-initialization
Running this query over
several days across
multiple runtimes and
invocation methods,
between 50% and 75%
of initializations were
proactive (versus
50% to 25% which were
true cold starts)
Project Leyden
https://www.youtube.com/watch?v=lnth19Kf-x0
https://openjdk.org/projects/leyden/
The primary goal of this Project
is to improve the startup time, time
to peak performance, and footprint
of Java programs.
www.iplabs.de
Accelerate Your Photo Business
Get in Touch

More Related Content

What's hot

Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021AWSKRUG - AWS한국사용자모임
 
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...NAVER CLOUD PLATFORMㅣ네이버 클라우드 플랫폼
 
Testing Applications with AWS Device Farm
Testing Applications with AWS Device FarmTesting Applications with AWS Device Farm
Testing Applications with AWS Device FarmAmazon Web Services
 
AWS CloudFormation Session
AWS CloudFormation SessionAWS CloudFormation Session
AWS CloudFormation SessionKamal Maiti
 
Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기Joonsung Lee
 
AWS クラウドで構築するスマホアプリ バックエンド
AWS クラウドで構築するスマホアプリ バックエンドAWS クラウドで構築するスマホアプリ バックエンド
AWS クラウドで構築するスマホアプリ バックエンドkaki_k
 
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Vadym Kazulkin
 
Amazon s3へのデータ転送における課題とその対処法を一挙紹介
Amazon s3へのデータ転送における課題とその対処法を一挙紹介Amazon s3へのデータ転送における課題とその対処法を一挙紹介
Amazon s3へのデータ転送における課題とその対処法を一挙紹介Tetsunori Nishizawa
 
AWS CDK in Practice
AWS CDK in PracticeAWS CDK in Practice
AWS CDK in PracticeChulwoo Choi
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAmazon Web Services
 
Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2XpressEngine
 
5G時代を見据えたIoTプラットフォーム SORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019
5G時代を見据えたIoTプラットフォームSORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 20195G時代を見据えたIoTプラットフォームSORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019
5G時代を見据えたIoTプラットフォーム SORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019SORACOM,INC
 
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...Amazon Web Services
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Expressjguerrero999
 

What's hot (20)

Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
 
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
게임 산업을 위한 네이버클라우드플랫폼(정낙수 클라우드솔루션아키텍트) - 네이버클라우드플랫폼 게임인더스트리데이 Naver Cloud Plat...
 
Testing Applications with AWS Device Farm
Testing Applications with AWS Device FarmTesting Applications with AWS Device Farm
Testing Applications with AWS Device Farm
 
AWS CloudFormation Session
AWS CloudFormation SessionAWS CloudFormation Session
AWS CloudFormation Session
 
Provisioning & Deploy on AWS
Provisioning & Deploy on AWSProvisioning & Deploy on AWS
Provisioning & Deploy on AWS
 
Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기
 
AWS クラウドで構築するスマホアプリ バックエンド
AWS クラウドで構築するスマホアプリ バックエンドAWS クラウドで構築するスマホアプリ バックエンド
AWS クラウドで構築するスマホアプリ バックエンド
 
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
Amazon CodeGuru vs SonarQube for Java Developers at AWS DeveloperWeek Europe ...
 
Amazon s3へのデータ転送における課題とその対処法を一挙紹介
Amazon s3へのデータ転送における課題とその対処法を一挙紹介Amazon s3へのデータ転送における課題とその対処法を一挙紹介
Amazon s3へのデータ転送における課題とその対処法を一挙紹介
 
Deep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormationDeep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormation
 
Appium with MySQL Database
Appium with MySQL DatabaseAppium with MySQL Database
Appium with MySQL Database
 
AWS CDK in Practice
AWS CDK in PracticeAWS CDK in Practice
AWS CDK in Practice
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
Adobe : The Future of SaaS
Adobe : The Future of SaaSAdobe : The Future of SaaS
Adobe : The Future of SaaS
 
AWS Overview in a Single Diagram
AWS Overview in a Single DiagramAWS Overview in a Single Diagram
AWS Overview in a Single Diagram
 
Deep Dive on Backup
Deep Dive on BackupDeep Dive on Backup
Deep Dive on Backup
 
Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2
 
5G時代を見据えたIoTプラットフォーム SORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019
5G時代を見据えたIoTプラットフォームSORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 20195G時代を見据えたIoTプラットフォームSORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019
5G時代を見据えたIoTプラットフォーム SORACOMのアーキテクチャへの挑戦 | AWS DevDay Tokyo 2019
 
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...
Interactive Zero-Touch Enterprise Networks: Nuage SD-WAN on AWS (TLC310) - AW...
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 

Similar to How to reduce cold starts for Java Serverless applications in AWS at Serverless Architecture Conference Berlin 2023

Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023
Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023
Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023Vadym Kazulkin
 
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
 
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...Vadym Kazulkin
 
Adopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageAdopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageVadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyAdopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyVadym Kazulkin
 
Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Vadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonAdopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonVadym Kazulkin
 
Adopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgAdopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgVadym Kazulkin
 
Adapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaAdapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaVadym Kazulkin
 
Adopting Java for the Serverless world at JUG Hamburg
Adopting Java for the Serverless world at  JUG HamburgAdopting Java for the Serverless world at  JUG Hamburg
Adopting Java for the Serverless world at JUG HamburgVadym Kazulkin
 
Adopting Java for the Serverless world at JUG London
Adopting Java for the Serverless world at  JUG LondonAdopting Java for the Serverless world at  JUG London
Adopting Java for the Serverless world at JUG LondonVadym Kazulkin
 
Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaVadym Kazulkin
 
Adopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeAdopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeVadym Kazulkin
 
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...Vadym Kazulkin
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold startsYan Cui
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Julien SIMON
 

Similar to How to reduce cold starts for Java Serverless applications in AWS at Serverless Architecture Conference Berlin 2023 (20)

Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023
Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023
Adopting Java for the Serverless World at Voxxed Days Bruxelles 2023
 
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
 
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
 
Adopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageAdopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT Tage
 
Adopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyAdopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup Italy
 
Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022Adopting Java for the Serverless World at JAX 2022
Adopting Java for the Serverless World at JAX 2022
 
Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022Adopting Java for the Serverless World at JUG Hessen 2022
Adopting Java for the Serverless World at JUG Hessen 2022
 
Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022Adopting Java for the Serverless World at JUG Darmstadt 2022
Adopting Java for the Serverless World at JUG Darmstadt 2022
 
Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022Adopting Java for the Serverless World at JUG Bonn 2022
Adopting Java for the Serverless World at JUG Bonn 2022
 
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonAdopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
 
Adopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays LuxemburgAdopting Java for the Serverless World at VoxxedDays Luxemburg
Adopting Java for the Serverless World at VoxxedDays Luxemburg
 
Adapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaAdapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG Barcelona
 
Adopting Java for the Serverless world at JUG Hamburg
Adopting Java for the Serverless world at  JUG HamburgAdopting Java for the Serverless world at  JUG Hamburg
Adopting Java for the Serverless world at JUG Hamburg
 
Adopting Java for the Serverless world at JUG London
Adopting Java for the Serverless world at  JUG LondonAdopting Java for the Serverless world at  JUG London
Adopting Java for the Serverless world at JUG London
 
Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group Pretoria
 
Adopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeAdopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup Singapore
 
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
AWS Lambda SnapStart: Why, How and What AWS Serverless Meetup New York Boston...
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold starts
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)
 

More from Vadym Kazulkin

Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Vadym Kazulkin
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Vadym Kazulkin
 
Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Vadym Kazulkin
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Vadym Kazulkin
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...Vadym Kazulkin
 
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Vadym Kazulkin
 
Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Vadym Kazulkin
 
Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
 
Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Vadym Kazulkin
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Vadym Kazulkin
 
Writing less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiWriting less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiVadym Kazulkin
 
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Vadym Kazulkin
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Vadym Kazulkin
 
Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Vadym Kazulkin
 

More from Vadym Kazulkin (18)

Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
Revolutionize DevOps lifecycle with Amazon CodeCatalyst and DevOps Guru at De...
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
Amazon DevOps Guru for the Serverless Applications at AWS Community Day NL 2023
 
Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...Making sense of service quotas of AWS Serverless services and how to deal wit...
Making sense of service quotas of AWS Serverless services and how to deal wit...
 
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
 
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
Revolutionize DevOps with ML capabilities. Deep dive into Amazon CodeGuru and...
 
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...Amazon DevOps Guru for the Serverless Applications at  AWS Community Day Bene...
Amazon DevOps Guru for the Serverless Applications at AWS Community Day Bene...
 
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
Amazon CodeGuru vs SonarQube for Java Developers at JCon 2022
 
Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022Adopting Java for the Serverless World at JUG Saxony Day 2022
Adopting Java for the Serverless World at JUG Saxony Day 2022
 
Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022Projects Valhalla and Loom DWX 2022
Projects Valhalla and Loom DWX 2022
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
 
Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022Writing less code with Serverless on AWS at OOP 2022
Writing less code with Serverless on AWS at OOP 2022
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021Projects Valhalla and Loom at IT Tage 2021
Projects Valhalla and Loom at IT Tage 2021
 
Writing less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group NairobiWriting less code with Serverless on AWS at AWS User Group Nairobi
Writing less code with Serverless on AWS at AWS User Group Nairobi
 
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021Writing less code with Serverless on AWS at AWS Community Day DACH 2021
Writing less code with Serverless on AWS at AWS Community Day DACH 2021
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021Writing less code with Serverless on AWS at FrOSCon 2021
Writing less code with Serverless on AWS at FrOSCon 2021
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

How to reduce cold starts for Java Serverless applications in AWS at Serverless Architecture Conference Berlin 2023

  • 1. How to reduce cold starts for Java Serverless applications in AWS GraalVM, AWS SnapStart and Co by Vadym Kazulkin, ip.labs GmbH, 17.10.2023
  • 2. Contact Vadym Kazulkin ip.labs GmbH Bonn, Germany Co-Organizer of the Java User Group Bonn v.kazulkin@gmail.com @VKazulkin https://dev.to/vkazulkin https://github.com/Vadym79/ https://www.linkedin.com/in/vadymkazulkin https://www.iplabs.de/
  • 6. Life of the Java (Serverless) developer on AWS
  • 7. AWS Java Versions Support • Corretto Java 8 • With extended long-term support until 2026 • Coretto Java 11 (since 2019) • Coretto Java 17 (April 2023) • Only Long Term Support (LTS) by AWS Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: https://aws.amazon.com/de/corretto/
  • 8. Java ist very fast and mature programming language… Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea … but Serverless adoption of Java looks like this Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 9. https://www.datadoghq.com/state-of-serverless-2021 https://www.datadoghq.com/state-of-serverless/ Vadym Kazulkin @VKazulkin , ip.labs GmbH Percent of AWS Lambda invocations by language 2021 vs 2023 2021 2023
  • 10. Developers love Java and will be happy to use it for Serverless But what are the challenges ? Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 11. Serverless with Java challenges • “cold start” times (latencies) • memory footprint (high cost in AWS)
  • 12. AWS Lambda Basics Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 13. Creating AWS Lambda with Java 1/3 : Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function Full CPU access only approx. at 1.8 GB memory allocated
  • 14. Creating AWS Lambda with Java 2/3 : Source https://blog.runscope.com/posts/how-to-write-your-first-aws-lambda-function
  • 15. Creating AWS Lambda with Java 3/3 : Source https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
  • 16. Challenge Number 1 with Java is a big cold-start Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: https://www.serverless.com/blog/keep-your-lambdas-warm
  • 17. Function lifecycle- a full cold start Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications
  • 18. • Start Firecracker VM • AWS Lambda starts the JVM • Java runtime loads and initializes handler class • Static initializer block of the handler class is executed (i.e. AWS service client creation) • Init-phase has full CPU access up to 10 seconds for free for the managed execution environments • Lambda calls the handler method Sources: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go Tomasz Łakomy "Notes from Optimizing Lambda Performance for Your Serverless Applications“ https://tlakomy.com/optimizing-lambda-performance-for-serverless-applications Michael Hart: „Shave 99.93% off your Lambda bill with this one weird trick“ https://hichaelmart.medium.com/shave-99-93-off-your-lambda-bill-with-this-one-weird-trick-33c0acebb2ea
  • 19. Lambda demo with common Java application frameworks Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples
  • 20. Cold starts with pure Java Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples Runtime/Optimization Frame- work used p50 ms p90 ms p99 ms Amazon Corretto Java 17 No 2500 3100 4000 Amazon Corretto Java 17 Quarkus 2532 3150 4100 Amazon Corretto Java 17 Micronaut 4480 4900 5450 Amazon Corretto Java 17 Spring Boot 5300 5710 6204
  • 21. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 1000 2000 3000 4000 5000 6000 Pure Java Cold starts p90 No Framework Quarkus Micronaut SpringBoot
  • 22. Best Practices and Recommendations Using Tiered Compilation Achieve up to 60% faster startup times can use level 1 compilation with little risk of reducing warm start performance Mark Sailes: "Optimizing AWS Lambda function performance for Java” https://aws.amazon.com/de/blogs/compute/optimizing-aws-lambda-function-performance-for-java/
  • 23. • Switch to the AWS SDK 2.0 for Java • Lower footprint and more modular • Allows to configure HTTP Client of your choice (i.e. Java own Basic HTTP Client or newly introduced AWS Common Runtime async HTTP Client) Source: https://aws.amazon.com/de/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/ Vadym Kazulkin: https://dev.to/aws-builders/aws-sdk-for-java-2x-asynchronous-http-clients-and-their-impact-on-cold-start-times-and-memory-consumption-of-aws-lambda-366p S3AsyncClient.builder() .httpClientBuilder(AwsCrtAsyncHttpClient.builder() .maxConcurrency(50)) .build(); Best Practices and Recommendations
  • 24. • Less (dependencies, classes) is more • Include only required dependencies (e.g. not the whole AWS SDK 2.0 for Java, but the dependencies to the clients to be used in Lambda) • Exclude dependencies, which you don‘t need at runtime e.g. test frameworks like Junit Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2 <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.4.2</version> <scope>test</scope> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>dynamodb</artifactId> <version>2.10.86</version> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>bom</artifactId> <version>2.10.86</version> <type>pom</type> <scope>import</scope> </dependency> Best Practices and Recommendations
  • 25. AWS Lambda cold starts by memory size, runtime and artifact size Source: Mike Roberts "Analyzing Cold Start latency of AWS Lambda" https://blog.symphonia.io/posts/2020-06-30_analyzing_cold_start_latency_of_aws_lambda Artifact Size: • Small zip (1KB) • Large zip (48MB) • Large uberjar (53MB)
  • 26. Provide all known values (for building clients i.e. DynamoDB client) to avoid auto-discovery • credential provider, region, endpoint AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard() .withRegion(Regions.US_WEST_2) .withCredentials(new ProfileCredentialsProvider("myProfile")) .build(); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 27. • Initialize dependencies during initialization phase • Use static initialization in the handler class, instead of in the handler method (e.g. handleRequest) to take the advantage of the access to the full CPU core for max 10 seconds • In case of DynamoDB client put the following code outside of the handler method: AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build(); DynamoDB dynamoDB = new DynamoDB(client); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 28. Best Practices and Recommendations • Prime dependencies during initialization phase (when it worth doing) • „Fake“ the calls to pre-initalize „some other expensive stuff“ • In case of DynamoDB client put the following code outside of the handler method to pre- initialize the Jackson Marshaller: AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()...build(); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.getTable(„mytable"); Item item = table.getItem("Id", 210); Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ getItem() call forces Jackson Marshallers to initialize
  • 29. Avoid: • reflection • runtime byte code generation • runtime generated proxies • dynamic class loading Use DI Frameworks which aren‘t reflection-based Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: Stefano Buliani : "Best practices for AWS Lambda and Java„ https://www.youtube.com/watch?v=ddg1u5HLwg8 Sean O‘Toole „AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts” https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/ Best Practices and Recommendations
  • 30. GraalVM enters the scene Source: https://www.graalvm.org/
  • 31. GraalVM Goals: Low footprint ahead-of-time mode for JVM-based languages High performance for all languages Convenient language interoperability and polyglot tooling Source: „Everything you need to know about GraalVM by Oleg Šelajev & Thomas Wuerthinger” https://www.youtube.com/watch?v=ANN9rxYo5Hg
  • 32. GraalVM Architecture Sources: Practical Partial Evaluation for High-Performance Dynamic Language Runtimes http://chrisseaton.com/rubytruffle/pldi17-truffle/pldi17-truffle.pdf „The LLVM Compiler Infrastructure“ https://llvm.org/
  • 33. SubstrateVM Source: Oleg Šelajev, Thomas Wuerthinger, Oracle: “Deep dive into using GraalVM for Java and JavaScript” https://www.youtube.com/watch?v=a-XEZobXspo
  • 34. GraalVM on SubstrateVM A game changer for Java & Serverless? Java Function compiled into a native executable using GraalVM on SubstrateVM reduces • “cold start” times • memory footprint by order of magnitude compared to running on JVM.
  • 35. Current challenges with native executable using GraalVM • AWS doesn’t provide GraalVM (Native Image) as Java Runtime out of the box • AWS provides Custom Runtime Option
  • 37. Support of GraalVM native images in Frameworks Spring Native project for Spring (Boot) Quarkus: a Kubernetes Native Java framework developed by Red Hat tailored for GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards. Micronaut: a modern, JVM-based, full-stack framework for building modular, easily testable microservice and serverless applications. Helidon: a cloud-native, open-source set of Java libraries for writing microservices that run on a fast web core powered by Netty.
  • 38. Common principles for all frameworks • Rely on as little reflection as possible • Avoid runtime byte code generation, runtime generated proxies and dynamic class loading as much as possible • Process annotations at compile time • Provide GraalVM Native Image support out of the box (Gradle and Maven plugins)
  • 39. Cold starts: Pure Java vs GraalVM Native Image Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples Runtime/Optimization Frame- work used p50 ms p90 ms p99 ms Amazon Corretto Java 17 No 2500/433 3100/470 4000/531 Amazon Corretto Java 17 Quarkus 2532/467 3150/600 4100/802 Amazon Corretto Java 17 Micronaut 4480/638 4900/722 5450/961 Amazon Corretto Java 17 Spring Boot 5300/621 5710/685 6204/722
  • 40. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 1000 2000 3000 4000 5000 6000 Pure Java GraalVM Native Image Cold starts p90 No Framework Quarkus Micronaut SpringBoot
  • 41. Frameworks Ready for Graal VM Native Image Vadym Kazulkin @VKazulkin , ip.labs GmbH https://www.graalvm.org/native-image/libraries-and-frameworks/
  • 42. Graal VM Conclusion • GraalVM and Frameworks are really powerful with a lot of potential • GraalVM Native Image improves cold starts and memory footprint significally • GraalVM Native Image is currently not without challenges • AWS Lambda Custom Runtime requires Linux executable only • Building Custom Runtime requires some additional effort • e.g. you need to scale CI pipeline to build memory-intensive native image yourself • Build time is a factor • You pay for the init-phase of the function packaged as AWS Lambda Custom and Docker Runtime • Init-phase is free for the managed runtimes like Java 8 , Java 11 and Java17 (Corretto)
  • 43. Options to reduce cold start time • GraalVM (Native Image) • AWS SnapStart Vadym Kazulkin @VKazulkin , ip.labs GmbH Source: https://www.serverless.com/blog/keep-your-lambdas-warm
  • 44. AWS SnapStart Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 45. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/ C Create Snapshot Firecracker microVM create & restore snapshot is based on CRIU
  • 46. CRIU (Checkpoint/Restore in Userspace) • Linux CRIU available since 2012 allows a running application to be paused and restarted at some point later in time, potentially on a different machine. • The overall goal of the project is to support the migration of containers. • When performing a checkpoint, essentially, the full context of the process is saved: program counter, registers, stacks, memory-mapped and shared memory • To restore the application, all this data can be reloaded and (theoretically) it continues from the same point. • Challenges • open files • network connections • sudden change in the value of the system clock • time-based caches https://criu.org/Main_Page
  • 47. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
  • 48. AWS SnapStart Deployment Phase Vadym Kazulkin @VKazulkin , ip.labs GmbH https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
  • 49. AWS SnapStart Invocation Phase (before the end of September 2023) Vadym Kazulkin @VKazulkin , ip.labs GmbH https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
  • 50. AWS SnapStart Invocation Phase (after the end of September 2023) Vadym Kazulkin @VKazulkin , ip.labs GmbH https://dev.to/vkazulkin/measuring-java-11-lambda-cold-starts-with-snapstart-part-1-first-impressions-30a4
  • 51. Cold starts: Pure Java vs GraalVM Native Image vs AWS SnapStart Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples Runtime/Optimization Frame- work used p50 ms p90 ms p99 ms Amazon Corretto Java 17 No 2500/433/ 1514 3100/470/ 1649 4000/531/ 1860 Amazon Corretto Java 17 Quarkus 2532/467/ 1727 3150/600/ 1907 4100/802/ 2189 Amazon Corretto Java 17 Micronaut 4480/638/ 1852 4900/722/ 2125 5450/961/ 2401 Amazon Corretto Java 17 Spring Boot 5300/621/ 1920 5710/685/ 2321 6204/722/ 2538
  • 52. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 1000 2000 3000 4000 5000 6000 Pure Java GraalVM Native Image AWS SnapStart Cold starts p90 No Framework Quarkus Micronaut SpringBoot
  • 53. AWS SnapStart Deployment and Invocation Vadym Kazulkin @VKazulkin , ip.labs GmbH https://aws.amazon.com/de/blogs/compute/reducing-java-cold-starts-on-aws-lambda-functions-with-snapstart/ Lambda uses the CRaC APIs for runtime hooks C Create Snapshot Firecracker microVM create & restore snapshot is based on CRIU
  • 54. • Speed up warmup time of the Java applications • The C2 compiler is used for very hot methods, which uses profiling data collected from the running application to optimize as much as possible. • Techniques like aggressive method inlining and speculative optimizations can easily lead to better performing code than generated ahead of time (AOT) using a static compiler. • JVM needs both time and compute resources to determine which methods to compile and compiling them. This same work has to happen every time we run an application • Ideally, we would like to run the application and then store all the state about the compiled methods, even the compiled code and state associated with the application and then we’d like to be able to restore it https://www.azul.com/blog/superfast-application-startup-java-on-crac/ https://github.com/CRaC/docs Ideas behind CRaC (Coordinated Restore at Checkpoint)
  • 55. AWS SnapStart enabled with Pure Java Priming <groupId>io.github.crac</groupId> <artifactId>org-crac</artifactId> <version>0.1.3</version> Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 56. AWS SnapStart enabled with Micronaut Priming Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-5-priming-end-to-end-latency-and-deployment-time-jem
  • 57. Cold starts: Pure Java vs GraalVM Native Image vs SnapStart vs SnapStart with Priming Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples Runtime/Optimization Frame- work used p50 ms p90 ms p99 ms Amazon Corretto Java 17 No 2500/433/ 1514/726 3100/470/ 1649/829 4000/531/ 1860/1067 Amazon Corretto Java 17 Quarkus 4000/467/ 1727/872 3150/600/ 1907/996 4100/802/ 2189/1090 Amazon Corretto Java 17 Micronaut 4480/638/ 1852/1007 4900/722/ 2125/1232 5450/961/ 2401/1332 Amazon Corretto Java 17 Spring Boot 5300/621/ 1920/1024 5710/685/ 2321/1525 6204/722/ 2538/1850
  • 58. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 1000 2000 3000 4000 5000 6000 Pure Java GraalVM Native Image AWS SnapStart AWS SnapStart with invoke DynamoDB priming Cold starts p90 No Framework Quarkus Micronaut SpringBoot
  • 59. AWS SnapStart with Quarkus extended Priming Source: Vadym Kazulkin https://dev.to/aws-builders/measuring-java-11-lambda-cold-starts-with-snapstart-part-6-priming-the-request-invocation-30od
  • 60. Cold starts: Pure Java vs GraalVM Native Image vs ASS vs ASS w. Priming vs ASS w ext. Priming Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples Runtime/Optimization Frame- work used p50 ms p90 ms p99 ms Amazon Corretto Java 17 No 2500/433/ 1514/726/726 3100/470/ 1649/829/829 4000/531/ 1860/1067/1067 Amazon Corretto Java 17 Quarkus 4000/467/ 1727/872/827 3150/600/ 1907/996/961 4100/802/ 2189/1090/1080 Amazon Corretto Java 17 Micronaut 4250/638/ 1852/1007/935 4900/722/ 2125/1232/1012 5450/961/ 2401/1332/1102 Amazon Corretto Java 17 Spring Boot 5300/621/ 1920/1024/844 5750/685/ 2321/1525/1043 6204/722/ 2538/1850/1290
  • 61. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 1000 2000 3000 4000 5000 6000 Pure Java GraalVM Native Image AWS SnapStartAWS SnapStart with invoke DynamoDB priming AWS SnapStart with framework web model priming Cold starts p90 No Framework Quarkus Micronaut SpringBoot
  • 62. Vadym Kazulkin @VKazulkin , ip.labs GmbH https://github.com/aws-samples/serverless-java-frameworks-samples 0 500 1000 1500 2000 2500 3000 3500 4000 4500 Pure Java GraalVM Native Image AWS SnapStartAWS SnapStart with invoke DynamoDB priming Cold starts of Lambda function with Java 17 runtime p50 p90 p99
  • 63. AWS SnapStart Challenges & Limitations • SnapStart supports the Java 11 and 17 (Corretto) managed runtime only • Deployment with SnapStart enabled takes more than 2-2,5 minutes additionally • Snapshot is deleted from cache if Lambda function is not invoked for 14 days • SnapStart currently does not support : • Provisioned concurrency • arm64 architecture (supports only x86) • Amazon Elastic File System (Amazon EFS) • Ephemeral storage greater than 512 MB Vadym Kazulkin @VKazulkin , ip.labs GmbH https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
  • 64. AWS SnapStart Possible Next Steps • Perform Priming out of the box without writing the logic on our own • If snapshot not found do regular cold start as long as new snapshot has been fully taken under the hood • Snapshot creation on first Lambda function invocation instead of during the deployment phase • Regular cold start as long as the snapshot hasn’t been fully taken • Trade off between duration of the deployment phase and several regular bigger cold starts until the snapshot is taken and SnapStart becomes effective (and therefore much shorter cold starts) Vadym Kazulkin @VKazulkin , ip.labs GmbH
  • 65. Lambda Provisioned Concurrency https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ • Requires manually managing start and end time when Provisioned concurrency should apply (can be tricky for spikey workloads) • You pay for unused capacity
  • 66. NEW: Lambda Proactive initialization In June 2023 AWS updated the documentation for the Lambda Function lifecycle and included this new statement: for functions using unreserved (on-demand) concurrency, Lambda may proactively initialize a function instance, even if there's no invocation. When this happens, you can observe an unexpected time gap between your function's initialization and invocation phases. This gap can appear similar to what you would observe when using provisioned concurrency. https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html https://aaronstuyvenberg.com/posts/understanding-proactive-initialization Running this query over several days across multiple runtimes and invocation methods, between 50% and 75% of initializations were proactive (versus 50% to 25% which were true cold starts)
  • 67. Project Leyden https://www.youtube.com/watch?v=lnth19Kf-x0 https://openjdk.org/projects/leyden/ The primary goal of this Project is to improve the startup time, time to peak performance, and footprint of Java programs.
  • 68.
  • 69. www.iplabs.de Accelerate Your Photo Business Get in Touch