GeeCON Prague 2022: Ondro Mihályi - Afraid of Java cold starts in Serverless? Fear not, Java is fast

youtube.com 1 rok temu


For years, we’ve been told that Java suffers from cold starts in AWS Lambda and Serverless in general. Believe it not. Java is highly fast to start, the simplest Java program starts in milliseconds. It’s the Java frameworks and libraries that slow things down in general. But not all of them… In this session, I want to show you the fact about Serverless Java and cold starts, what’s slow, what’s fast and why it matters. We’ll go through what a cold start is, how cold starts in AWS Lambda impact your application responsiveness and cloud costs, and what are the options to optimize both. We’ll research and compare Quarkus and Piranha Cloud, the most modern and fastest Jakarta EE frameworks. We’ll test the limits of what they are capable of, how fast they start and whether we even request to think about any optimizations. Then I’ll explain what optimizations may aid if you request to go further, like tuning the JVM, utilizing a customized JVM runtime or building a OS-native binary with GraalVM. However, there are besides a fewer limitations and cost implications of these optimizations, which we'll besides explain. I’ll show and tell, with very fewer slides. You’ll see live for yourselves how Java AWS Lambda functions built with Jakarta EE can start fast and decrease the cold starts to the absolute minimum which you can barely notice.