You are here

Configuring the repository cache

The Alfresco repository provides in-memory caches. These caches are transaction safe and can be clustered. Caches greatly improve repository performance but they use Java heap memory.
Tuning the caches in a wrong way may lead to out of memory issues. The optimal settings to use on the caches depend on your usage and the amount of memory available to your Alfresco server.
An important indicator that you need to tune or increase your caches is when you see a warning message in your alfresco.log file indicating that some specific caches are full, for example:
2016-04-26 17:51:37,127 WARN [] 
[http-apr-22211-exec-42] Transactional update cache 'org.alfresco.cache.node.nodesTransactionalCache' is full (125000).
From Alfresco One version 5.0 and later, the caches can be configured by setting the cache properties in the file. In both clustered and non-clustered cases, caching is configured and used in the same unified way.
Note: It is advisable not to change the cache values unless you have performance issues.
  1. Download the tx-cache-context.xml file and file.

    The file lists a series of properties for configuring a cache. The cache properties are used for both clustered and non-clustered configurations.

  2. Check your alfresco.log file to locate the caches shown in the warning message.

    For example, if you see the following warning message in alfresco.log:

    2016-04-26 17:51:37,127 WARN [] 
    [http-apr-22211-exec-42] Transactional update cache 'org.alfresco.cache.node.nodesTransactionalCache' is full (125000).

    search for the bean that matches the class org.alfresco.repo.cache.TransactionalCache in the tx-cache-context.xml file.

    Here's an example of the cache:

    <!-- The transactional cache for Nodes -->
       <bean name="node.nodesCache" class="org.alfresco.repo.cache.TransactionalCache">
          <property name="sharedCache">
             <ref bean="node.nodesSharedCache" />
          <property name="name">
          <property name="maxCacheSize" value="${cache.node.nodesSharedCache.tx.maxItems}" />
          <property name="mutable" value="true" />
          <property name="allowEqualsChecks" value="true" />
          <property name="disableSharedCache" value="${system.cache.disableMutableSharedCaches}" />
          <property name="cacheStats" ref="cacheStatistics"/>
          <property name="cacheStatsEnabled" value="${cache.node.nodesSharedCache.tx.statsEnabled}"/>

    Note: As shown above, the nodesCache cache uses variables with the cache.node.nodesSharedCache.* syntax, for example, cache.node.nodesSharedCache.tx.maxItems.
    The file uses properties that align with the cache.node.nodesSharedCache syntax.
  3. Add the *.tx.maxItems and *.maxItems properties to the file.
  4. Increase the value of the *.tx.maxItems and *.maxItems properties for the cache you want to tune.

    For example, in the file change the default setting from:

    Note: Make sure that:
    • cache.node.nodesSharedCache.tx.maxItems is not be greater than cache.node.nodesSharedCache.maxItems, and
    • cache.node.nodesSharedCache.maxItems is greater than or equal to cache.node.nodesSharedCache.tx.maxItems.
  5. Restart Alfresco to apply the configuration changes.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.