Supporting a greater number of concurrent sessions in Ehcache
When you are using Ehcache as the cache manager in some Interact environments, a high number of concurrent sessions may cause the Interact runtime to exceed its available memory, causing a system slowdown or out-of-memory error. An out-of-memory situation is more likely if you have increased the maxEntriesInCache configuration parameter (Interact > cacheManagement > Caches > InteractCache > maxEntriesInCache) to a number higher than the default setting, although it can occur even with the default setting of a maximum of 100,000 sessions. To avoid this issue, you can reduce the maxEntriesInCache value, or you can follow the instructions here to modify the system memory cache to roll the cached memory over to disk storage. This modification allows many more concurrent sessions than would otherwise be possible.
To prevent the Interact runtime from exceeding the available memory in the Java virtual machine (JVM) memory heap, you can modify the memory caching mechanism to use disk storage for caching the data that exceeds the available memory.
Interact uses an open source distributed caching system called Ehcache for caching data. By default, Interact uses the settings specified by the IBM® Marketing Platform to manage the Ehcache caching. However, you can override those settings for Interact by creating your own Ehcache configuration file that is automatically loaded whenever Interact starts up.
To load a custom Ehcache configuration file on startup, the following must be true:
*
Your JVM must include the parameter interact.ehcache.config property, as in the following example:
-Dinteract.ehcache.config=/temp/abc.xml
You can set a JVM property for your web application server in the startup command script (Oracle WebLogic) or Admin Console (IBM® WebSphere®). The information in /temp/abc.xml is the actual path to the XML file containing the Ehcache configuration you want to load at startup.
*
If you do not set this property, or if you set this property and there is no configuration file at the specified location, Interact uses its default cache configuration.
If both conditions are true, the Ehcache configuration file is loaded on startup, and its settings override any default Interact configuration parameters for caching session data.
The following example shows a sample configuration file (in XML format) that you might use to customize Ehcache:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="../../main/config/ehcache.xsd">

<defaultCache
maxElementsInMemory="10"
eternal="false"
timeToIdleSeconds="5"
timeToLiveSeconds="10"
overflowToDisk="true"
/>

<cache name="InteractCache"
maxElementsInMemory="5"
eternal="false"
timeToIdleSeconds="600"
timeToLiveSeconds="600"
overflowToDisk="true">

<cacheEventListenerFactory
class="com.unicacorp.interact.cache.ehcache.EHCacheEventListenerFactory"
properties=""/>
<!--For InteractCache, use the following to use the
EHCacheEventListenerFactory:-->
<cacheEventListenerFactory
class="com.unicacorp.interact.cache.EHCacheEventListenerFactory"
properties=""/>
<!--For PatternStateCache, use the following to use
the EHCacheEventListenerFactory:-->
<cacheEventListenerFactory
class="com.unicacorp.interact.cache.PatternStateCacheEventListenerFactory"
properties=""/>
</cache>

</ehcache>
If you saved this file as /IBM/Interact/conf/Ehcache.xml, you would then set the JVM property for the web application as in the following example:
-Dinteract.ehcache.config=/IBM/Interact/conf/Ehcache.xml
For a complete list of the options available for modifying the Ehcache software, see http://ehcache.org/files/documentation/EhcacheUserGuide-2.0-2.3.pdf