Why My "Lightning Fast" Spring Boot Native App Took 9 Seconds to Boot on Fly.io
Why My "Lightning Fast" Spring Boot Native App Took 9 Seconds to Boot on Fly.io We’ve all heard the promise of GraalVM and Spring Boot Native: sub-second cold starts! Instant scaling! A fraction of...

Source: DEV Community
Why My "Lightning Fast" Spring Boot Native App Took 9 Seconds to Boot on Fly.io We’ve all heard the promise of GraalVM and Spring Boot Native: sub-second cold starts! Instant scaling! A fraction of the memory! So, I spent the time configuring my Spring Boot 4 app to compile into a native image. Locally, inside a Docker container, it booted in a highly respectable 1.7 seconds. Feeling triumphant, I deployed it to Fly.io, expecting instantaneous "scale-to-zero" magic. I checked the logs. Started Application in 9.026 seconds. Wait, what? 9 seconds? For a pre-compiled native binary? Thus began my descent into a debugging rabbit hole that fundamentally changed how I view cloud hardware, GraalVM, and the "scale-to-zero" paradigm. Here is the story of how I debugged a 9-second cold start, and why I eventually decided to abandon scale-to-zero altogether. The Setup Framework: Spring Boot 4 + Hibernate + Flyway Java Version: Java 25 Build Tool: Gradle with the GraalVM Native Build Tools plugin I