Troubleshooting: Dynamic cache service


 

+

Search Tips   |   Advanced Search

 

 

Overview

The dynamic cache service works within an appserver JVM, intercepting calls to cacheable objects.

 

Servlets are not cached

Recommendation Enable servlet caching.

On the Web container settings page of the admin console, select the checkbox...

    Enable servlet caching

 

Cache entries are not written to disk

Explanation Cache entries are written to disk when the cache is full and new entries are added to the memory cache. Cache entries also are written to disk when Flush to disk is enabled in the admin console and the server is stopped.
Recommendation Verify that Disk offload is enabled on the Dynamic cache service settings page of the admin console. Also verify that cache entries written to disk are serializable and do not have the PersistToDisk configuration set to false.

 

Some servlets are not replicated or written to disk

Recommendation Verify the attributes and response are serializable. If we do not want to store the attributes, use the following property in the cache policy:

<property name="save-attributes">false</property>

 

Dynamic cache service does not cache fragments on the Edge

Recommendation Set the EdgeCacheable property to true in the cache policy for those entries that are to be cached on the Edge.

<property name="EdgeCacheable">true</property>

 

Dynamic cache invalidations are not sent to the IBM HTTP Server plug-in

Explanation The DynaCacheEsi.ear file is required to send invalidations to external caches.
Recommendation Install DynaCacheEsi.ear using the admin console.

 

Cache entries are evicted often

Problem The cache is full and new entries are added to the cache.
Explanation Cache entries are evicted when the cache is full and new entries are added to the cache. A least recently used (LRU) eviction mechanism removes the least recently used entry to make space for the new entries.
Recommendation Enable Disk offload on the Dynamic cache service settings page of the admin console so the entries are written to disk. We can also increase the cache size to accommodate more entries in the cache.

 

Cache entries in disk with timeout set to 0 expire after one day

Explanation The maximum lifetime of an entry in disk cache is 24 hours. A timeout of 0 in the cache policy configures these entries to stay in disk cache for one whole day, unless they are evicted earlier.
Recommendation Set the timeout for the cache policy to a number less than 0.

 

I cannot monitor cache entries on the Edge

Explanation Use the dynamic cache monitor to monitor the contents of...

  • memory cache
  • disk cache
  • external caches, like the Edge cache

For the ESI processor's cache to be visible in the cache monitor, the DynaCacheEsi.ear application must be installed and the esiInvalidationMonitor property must be set to true in plugin-cfg.xml.

Recommendation Set the esiInvalidationMonitor property in the plugin-cfg.xml file to true.

 

I want to tune cache for my environment

Recommendation Use the Tivoli Performance viewer to study the caching behavior for the applications. Also consider performing the following actions:

  • Increase the priority of cache entries that are expensive to regenerate.

  • Modify timeout of entries so that they stay in memory as long as they are valid.

  • Enable disk offload to store LRU evicted entries.

  • Increase the cache size.

 

Cleaning the disk cache files after installing the fix pack or a new release if we use the disk cache function

Symptom If the server is configured to use the disk cache, delete the disk cache files because the disk cache files are not compatible to the previous version.
Problem Failure to remove the old disk cache files results in a ClassCastException error in the systemerr.log file when you access the cache from the disk.
Recommendation Delete the disk cache...

  1. Note the disk offload location.

    If unknown, go to...

    If the location is not specified, the default directory profile_root/temp/my_node/myserver/_dynacache is used.

  2. Stop the server and delete all the files under the offload location.

  3. If using WAS ND, delete the disk cache files for each server.

 

Set the flush attribute to true on every <jsp:include> tag in the cacheable JSPs file

Symptom When you obtain the JSPs file from the dynamic cache, a part of the page is not displayed.
Problem The flush attribute is set to false on the <jsp: include> tag in the JSP file.
Description When the cacheable JSP file includes another JSP file and if the flush attribute is set to false on the <jsp: include> tag, any data written to the parent output stream before the<jsp: include> tag are not cached.
Recommendation Set flush=true on every <jsp: include> tag in the cacheable JSP file.

 

Dynamic cache limitation when using the JSTL <c:import> tag to include a fragment

Problem When a cacheable fragment is included using the JSPs Standard Tag Library (JSTL) <c:import> tag, part of the page content disappears and part of the page content displays twice on a cache hit.
Description Dynamic cache relies on flushing the content before and after including a fragment so that the parent content before the include is not lost, and also to prevent pulling the child content into the parent fragment.

However, in the case of the JSTL <c:import> tag, the flush=true attribute, which flushes the parent writer before the child fragment is actually invoked, is not supported. Also, JSTL buffers the responses, so that the child writer is not flushed right after the child fragment is done. Subsequently, the child response is pulled into the parent.

Restriction: Dynamic cache will return multiple include statements when the JSTL <c:import> tag is used in a cached JSPs file.

Recommendation To avoid this problem, surround the <c:import> statement with out.flush method statements as follows:

<% out.flush(); %>
<c:import url="DNCParent2.jsp" />
<% out.flush(); %> 





 

Related tasks


Task overview: Using the dynamic cache service to improve performance

 

Related information

Troubleshooting the dynamic cache service
Displaying cache information