SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Project CRaC
Coordinated Restore at Checkpoint
Goran Čeko
What the CRaC?!
2
Coordinated Restore at Checkpoint (CRaC)
on the Java Virtual Machine
https://openjdk.org/projects/crac
OpenJDK vs Project CRaC
“OpenJDK is a place, not a thing” (73 projects)
Source code for the Java Development Kit:
• Virtual Machine (HotSpot)
• Java Class Library
• Java Compiler (javac)
Project CRaC
• Proposed and led by Azul
• OpenJDK Zulu builds (binary distributions) by Azul include CRaC features
• OpenJDK vs builds is like Linux vs its distributions
3
How does JVM work?
4
5
Execution Cycle
6
Startup vs Warmup
Checkpoint & Restore concepts
7
CRaC API
• Coordination - ability to react on before and after events (resource management)
• The API enables coordination of resources during checkout and restore
• Checkpoint and restore notifications, awareness of checkpoint/restore events (callbacks)
• Java frameworks and libraries are adopting CRaC, eg. Apache
• CRaC implementation creates the checkpoint safely
• Ensures reliable restart from a given checkpoint
• org.crac dependency
8
Resource & Context
public class MyResource implements Resource {
public MyResource() {
org.crac.Core.getGlobalContext().register(this);
}
@Override
public void beforeCheckpoint(Context<? extends Resource> context) throws Exception {
// free your resources
}
@Override
public void afterRestore(Context<? extends Restore> context) throws Exception {
// load your resources
}
}
9
Benefits
● Provides immediate application start with peak performance
○ Faster deployment process as well
● Eliminates JIT compilation overhead or JVM warm-up
○ Hotspot identification, method compiles, recompiles and deoptimisations
● Reduces costs in cloud/K8s environments (pay-as-you-use)
○ When scaling resources to meet demand
○ Less time and computing resources used
○ Ideal for apps that perform a lot of work during startup & warmup
● Major frameworks are supported: Micronaut, Quarkus and Spring (Boot)
10
Limitations
1. No auto-dump for open files and sockets
(we need to take care of that)
2. Must be restored on the same architecture
(Linux x64,Arm64 | JDK 17 & 21 Azul Zulu builds of OpenJDK)
3. Changes in the value of the system clock (time difference)
(for syncing or caching)
11
CRaC’s summary
12
+
-
GraalVM Native Images - Ahead-of-Time
• Ahead of Time is static compilation
• Native instructions give full speed from the start
• No need to start the app ahead of time
• No CPU overhead to compile code at runtime
• 3x smaller memory consumption
• Smaller image than the snapshot
13
• All classes must be available at build time
• No JIT (runtime) compilation optimisations
• Lower performance than JIT optimised JVM
• Debugging is harder
How fast is it?
14
* Proof of concept results
How to Checkpoint/Restore?
15
JVM CRaC parameters
# START
$ java -XX:CRaCCheckpointTo=/crac-files -jar app.jar
# CHECKPOINT
$ jcmd <PID>/app.jar JDK.checkpoint
$ Core.checkpointRestore();
# RESTORE
$ java -XX:CRaCRestoreFrom=/crac-files
16
Demo Time
CRaC in Action
17
Deployment example
18
19
Thank you.
“Java: the elegant simplicity of C++ and the
blazing speed of Smalltalk.“
James Gosling
https:/
/openjdk.java.net/projects/crac/
https:/
/github.com/crac

Weitere ähnliche Inhalte

Ähnlich wie Project CRaC

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 
KSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success StoryKSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success Story
Kristofferson A
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Andrey Vagin
 
Checkpoint and Restore In Userspace
Checkpoint and Restore In UserspaceCheckpoint and Restore In Userspace
Checkpoint and Restore In Userspace
OpenVZ
 

Ähnlich wie Project CRaC (20)

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
 
