Debugging Content Delivery embedded caching

A variety of issues can arise with embedded caching on the server. This topic explores what could be wrong, and how you might debug the problem.

About this task

The most common caching problems you might encounter are:
  • The microservices may fail to connect to Apache Ignite, the caching backend
  • When caching takes place across multiple hosts, issues may arise, like the question which host starts first when caching is started up.
  • Objects may not get flushed from the cache. This issue should always eventually resolve itself when the TTL (Time to Live) of the object expires.

The bullets above could be checked with simple self-made logger/controller. Alternatively, the customer could just examine Ignite's own logging (statistics). Ignore entries that require a key.

Procedure

  1. First, to obtain a high level of detail in your caching logging, ensure the presence of the following line in your logback.xml files:
    <logger name="com.sdl.delivery.cache" level="trace"/>

    Be sure to change the log level back once your caching issue has been resolved.

  2. To track down the source of the issues listed above, you can examine Apache Ignite's logs for more information. Ignite logs tend to be full of entries referring to individual cache objects, which are not important when resolving these kinds of issues. For that reason, when examining the logs, ignore entries that require a key. More interesting are statistics, which can show you whether the cache is filling up and emptying out properly.
  3. You can also use an optional Ignite module called ignite-rest-http, which exposes a REST endpoint through HTTP that lets you examine various aspects of the cache, such as:
    • cluster state
    • cache metrics
    • cache size
    • getting, putting and removing cache entries
    • checking the existence of a key in the cache
    • destroying the cache

    For more information, refer to https://ignite.apache.org/docs/latest/restapi.

  4. Alternatively, if the logs and the API don't resolve your issue, you can consider building a basic logger or controller yourself.