Info
This document is valid from 7.10.19.0, for previous versions refer to Guide - Cache Engine Administration (valid to 7.10.18.0).
Note
All relevant setup options are to be configured in advance via dedicated deployment script files, before actually executing the deployment. So be aware that if you modify the Intershop Commerce Management configuration after it is deployed, all changes will be overridden with the settings specified for your deployment.
The Cache Engine provides a mechanism to manage and perform cache operations (clear, enable/disable, configure, etc.) for all Intershop Commerce Management caches on all application servers within the installation. The cache engine is implemented within the cartridge Cache. The Intershop Commerce Management administrator can monitor the cache efficiency and size, refresh the information, and change certain values for some caches.
There are four cache groups that are managed via the cache engine:
There are two implementations of ObjectCaches: An old one, based around the ObjectCache
interface and managed by the Component Framework and a new one, based around the Cache<K,V>
interface and managed by Google Guice. This page shows the configuration and monitoring of both variants.
Configuration of caches can be done with the Configuration Framework. Let CacheID
be the ID of a cache to be configured.
All cache metrics start with intershop_cache_
. Each cache has an individual cache key.
# HELP intershop_cache_hit_total Cache hit totals # TYPE intershop_cache_hit_total counter intershop_cache_hit_total{cache="PromotionsCache",} # HELP intershop_cache_miss_total Cache miss totals # TYPE intershop_cache_miss_total counter intershop_cache_miss_total{cache="PromotionsCache",} # HELP intershop_cache_requests_total Cache request totals, hits + misses # TYPE intershop_cache_requests_total counter intershop_cache_requests_total{cache="PromotionsCache",} # HELP intershop_cache_load_success The number of times the loading of a previously uncached value was successful. # TYPE intershop_cache_load_success counter intershop_cache_load_success{cache="PromotionsCache",} # HELP intershop_cache_load_exception The number of times the loading of a previously uncached value resulted in an exception. # TYPE intershop_cache_load_exception counter intershop_cache_load_exception{cache="PromotionsCache",} # HELP intershop_cache_load_time The total number of nanoseconds the cache has spent loading new values. # TYPE intershop_cache_load_time counter intershop_cache_load_time{cache="PromotionsCache",} # HELP intershop_cache_eviction_total Cache eviction totals, doesn't include manually removed entries # TYPE intershop_cache_eviction_total counter intershop_cache_eviction_total{cache="PromotionsCache",} # HELP intershop_cache_hit_ratio The ratio between cache hits and total cache requests in percent. # TYPE intershop_cache_hit_ratio gauge intershop_cache_hit_ratio{cache="PromotionsCache",} # HELP intershop_cache_size Cache size # TYPE intershop_cache_size gauge intershop_cache_size{cache="PromotionsCache",}
Configuration key | Configuration value | Default |
---|---|---|
intershop.caches.<CacheID>.enabled | A boolean whether this cache should be enabled or disabled | true |
Configuration of caches can be done with the configuration framework. Let CacheID
be the ID of a cache to be configured. The following keys are available:
Configuration key | Configuration value | Default |
---|---|---|
intershop.caches.<CacheID>.guava.config | The string syntax is a series of comma-separated keys or key-value pairs | The value of |
intershop.caches.guava.config | The string syntax is a series of comma-separated keys or key-value pairs that is used as a default in case the cache specific configuration is not set | recordStats,concurrencyLevel=16,initialCapacity=100,maximumSize=2000 |
The value of the key "intershop.caches.<CacheID>.guava.config
" is a string representing the configuration of the cache, according to the specification of Google Guava.
Configuration Parameter | Type | Default |
---|---|---|
concurrencyLevel | integer | 16 |
initialCapacity | integer | 100 |
maximumSize | long | 2000 |
maximumWeight | long | |
expireAfterAccess | duration | |
expireAfterWrite | duration | |
refreshAfterWrite | duration | |
weakKeys | no | |
softValues | no | |
recordStats | yes |
Durations are represented by an integer, followed by one of "d", "h", "m", or "s", representing days, hours, minutes, or seconds respectively. (There is currently no syntax to request expiration in milliseconds, microseconds, or nanoseconds.)
Whitespace before and after commas and equal signs is ignored. Keys may not be repeated; it is also illegal to use the following pairs of keys in a single value:
maximumSize
and maximumWeight
softValues
and weakValues
Example PromotionsCache:
intershop.caches.PromotionsCache.guava.config=recordStats,concurrencyLevel=
16
,initialCapacity=
100
,maximumSize=
10000
Cache management via the cache engine is made possible by means of Java MBeans. MBeans are manageable resources in Java, and in Intershop Commerce Management MBeans are managed with JMX tools (see Guide - JMX and MBean Support). It should be noted that the cache engine handles a number of operations and thus, there is no UI specific to the cache engine in System Management or Commerce Management.
If there are several Intershop Commerce Management clusters in one subnet, a cluster may receive events from a foreign cluster if both clusters happen to be using the same multicast IP and port. In this case, you have to specify a unique multicast IP and port for each cluster in the cache.properties files, located in <IS.INSTANCE.SHARE>/system/config/cluster/.
The corresponding default settings (prefixed intershop.cacheengine.wrapped
) are listed below.
If you intend to use other messaging systems than the default multicast, you must enable and adjust the corresponding intershop.cacheengine
properties (see Guide - Messaging).
intershop.cacheengine.wrapped.messengerClass= com.intershop.beehive.messaging.internal.multicast.MulticastMessenger intershop.cacheengine.wrapped.multicastAddress=239.1.2.3 intershop.cacheengine.wrapped.multicastPort=1234 #intershop.cacheengine.wrapped.multicastInterface= #intershop.cacheengine.wrapped.multicastTimeToLive= #intershop.cacheengine.wrapped.multicastReceiveBufferSize=1048576 intershop.cacheengine.wrapped.multicastListenerThreads=5 intershop.cacheengine.wrapped.multicastPacketSize=65000
To monitor cache activity, select the MBean tab in JVisual VM or JConsole (see Guide - JMX and MBean Support). Expand the com.intershop.enfinity tree structure. The resources (sets of MBeans) we are concerned with are CacheClearProcessor, CacheInformation and ClearableCaches. A description of each resource is listed in the table below.
Cache Resource | Description | ||
---|---|---|---|
com.intershop.enfinity | |||
CacheClearProcessor | This resource empties the objects within the ClearableCaches resource. | ||
BatchCacheClear | Caches included here are cleared as a batch immediately or at a late time. For example, after a product upload has occurred. | ||
InstantCacheClear | Clears all Java VM caches included here based on conditions specified in the Intershop Commerce Management installation. | ||
ORMCacheSyncCacheClear | Clears local caches included here on the Java VM immediately based on conditions specified in the Intershop Commerce Management installation. | ||
CacheInformation | This resource displays cache attribute values (i.e., actual size, HitCount, Ratio, etc.). You can reset the monitor under the operations tab. | ||
ORMCache | Displays data for Intershop Commerce Management classes, connections and transactions monitoring. | ||
PageCache | Displays data for all sites within an Intershop Commerce Management instance. | ||
and more | custom caches | ||
Caches | This resource allows you to configure cache attributes (size, capacity, etc.), clear and enable/disable a cache. | ||
ORMCaches | ORM caches can be cleared here. | ||
ObjectCaches | Object caches can be cleared here. | ||
PageCaches | Page caches can be cleared here. | ||
SearchIndexes | Search index caches can be cleared here. | ||
SearchIndexReloadable | Displays data for content search within a given context (i.e., 'DE Specials' or 'US Specials'). |
Since the administrator must clear one or more caches from time to time, it is important that they are cleared in the following order:
(1) ORM
(2) ObjectCache
(3) SearchIndex
(4) PageCache
When clearing the page cache, it is necessary that the site has page caching enabled as well as keyword processing and text indexing selected. You can view/change the attributes for each site by entering System Management | Site Management | <your-site-name>-Site | Page Cache.