Fast Restart For Java Apps

Java continues to be popular for server-side apps. But one problem is that starting a Java app can be slow. So if you have some Java code that performs a service on demand, runs for a short while and then shuts down again, that hurts performance. Enter “CRaC”, or “Coordinated Restore at Checkpoint” <https://devclass.com/2023/05/22/azul-makes-openjdk-with-fast-start-crac-generally-available-but-not-cross-platform/>, from a company called Azul, which seems to centre its entire business around OpenJDK <https://www.azul.com/about/>. This system lets the app dump its state to disk in a form that allows for quick resumption. This state cannot include things like open files/network connections, so the app itself needs to implement handlers to close these before the dump and reopen them after the restore, saving enough state as part of the dump to allow this to happen with minimal impact on the rest of the application. Interestingly, this system is built on another piece of software called “CRIU” or “Checkpoint/Restore In Userspace” <https://criu.org/Main_Page>, which is Linux-only. As Azul’s CTO says: “We submitted CRaC to OpenJDK as an idea for a project … and they’ve included it as one of the many project they have. The reason it isn’t in the mainstream yet, and I’m not even sure it will make it into the mainstream, is that we rely on the CRIU technology underneath on Linux, and there isn’t an equivalent that we’re aware of on Windows or on Mac. So you lose that cross-platform functionality … ” But as the article says, that may not such a big showstopper any more: Java applications are often developed on Windows or Mac, but most often deployed to Linux, suggesting that the lack of cross-platform support is not a deal-breaker for everyone.
participants (1)
-
Lawrence D'Oliveiro