Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Work in Progress!

This page is a Work in Progress! I'll continue to add details over the next few days...

The default uPortal 3 Cache Configuration files are:

Configuring Distributed Caching

Configuration

  1. Configure a cacheManagerPeerProviderFactory in ehcache.xml
    <!--
     | The rmiUrls is a list of the cache peers of the server being configured.
     | Do not include the server being configured in the list.
     +-->
    <cacheManagerPeerProviderFactory
    		class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
    		properties="peerDiscovery=manual,
    		rmiUrls=${CACHE_PROVIDER_RMIURLS}"/>
    
  2. Configure a cacheManagerPeerListenerFactory in ehcache.xml
    <cacheManagerPeerListenerFactory
    		class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
    		properties="//hostname=${CACHE_LISTENER_HOSTNAME},port=${CACHE_LISTENER_PORT},
    		socketTimeoutMillis=120000"/>
    
    
  3. Configure each specific cache that you would like distribute via cacheEventListenerFactory in ehcache.xml
    <cache name="org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE"
        eternal="false" maxElementsInMemory="150" overflowToDisk="false" diskPersistent="false" 
        timeToIdleSeconds="0" timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU">
        <cacheEventListenerFactory
                class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
                properties="replicateAsynchronously=true, replicatePuts=false,
                replicateUpdates=false, replicateUpdatesViaCopy=false,
                replicateRemovals=true "/>
    </cache>
    

    Important!

    It is important to note that we have configured each cache to use a "invalidation only" strategy by configuring only replicateRemovals=true (i.e. - no puts or updates). As I understand it, not everything that is currently being cached in uPortal 3 is guaranteed to implement java.io.Serializable and therefore may not be replicated across instances. Furthermore, using an invalidation strategy should reduce network traffic.

We chose to enable the distribution of the following caches:

uPortal Framework Caches

  • org.jasig.portal.security.provider.AuthorizationImpl.AUTH_PRINCIPAL_CACHE
  • org.jasig.portal.groups.CompositeEntityIdentifier.NAME_PARSE_CACHE
  • org.jasig.services.persondir.USER_INFO
  • org.jasig.portal.channels.CONTENT_CACHE
  • org.jasig.portal.layout.dlm.LAYOUT_CACHE
  • org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_CACHE
  • org.jasig.portal.utils.ResourceLoader.RESOURCE_URL_NOT_FOUND_CACHE

uPortal IBasicEntity Caches

  • org.jasig.portal.ChannelDefinition
  • org.jasig.portal.groups.IEntityGroup
  • org.jasig.portal.groups.IEntity
  • org.jasig.portal.security.IPermissionSet

We did NOT enable distribution of the Hibernate Caches or Portal Stats Hibernate Caches.

Monitoring ehcache using JMX and JConsole

ehcache Management and Statistics are enabled in the jmxContext.xml Spring configuration file:

<!-- Ref to the mbean server -->
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="true" />
</bean>
	.
	.
	.
<!-- EhCache management and statistics -->
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetClass" value="net.sf.ehcache.management.ManagementService" />
    <property name="targetMethod" value="registerMBeans" />
    <property name="arguments">
        <list>
            <ref bean="cacheManager" />
            <ref bean="mbeanServer" />
            <value>true</value>
            <value>true</value>
            <value>true</value>
            <value>true</value>
        </list>
    </property>
</bean>

Distributed Caching with ehcache
http://ehcache.sourceforge.net/documentation/distributed_caching.html

Distributed Caching Using the JCACHE API and ehcache, Including a Case Study on Wotif.com (A nice caching overview article)
http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-6175.pdf

Remote Network debugging and monitoring for Distributed Caches
http://ehcache.sourceforge.net/documentation/remotedebugger.html

JMX Management and Monitoring
http://ehcache.sourceforge.net/documentation/jmx.html

The Apache Tomcat 5.5 Servlet/JSP Container - Monitoring and Managing Tomcat
http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html

Monitoring and Management Using JMX
http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html

Using JConsole to Monitor Applications
http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

  • No labels