5.1 EE SP4 (5.1.7), 5.2 EE SP3 (5.2.7)
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;
2) Add the following to the "spring.configs" property in portal(-ext).properties
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" />
- is related to
LPS-6647 Swap out ehcache's build-in replication mechanism for better scalability.