aws AWS Developer Tools Blog ·

AWS SDK for Java 2.x Introduces Client Warm-Up to Reduce Cold Starts

blogawsgaengineer
feature

The AWS SDK for Java 2.x now includes an SDK client warm-up feature, available in version 2.54.0 and later. This new capability addresses cold-start latency by pre-initializing the SDK request path and HTTP client connections during application startup. Developers can choose to warm all clients on their classpath or specify particular client classes for optimized startup performance. It is particularly beneficial for applications running on AWS Lambda with SnapStart, ensuring clients are warm within the snapshot for faster subsequent invocations.

  • →Reduce AWS SDK for Java Cold-Start Latency
  • →Warm All Clients on the Classpath
  • →Warm Specific Clients for Optimized Startup
  • →Integrate with AWS Lambda SnapStart
  • →Mechanism of Client Warm-Up
Features (4) ›
  • Reduce AWS SDK for Java Cold-Start Latency

    The new SDK client warm-up feature addresses cold-start latency in AWS SDK for Java 2.x applications, which typically experience slower first service calls. It pre-exercises the SDK request path during application startup, improving subsequent call performance.

  • Warm All Clients on the Classpath

    Developers can invoke `SdkWarmUp.warmUp()` without arguments during application startup to initialize every service client found on the application's classpath along with their corresponding HTTP clients.

  • Warm Specific Clients for Optimized Startup

    For finer control, the `warmUp(Class... clients)` overload allows developers to specify which synchronous or asynchronous client classes to warm, preventing unnecessary warm-up of unused service modules and reducing startup time.

  • Integrate with AWS Lambda SnapStart

    The warm-up feature can be integrated into AWS Lambda functions that use SnapStart by calling `SdkWarmUp.warmUp()` in the function handler's constructor. This ensures clients are warm within the snapshot, benefiting every invocation after a restore.

Notes (2) ›
  • Mechanism of Client Warm-Up

    The warm-up feature loads JVM classes and compiles JIT code for the SDK request path, and establishes network connections by making an unsigned, no-credential network call to an AWS endpoint. This process avoids cold start overheads on the first actual service interaction.

  • Availability in AWS SDK for Java 2.x

    The SDK client warm-up feature is available in Java SDK version 2.54.0 and later, shipping as part of the `sdk-core` module without requiring additional dependencies.

Read the original announcement →

https://aws.amazon.com/blogs/developer/introducing-sdk-client-warm-up-feature-in-the-aws-sdk-for-java-2-x/

Related releases