Cache Configuration

The CacheConfig.xml file includes the cache configuration. The file is available in the $MQ_HOME/config folder.

The following table describes the Cache attributes listed in the CacheConfig.xml file:

Cache Configuration Parameters
Cache Attributes Descriptions
Server Config
CacheServerCount Defines the number of configured cache servers. However, this number is only for the information purpose.
CharSet Defines the objectsize configuration to be used. The available charsets are singlebyte and multibyte.

If the language that is used in the application contains multi byte characters, specify the multibyte value. For example, multi byte characters are used in French, Japanese, Korean, and so on.

Memory Defines the total memory assigned to the cache servers. This includes the heap storage. The memory allocated for all near and distributed caches is (Memory - HeapStorage).

Memory must be more than heap size. A warning is issued if memory is specified less than 64m or Memory - Heapstorage is less than 64m. By default, memory is set to 512m.

The memory required by external cache servers relies on configuration specified in the CacheConfig.xml file. If the memory is 2048 KB and the heapsize is 512 KB, the memory used by each cache server is as follows: (Memory - HeapStorage) 2048 - 512= 1536 KB. To allocate more memory, you must start more cache servers.

You can preload entire repositories into memory at start up. This takes a while to start. However, after the memory is loaded, it provides significant performance gains. Do not use multivalue attributes that are not stored in the shared tables because preloading such large data takes significantly longer.

HeapStorage Defines the memory allocated for near and local caches. Min heap must be minimum 32m, by default, it is 128m. A warning is issued if heap is specified more than 512m.
OverHead Defines the additional overhead added to objectsize. By default, the overhead factor is 1.5.
ReplicationCount Allows you to keep the data multiple times (typically, duplicating it) so that no single server failure can lead to data loss.

The value are 0 and 1. By default, it is set to 0.

  • If you select 0, keeps one copy of the data.
  • If you select 1, keeps two copies data records on physically different machines.

    For more information, refer to Space Replication.

CacheList
Name Defines the name of the cache server. For example, RECORD. It allows you to keep a track of the cache configurations.
Description Defines the description of the cache. For example, The description for RECORD is 3-4 entries per record.
Type Defines the type of cache servers. The available cache server types are local, distributed, and near.

Specify limit or list size for near caches to avoid mismatch between capacity in heap and in distributed storage.

For distributed caches, if no limit or list size is specified, remaining memory is distributed evenly after memory is assigned to all other caches. The remaining memory must be minimum 32.

ReplicationCount Allows you to keep the data multiple times (typically, duplicating it) so that no single server failure can lead to data loss.

The value are 0 and 1. By default, it is set to 0.

  • If you select 0, keeps one copy of the data.
  • If you select 1, keeps two copies data records on physically different machines.

    For more information, refer to Space Replication.

SingleByteObjectSize Defines the single byte objectsize for the cache server.
MultiByteObjectSize Defines the multi byte objectsize for the cache server.
Limit Defines the limit in which the memory is divided among all cache types, such as, Local, Distributed, and Near.
  • If the Limit is specified, list size is ignored.
  • If limit and list size are not specified for Local and Near caches, the list size is defaulted as 100.
  • It is always recommended to specify limit or list size for Near caches to avoid mismatch between the capacity in heap and in distributed storage.
ListSize Defines the list size of the cache. Use the ListSize to specify the exact capacity. Similarly, specify the Limit if you want the cache to get memory as it grows.
  • To specify the unlimited cache size for the Distributed cache type, remove the <Limit> attribute and specify ListSize = -1.
  • For Near and Local cache types, the unlimited cache size is not supported.
EvictionPolicy Defines eviction policy for a cache. The eviction polices are Least Recently Used (LRU) and None. By default, the eviction policy is set at LRU.
  • If a capacity (number of objects in a cache) is specified, you must specify an eviction policy.
  • For local caches, eviction = LRU is always applied and you cannot specify any other eviction policy.
  • For distributed caches, LRU or NONE must be specified.
  • If you want to keep the caches permanently, do not set LRU.
  • If Limit is specified and EvictionPolicy is not specified, LRU is applied to those caches.
  • If EvictionPolicy (LRU) is set, the least recently used record are deleted and new record are inserted.
  • If EvictionPolicy (LRU) is not set, and the Capacity crosses its limit, the cache does not allow the insertion of a record and the new record insertion fails.

    Note: It is recommended that unless instructed by Support, you should not change the default EvictionPolicy defined in the CacheConfig.xml file.

LockWaitTime Defines the value while waiting for the lock to clear. An application can lock an entry so that the entry cannot be modified (but can still be read) until the lock is explicitly removed. By default, it is set to -1, which means the lock never waits.
LockExpirationTime This property defines the value while lock for an entry expires. By default, it is set to -1, which means the lock never expires.