LiveSite JCS Cache Settings

10 January 2009
by Gavin Colborne

Thanks to Steve Russell from Realise for the below configurations for JCS Cache.
Here’s the properties you can set in JCS via cache.ccf in “./profiles/base/installedApps/nd_cellname/LiveSite Run Time.ear/iw-runtime.war/WEB-INF/classes/”…
JCS details here (http://jakarta.apache.org/jcs/getting_started/intro.html)

Property

Description

MaxObjects

The maximum number of items allowed in memory. Eviction of elements in excess of this number is determined by the memory cache. By default JCS uses the LRU memory cache.

MemoryCacheName

This property allows you to specify what memory manager you would like to use. You can create your own memory manager by implementing the org.apache.jcs.engine.memory.MemoryCache interface. Alternatively, you can extend the org.apache.jcs.engine.memory.AbstractMemoryCache class. Several different memory caches are available: two LRU implementations, an LFU, and an adaptive replacement algorithm.

UseMemoryShrinker

By default, the memory shrinker is shared by all regions that use the LRU memory cache. The memory shrinker iterates through the items in memory, looking for items that have expired or that have exceeded their max memory idle time.

MaxMemoryIdleTimeSeconds

This is only used if you are using the memory shrinker. If this value is set above -1, then if an item has not been accessed in this number of seconds, it will be spooled to disk if the disk is available. You can register an event handler on this event.

ShrinkerIntervalSeconds

This specifies how often the shrinker should run, if it has been activated. If you set UseMemoryShrinker to false, then this setting has no effect.

DiskUsagePattern

SWAP is the default. Under the swap pattern, data is only put to disk when the max memory size is reached. Since items puled from disk are put into memory, if the memory cache is full and you get an item off disk, the lest recently used item will be spooled to disk. If you have a low memory hit ration, you end up thrashing. The UPDATE usage pattern allows items to go to disk on an update. It disables the swap. This allows you to persist all items to disk. If you are using the JDBC disk cache for instance, you can put all the items on disk while using the memory cache for performance, and not worry about lossing data from a system crash or improper shutdown. Also, since all items are on disk, there is no need to swap to disk. This prevents the possibility of thrashing.

Our Latest News