Speed Up Java Startup on Kubernetes with CRaC
The article discusses how to leverage CRaC (Coordinated Restore at Checkpoint) to reduce Java startup time on Kubernetes. CRaC is a project introduced by Azul in 2020, aimed at reducing the startup time and time to peak performance of Java applications. It works by taking a memory snapshot at the app runtime and restoring it in later executions using the Linux feature called Checkpoint/Restore In Userspace (CRIU). While CRaC is currently only available for Linux, it can be used with Azul Zulu OpenJDK on Kubernetes. The article provides step-by-step instructions on how to enable CRaC and create a checkpoint for an app. By restoring the app from its saved state, developers can achieve significantly faster startup times, reducing it from seconds to milliseconds. The article also mentions that Micronaut and Quarkus frameworks already support CRaC, while Spring Framework plans to provide support in November 2023.