Configuring cache for catalog search index

Sterling Order Management System Software uses Ehcache, a third-party caching framework, to manage memory that is used by the search index cache.

About this task

With the SearchIndexCache configuration provided by Sterling Order Management System Software, Least Recently Used (LRU) pre-search results for categories and filtered attributes in the catalog search index are cached to disk, thereby reducing the amount of memory usage.

Note: The information in this section describes the out-of-the-box Ehcache configuration values provided by IBM®. For detailed information about Ehcache functionality and how you can configure the elements and settings to enhance your cache for catalog search index, see the Ehcache website. You can also use Ehcache Monitor utility for monitoring Ehcache.

If you use catalog search index, you need to override and configure the out-of-the-box cache XML file provided by Sterling Order Management System Software.

To configure the cache for catalog search index:

Procedure

  1. Copy the <INSTALL_DIR>/resources/cache.xmlas <INSTALL_DIR>/resources/cacheoverride.xml.
  2. Specify the location where the cached data overflow will be stored.

    The disk location can be set in either of the following ways:

    • Specify the path name in the diskStore element of cacheoverride.xml. For example:
      
      <diskStore path="/<pathname>"/>
      
    • If you need to override the disk storage path, specify the path name in the sci.ehcache.disk.store.dir property in the yfs.properties file. The disk storage path is automatically set to be a unique directory under the directory you specified. For additional information about the sci.ehcache.disk.store.dir property, see "Property Files Reference".

      Note that the cached data can be stored either on a shared, central disk that is accessible from all servers, or it can be stored on a local server. If the cached data is stored on a shared disk, each application server requires its own disk store directory, which is named based on the system argument jvmcacheid. If this argument is not passed, the name of the disk store directory is the ServerID of the server.

      Note that if the sci.ehcache.disk.store.dir property is set in the yfs.properties file, the value of this property will override the value of the disk store path set in cacheoverride.xml.

  3. Sterling Order Management System Software provides out-of-the-box cache configuration values for catalog search index in the SearchIndexCache section of cacheoverride.xml. You can modify the values of these elements to suit your business needs.
    For example, refer to Elements in the cacheoverride.xml file for some of the elements that you can modify in the SearchIndexCache section of cacheoverride.xml. In the case of the maxElementsInMemory, an element in the cache consists of each pre-search result that is represented by a bit set for a category or a filtered attribute. The maxElementsInMemory described in this table defaults to 10000, which is a generous estimate. If you would like to adjust this setting higher or lower for your specific requirements, you can estimate this memory requirement by using the following equation:
    (minimum expected memory consumption in bytes)=(total number of active
    catalog items/8) * (maximum elements in memory)

    The divisor of 8 is used to derive the result in bytes. After setting this element, monitor your JVM and consider testing this in a staging environment before implementing it.

    Note: Each pre-search result for a category or a filtered attribute is considered as an element in the cache. The cache is loaded at the 10-minute interval. The old cache is used until the new cache is completely loaded.