Uploaded image for project: 'PUBLIC - Liferay Portal Enterprise Edition'
  1. PUBLIC - Liferay Portal Enterprise Edition
  2. LPE-2028

Improved Ehcache performance in large clusters

Details

    Description

      Ehcache's build-in replication mechanism creates a thread for each cache. Liferay portal requires over 200 caches which means each cluster node has 200+ Ehcache replication threads. In addition, Ehcache uses RMI to communicate with other nodes. These two issues makes Ehcache inefficient in a large cluster environment.

      This improvements switches Ehcache's replication mechanism with a new replication mechanism built on ClusterLink. The number of threads need on each cluster node is reduces to 10-20 threads and communication is now node using UDP(JGroups).

      To enable the new replication mechanism:

      1) Because the replication mechanism uses cluster link, set the following in portal(-ext).properties;
      cluster.link.enabled=true

      2) Add the following to the "spring.configs" property in portal(-ext).properties
      META-INF/cache-cluster-spring.xml

      3) Modify Ehcache's cluster configuration files(hibernate-clustered.xml and liferay-multi-vm-clustered.xml).

      A) Remove the cacheManagerPeerProviderFactory and
      cacheManagerPeerListenerFactory tags. These are not needed any more.

      B) Inside each defaultCache and cache entry, replace the following
      <cacheEventListenerFactory ... />
      <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />

      with a single entry

      <cacheEventListenerFactory class="com.liferay.portal.cache.cluster.EhcachePortalCacheClusterReplicatorFactory" />

      Attachments

        Issue Links

          Activity

            People

              pani.gui Pani Gui (Inactive)
              brian.chan Brian Chan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Packages

                  Version Package
                  5.1 EE SP5 (5.1.8)
                  5.2 EE SP4 (5.2.8)