PLAY PODCASTS
Thawing Java on AWS Lambda: Reducing Cold Start Times from 11 Seconds to 1
Season 1 · Episode 6

Thawing Java on AWS Lambda: Reducing Cold Start Times from 11 Seconds to 1

Serverless Sorcery

June 9, 202445m 15s

Audio is streamed directly from the publisher (mcdn.podbean.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

Are your Java cloud functions too slow? What if they could start in milliseconds instead of seconds? And use less memory to boot?

This is not a dream, but by changing the way we compile our Java functions we can significantly reduce memory usage while also drastically improving startup performance.

Java has never been a perfect fit for Function as a Service platforms such as AWS Lambda or Azure Functions. While both platforms have official support for Java, Java functions unfortunately suffer from significantly longer cold start times than many other runtimes.

In this episode we talk through a simple Spring Cloud Java function running on AWS Lambda with fairly horrible cold start times of around 6 seconds and then compare a few different approaches for significantly improving it. Eventually ending up with a cold start time of just 100 milliseconds - making Java a viable, though not without drawbacks, choice for FaaS platforms.