Defining Object Cache Instances
Overview
When performing application release automation, some applications require the availability of objects across multiple clones. This can be achieved by creating Object Cache Instances and associating them with a Replication Domain.
Example
This is an example of a configuration section from a Jython file.
#--------------------------------------------------- # Object Cache Instance 1 settings #--------------------------------------------------- # To enable the Object Cache installation installObjectCache = "true" objcScope_1 = 'cell' objcName_1 = "nwp_FD_IntTst02" objcJndiName_1 = "cache/"+objcName_1 objcDescription_1 = "Network Presence" objcCacheSize_1 = "2000" objcDefaultPriority_1 = "1" objcEnableDiskOffload_1 = "false" objcDiskOffloadLocation_1 = "/cache" objcFlushToDiskOnStop_1 = "false" objcDiskCacheSizeInGB_1 = "2" objcDiskCacheSizeInEntries_1 = "0" objcDiskCacheEntrySizeInMB_1 = "0" objcDiskCacheCleanupFrequency_1 = "0" # If 0 then only at midnight objcDiskCachePerformanceLevel = "BALANCED" objcDisableDependencyId_1 = "true" objcUseListenerContext_1 = "false" objcReplicationType_1 = "PUSH" objcPushFrequency_1 = "1" objcEnableCacheReplication_1 = "true" objcMessageBrokerDomainName_1 = serverName objcMemoryCacheSizeInMB_1 = 512 # Disabled if set to 0 objcMemoryCacheHighThreshold_1 = 95 objcMemoryCacheLowThreshold_1 = 80
Mapping the cache in the MapResRefToEjb section:
res1_1 = ["ChordiantEJB", "EJBGatewayServiceCMT", "ChordiantEJB.jar,META-INF/ejb-jar.xml", "cache/nwp", "com.ibm.websphere.cache.DistributedMap", "cache/nwp_FD_IntTst02", "", ""] res1_6 = ["ChordiantEJB", "EJBGatewayServiceBMT", "ChordiantEJB.jar,META-INF/ejb-jar.xml", "cache/nwp", "com.ibm.websphere.cache.DistributedMap", "cache/nwp_FD_IntTst02", "", ""]
Description
Any number of object cache instances can be created. Each parameter is appended with _n where n is an integer.
- objcScope Indicates the scope in which the Object Cache is going to be installed. Possible values are: 'cell', 'node' or 'cluster'.
- objcName A unique name in the format cache name_app name_instance, e.g. nwp_fd_IntTst02
- objcJndiName JNDI name as defined by the developers. Usually of the format cache/objcName, e.g. cache/nwp_fd_IntTst02
- objcDescription Free text field containing description of the cache
- objcCacheSize Number of cache objects
- objcDefaultPriority This parameter is related to eviction. It is the number of passes an object that is a candidate for eviction can have before it is evicted. The higher the value the lower the change of eviction. The default value is 1 for each object cache.
- objcEnableDiskOffload If a cache becomes full you can elect to overflow the cache onto disk. Selection of this option should be considered carefully. There are considerations of disk sharing that need to be taken care of if you wish your objects to be visible to all caches. The value is either true or false. The default value is false.
- objcDiskOffloadLocation Path to disk overflow cache if selected. The default value for this is $WAS_TEMP_DIR.
- objcFlushToDiskOnStop With this value set to true and disk offload has been enabled all objects will be written to disk when the environment is stopped.
- objcDiskCacheSizeInGB The maximum size of disk cache in Gigabytes. The console suggests that the minimum value the can be set to is 2Gb but it appears that (for 6.1.0.13 at the time of writing) the minimum value actually set is 3Gb. The default value is 0 which indicates unlimited size.
- objcDiskCacheSizeInEntries The maximum nember of entries allowed in a disk cache. The default value is 0 which indicates unlimited size.
- objcDiskCacheEntrySizeInMB The maximum size of an individual cache object in Megabytes that can be written to the disk cache. The default value is 0 which indicates unlimited size.
- objcDiskCacheCleanupFrequency The disk cache cleanup frequency in minutes. This setting applies only when the Disk Offload Performance Level is low, balanced, or custom. The default value is 0 which indicates that cleanup only occurs at midnight.
- objcDiskCachePerformanceLevel Offload performance level. Valid values are HIGH, LOW, BALANCED. Default is BALANCED.
- objcDisableDependencyId This value specifies that the dynamic cache service, supports cache entry dependency IDs. Disable this option if you 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 your cache policy. The default value for this is true.
- objcUseListenerContext If this is set to true then invalidation events are sent to invalidations listeners using the J2EE context of the listener for callback. If use of the caller thread context for callback is required it should be set to false.
- objcEnableCacheReplication Setting this to true enables replication of cache IDs, cache entries and cache invalidations with other servers in the replication domain.
- objcMessageBrokerDomainName This is a selection from previously or co-configured replication domains
- objcReplicationType There are several types of replication type values that can be set:
NOT_SHARED: Objects are not replicated. This is the default value. PUSH: The object id and contents are are pushed to all clones as per the push frequency PULL: This setting causes a clone to send out requests to other clones for an object if it does not exist in the local cache. PUSH_PULL: This setting causes the object id to be pushed out only, when a clone requires that object it pulls it from the clone that is holding it in its local cache.
- objcPushFrequency This is a value in seconds for how frequently new or modified objects in a local cache are pushed out to outher caches. A value of 0 means that objects are pushed out immediately. All object invalidations are sent immediately regardless of this setting.
- objcMemoryCacheSizeInMB Specifies a value for the maximum memory cache size in megabytes (MB). If set to 0, the "Limit memory cache size" will be disabled.
- objcMemoryCacheHighThreshold Specifies when the memory cache eviction policy starts. The threshold is expressed in terms of the percentage of the memory cache size in megabytes (MB).
- objcMemoryCacheLowThreshold Specifies when the memory cache eviction policy ends. The threshold is expressed in terms of the percentage of the memory cache size in megabytes (MB).