Optimize your Java application for containers and serverless
summary
Recommendations focus on measurable changes: upgrade from Java 8 to 17/21, tune Lambda memory with Lambda Power Tuning or Compute Optimizer, swap AWS SDK v1 for v2 with the CRT HTTP client (startup latency ~76% better), and enable Lambda SnapStart for up to 10x cold-start reduction while handling DB sockets via the CRaC before-snapshot/after-restore hooks. For containers use multi-stage builds, Jib, and Zstandard image compression (startup up to ~27% faster), or build GraalVM native images / CRaC checkpoints (Spring Boot 19s → 2.5s); Graviton yields ~40% price/perf.
AI-written summary · about
chapters (15)
- 0:00Introduction and overview
- 1:06Why Java for serverless and containers
- 3:56Optimizing Java on AWS Lambda
- 7:56Lambda cold starts and initialization
- 14:44Dependency injection and SDKs
- 17:16Lambda SnapStart for faster startup
- 22:20Java on containers overview
- 23:23Slow container startup challenges
- 26:16Reducing container image size
- 31:39Ahead-of-time compilation with GraalVM
- 36:20Coordinated restore at checkpoint
- 41:21Optimizing for Graviton processors
- 44:15Trade-offs and effectiveness of optimizations
- 44:59Upgrading Java versions with Amazon Q
- 46:00Resources and closing remarks
related talks
01h 02mOptimizing Containerized #Java Apps with Jib, #GraalVM, CDS, & #CRaC
19mTen things that improve the performance of your Java based AWS Lambda
51mAdapting Java for the Serverless world!
51mHow To Reduce Cold Starts for Java Serverless Applications in AWS
53mHigh performance Serverless Java on AWS
56mJava on AWS - all the details that matter
49mJava and Containers Make it Awesome
47mLegal JVM Doping in Your Containers
