Readiness Check

When external traffic requests to your site become overloaded, adding replicas reduces the burden and improves performance. A readiness check can test the capability of the new replica to send and receive traffic.

As replicas are added, there's a period of time required to let the replica come to a ready state. There are many reasons why a replica isn't ready, including dependencies on other services, or application warm-up times. Routing traffic to replicas before they’re ready results in decreased throughput and delayed response times.

If you use a readiness check to test the replica, you can incorporate the check requirements in the readiness probe for the replica. The probe only returns a ready status when the readiness checks are complete.

Default Behavior

Commerce Cloud monitors new replicas and considers the replica ready as soon as the replica returns a "ready" status. A more in-depth readiness check isn’t performed.

You can extend the default behavior and add your own customized logic to determine when the readiness endpoint is considered ready.

If you want to help new replicas achieve a ready status faster, use the node warming feature. Node warming can execute flexible search queries or load local URLs that warm up the replica before it returns a "ready" status.

Custom Readiness Check

A custom readiness check lets you determine when your site is ready. You can extend the Java interface provided by Commerce Cloud to include a custom readiness check.

One option is to add your readiness check implementation to the Spring Web Application Context of the AddOn, so that the check only applies when this AddOn is installed on the storefront. If this AddOn isn’t installed on the storefront, the custom readiness check isn’t considered when determining if a replica is ready.

Node Warming

In a typical commerce pod, the time it takes to serve the initial external requests is lengthy because there are several prerequisite activities that must be performed. These activities include compiling and rendering JSP pages, filling and warming database caches, and so forth. The initial activities cause slower response times and reduce throughput.

To remedy this situation, you have the option to use the node warming feature to prepare replicas before they return a "ready" status to the readiness probe. There are two basic node warming options:

  • Entity Cache Warmer: lets you specify the most impactful queries to execute when a service replica starts. These queries warm up flexible search caches.
  • Page Warmer: lets you specify URLs for sites that you want to preload. The sites could include a base URL, URL paths, a CMS site, or other pages that you identify.

If you want to add customized logic to execute javascript, ping third-party applications, or warm up other aspects of the service replica, you can write your own java code to extend the readiness check. Add your implementation of the PerformableReadinessCheck to the list of readinessChecks in the Commerce Cloud manifest file.

If you just want to adjust the readiness check interface, you can add your own code to determine when and how to perform the checks. In this case, follow the guidelines provided in Extending the Readiness Check.