Object cache instance settings
An object cache instance is a location, in addition to the default shared dynamic cache, where any Java EE application can store, distribute, and share data. This gives applications greater flexibility and better tuning of the cache resources. Use the DistributedMap programming interface to access this cache instance. See the API documentation for more information.
From the admin console, click Resources > Cache instances > Object cache instances > cache_instance_name.
Name
Required display name for the resource. The name must be unique within the cell.
Even though the CacheInstance resources can be created within different scopes, these resources must have unique names so that each of the CacheProviders within the cell can be uniquely identified.
JNDI name
JNDI name for the resource. Use this name when looking up a reference to this cache instance. The results return a DistributedMap object.
The name must be unique within a scope.
Description
Description for the resource. This field is optional.
Category
Category string to classify or group the resource. This field is optional.
Cache size
Positive integer for the maximum number of entries the cache holds. The cache size is usually in the thousands.
Information Value Default 2000 Range 100 - 200,000
Default priority
Default priority for servlets that can be cached. This value determines how long an entry stays in a full cache.
The recommended value is one. The range is one through 255.
Enable disk offload
Specifies if disk offloading is enabled.
If we have disk offload disabled, when a new entry is created while the cache is full, the priorities are configured for each entry and the least recently used algorithm are used to remove the entry from the cache in memory. If we enable disk offload, the entry that would be removed from the cache is copied to the local file system. The location of the file is specified by the disk offload location.
To improve disk offload performance, use only one hard disk drive for each JVM.
Information Value Default false
Offload location
Directory used for disk offload.
If disk offload location is not specified, the default location, ${WAS_TEMP_DIR}/node/server name/_dynacache/cache JNDI name will be used. If disk offload location is specified, the node, server name, and cache instance name are appended. For example, ${USER_INSTALL_ROOT}/diskoffload generates the location as ${USER_INSTALL_ROOT}/diskoffload/node/server name/cache JNDI name. This value is ignored if disk offload is not enabled.
The default value of the ${WAS_TEMP_DIR} property is ${USER_INSTALL_ROOT}/temp. If we change the value of the ${WAS_TEMP_DIR} property after starting the product, but do not move the disk cache contents to the new location:
- The Application Server creates a new disk cache file at the new disk offload location.
- If the Flush to disk setting is enabled, all the disk cache content at the old location is lost when restarting the Application Server
Flush to disk
Specifies if in-memory cached objects are saved to disk when the server is stopped. This value is ignored if Enable Disk Offload is not selected.
Information Value Default false
Limit disk cache size in GB
Maximum disk cache size in GB. When selected, we can specify a positive integer value. Leaving this option blank indicates an unlimited size. This setting applies only if enable disk offload is specified for the cache.
Information Value Value 0 to MAXINT. A value of 0 indicates unlimited size.
Limit disk cache size in entries
Maximum disk cache size in number of entries. When selected, we can specify a positive integer value. Leaving this option blank indicates an unlimited size. This setting applies only if enable disk offload is specified for the cache.
Information Value Value 0 to MAXINT. A value of 0 indicates unlimited size.
Limit disk cache entry size
Maximum size of an individual cache entry in MB. Any cache entry larger than this, when evicted from memory, will not be offloaded to disk. When selected, we can specify a positive integer value. Leaving this option blank indicates an unlimited size. This setting applies only if enable disk offload is specified for the cache.
Information Value Value 0 to MAXINT. A value of 0 indicates unlimited size.
Performance settings
Level of performance required by the disk cache. This setting applies only if enableDiskOffload is specified for the cache. Performance levels determine how memory resources should be used on background activity such as cache cleanup, expiration, garbage collection, and so on. This setting applies only if enable disk offload is specified for the cache.
Information Value High performance and high memory usage Indicates that all metadata will be kept in memory. Balanced performance and balanced memory usage Indicates some metadata will be kept in memory. This is the default performance setting and will provide an optimal balance of performance and memory usage for most users. Low performance and low memory usage Indicates that limited metadata will be kept in memory. Custom performance Indicates that the administrator will explicitly configure the memory settings that will be used to support the above background activity. The administrator sets these values using the DiskCacheCustomPerformanceSettings object.
Disk cache cleanup frequency
Disk cache cleanup frequency, in minutes. If 0, the cleanup runs only at midnight. This setting applies only when the Disk Offload Performance Level is low, balanced, or custom. The high performance level does not require disk cleanup, and this value is ignored.
Information Value Value 0 to 1440
Maximum buffer for cache identifiers per metaentry
Maximum number of cache identifiers stored for an individual dependency ID or template in the disk cache metadata in memory. If this limit is exceeded the information is offloaded to the disk. This setting applies only when the disk offload performance level is custom.
Information Value Value 100 to MAXINT
Maximum buffer for dependency identifiers
Maximum number of dependency identifier buckets in the disk cache metadata in memory. If this limit is exceeded the information is offloaded to the disk. This setting applies only when the disk cache performance level is custom.
Information Value Value 100 to MAXINT
Maximum buffer for templates
Maximum number of template buckets in the disk cache metadata in memory. If this limit is exceeded the information is offloaded to the disk. This setting applies only when the disk cache performance level is custom.
Information Value Value 10 to MAXINT
Eviction policy algorithm
Eviction algorithm that the disk cache will use to evict entries once the high threshold is reached. This setting applies only if enable disk offload is specified for the cache.
Information Value None No eviction policy, so the disk cache can grow until it reaches its limit at which time the dynamic cache service stops writing to disk Random When the disk size reaches a high threshold limit, the disk cache garbage collector wakes up and randomly picks entries on the disk and evicts them until the size reaches a low threshold limit. Size When the disk size reaches a high threshold limit, the disk cache garbage collector wakes up and picks the largest entries on the disk and evicts them until the disk size reaches a low threshold limit.
High threshold
Specifies when the eviction policy runs. The threshold is expressed in terms of the percentage of the disk cache size in GB or entries. The disk cache garbage collector is awaken when the disk size exceeds high threshold limit. The lower value limits disk cache size in GB and disk cache size in entries. This setting does not apply when the disk cache eviction policy is set to none.
Information Value Values 1 to 100
Low threshold
Specifies when the eviction policy ends. The threshold is expressed in terms of the percentage of the disk cache size in GB or entries. The lower value limits disk cache size in GB and disk cache size in entries. The disk cache garbage collector, when awaken, evicts entries until the disk size reaches the low threshold limit. This setting does not apply when the disk cache eviction policy is set to none.
Information Value Values 1 to 100
Use listener context
Set this value to true to have invalidation events sent to registered invalidation listeners using the Java EE context of the listener. To use listener Java EE context for callback, set this value to true. To use the caller thread context for callback, set this to false.
Dependency ID support
That the dynamic cache service, supports cache entry dependency IDs. Disable this option if we do not need to use dependency IDs. Dependency IDs specify additional cache group identifiers that associate multiple cache entries to the same group identifier in the cache policy.
This option might not be available for cache instances that were created with a previous version of the product.
Information Value Default true
Enable cache replication
Use cache replication to enable sharing of cache IDs, cache entries, and cache invalidations with other servers in the same replication domain.
This option might be unavailable for cache instances created with a previous version of the product.
Full group replication domain
Replication domain from which the data is replicated.
Replication domain from which the data is replicated. Choose from any replication domains that have been defined. If there are no replication domains listed, create one during cluster creation or manually in the administrative console by clicking Environment > Internal replication domains > New. The replication domain we choose to use with the dynamic cache service must be using a Full group replica. Do not share replication domains between replication consumers. Dynamic cache should use a different replication domain from session manager or stateful session beans.
Replication type
The global sharing policy for this cache instance.
The following settings are available:
- Both push and pull sends the cache ID of newly updated content to other servers in the replication domain. Then, if one of the other servers requests the content, and that server has the ID of the cache entry for the previously updated content, it will retrieve the content from the publishing server. If a request is made for an ID which has not been previously published, the server assumes it does not exist in the cluster and creates a new entry.
- Pull only shares cache entries for this object between application servers on demand. If an application server gets a cache miss for this object, it queries the cooperating application servers to see if they have the object. If no application server has a cached copy of the object, the original application server runs the request and generates the object. These entries cannot store non-serializable data. This mode of sharing is not recommended.
- Push only sends the cache ID and cache content of new content to all other servers in the replication domain.
- The sharing policy of Not Shared results in the cache ID and cache content not being shared with other servers in the replication domain.
The default setting for a an environment without clustering is Not Shared. When enabling replication, the default value is Not Shared.
Push frequency
Time, in seconds, to wait before pushing new or modified cache entries to other servers.
If we set this property value to 1 (one) or greater, the application server pushes all cache entries created or modified during the time period to other servers. If we set the property to 0 (zero) or a negative value, the application server converts the property value to the default value, which is 1 (one).
Use the DistributedMap and DistributedObjectCache interfaces for the dynamic cache Object cache instance collection