WAS v8.5 > Administer applications and their environment > Welcome to administering Dynamic caching > Administer the dynamic cache service > Use the dynamic cache serviceConfigure dynamic cache disk offload
Use this task to configure dynamic cache disk offload, which saves cache entries that are deleted from the memory cache to disk. By default, when the number of cache entries reaches the configured limit for a given application server, cache entries are removed from the memory cache, allowing newer entries to be stored in the cache. Use disk offload to copy the cache entries that are being removed from the memory cache to disk for potential future access.
- In the dmgr console, click Servers > Server Types > WebSphere application servers > server_name > Container services > Dynamic cache service .
- Select Enable disk offload.
- After you enable the disk offload, we can set the Disk offload location. The disk offload location specifies where to save the cache entries on the disk. The disk offload location must be unique for any application servers that are defined on the same node. If we have multiple servers defined on the same node, make sure the disk offload location is different for each server.
- Enable Flush to disk if you want cache objects that are in memory to be saved to disk when the server is stopped. Disk offload must be enabled if you choose this option. If we do not enable flush to disk, all the cache objects are deleted when the server stops.
- Click Apply or OK.
- Restart WebSphere Application Server.
Results
You enabled disk offload. Memory cache entries are moved to disk for potential future access.
When we have two or more application servers with servlet caching enabled and the application servers specify the same disk offload location for their caches through the dynamic cache service, the following exceptions might occur:
java.lang.NullPointerException at com.ibm.ws.cache.CacheOnDisk.readTemplate(CacheOnDisk.java:686) at com.ibm.ws.cache.Cache.internalInvalidateByTemplate(Cache.java:828)or:
java.lang.NullPointerException at com.ibm.ws.cache.CacheOnDisk.readCacheEntry(CacheOnDisk.java:600) at com.ibm.ws.cache.Cache.getCacheEntry(Cache.java:341)If one server is run as root and the other servers are run as non-root, this problem could occur. For example, if server1 runs as root and server2 runs as wasuser or wasgroup, the cache files in the disk offload location might be created with root permissions. This situation causes the applications running on the non-root servers to crash when they try to read or write to the cache.
Subtopics
- Java virtual machine cache settings
Use this page to set JVM custom properties to maintain cache entries that are saved to disk.- Java virtual machine cache settings
Use this page to set JVM custom properties to maintain cache entries that are saved to disk.
Related
Use the dynamic cache service
Configure Edge Side Include caching
Reference:
Dynamic cache service settings