Docker & ECS: Secure Nearline Execution
Docker & ECS: Secure Nearline ExecutionDocker & ECS: Secure Nearline Execution
Docker & ECS: Secure Nearline Execution
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
 
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
Kubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesKubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slides
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
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...
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
KSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success StoryKSCOPE 2013: Exadata Consolidation Success Story
KSCOPE 2013: Exadata Consolidation Success Story
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
 
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...
 
Checkpoint and Restore In Userspace
Checkpoint and Restore In UserspaceCheckpoint and Restore In Userspace
Checkpoint and Restore In Userspace
 
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
Open WG Talk #2 Everything you wanted to know about CRIU (but were afraid to ...
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 

Project CRaC

  • 1. Project CRaC Coordinated Restore at Checkpoint Goran Čeko
  • 2. What the CRaC?! 2 Coordinated Restore at Checkpoint (CRaC) on the Java Virtual Machine https://openjdk.org/projects/crac
  • 3. OpenJDK vs Project CRaC “OpenJDK is a place, not a thing” (73 projects) Source code for the Java Development Kit: • Virtual Machine (HotSpot) • Java Class Library • Java Compiler (javac) Project CRaC • Proposed and led by Azul • OpenJDK Zulu builds (binary distributions) by Azul include CRaC features • OpenJDK vs builds is like Linux vs its distributions 3
  • 4. How does JVM work? 4
  • 7. Checkpoint & Restore concepts 7
  • 8. CRaC API • Coordination - ability to react on before and after events (resource management) • The API enables coordination of resources during checkout and restore • Checkpoint and restore notifications, awareness of checkpoint/restore events (callbacks) • Java frameworks and libraries are adopting CRaC, eg. Apache • CRaC implementation creates the checkpoint safely • Ensures reliable restart from a given checkpoint • org.crac dependency 8
  • 9. Resource & Context public class MyResource implements Resource { public MyResource() { org.crac.Core.getGlobalContext().register(this); } @Override public void beforeCheckpoint(Context<? extends Resource> context) throws Exception { // free your resources } @Override public void afterRestore(Context<? extends Restore> context) throws Exception { // load your resources } } 9
  • 10. Benefits ● Provides immediate application start with peak performance ○ Faster deployment process as well ● Eliminates JIT compilation overhead or JVM warm-up ○ Hotspot identification, method compiles, recompiles and deoptimisations ● Reduces costs in cloud/K8s environments (pay-as-you-use) ○ When scaling resources to meet demand ○ Less time and computing resources used ○ Ideal for apps that perform a lot of work during startup & warmup ● Major frameworks are supported: Micronaut, Quarkus and Spring (Boot) 10
  • 11. Limitations 1. No auto-dump for open files and sockets (we need to take care of that) 2. Must be restored on the same architecture (Linux x64,Arm64 | JDK 17 & 21 Azul Zulu builds of OpenJDK) 3. Changes in the value of the system clock (time difference) (for syncing or caching) 11
  • 13. GraalVM Native Images - Ahead-of-Time • Ahead of Time is static compilation • Native instructions give full speed from the start • No need to start the app ahead of time • No CPU overhead to compile code at runtime • 3x smaller memory consumption • Smaller image than the snapshot 13 • All classes must be available at build time • No JIT (runtime) compilation optimisations • Lower performance than JIT optimised JVM • Debugging is harder
  • 14. How fast is it? 14 * Proof of concept results
  • 16. JVM CRaC parameters # START $ java -XX:CRaCCheckpointTo=/crac-files -jar app.jar # CHECKPOINT $ jcmd <PID>/app.jar JDK.checkpoint $ Core.checkpointRestore(); # RESTORE $ java -XX:CRaCRestoreFrom=/crac-files 16
  • 17. Demo Time CRaC in Action 17
  • 19. 19 Thank you. “Java: the elegant simplicity of C++ and the blazing speed of Smalltalk.“ James Gosling https:/ /openjdk.java.net/projects/crac/ https:/ /github.com/crac