2 Replies Latest reply on Sep 4, 2006 5:38 AM by Ben Wang

    maxNodes for LRUPolicy is not respected!!!!!!!

    Mike Cev Newbie

      I am setting LRU Eviction policy with miltiple regions but it seems like maxNodes settings are not respected. I read the following xml and use setEvictionPolicyConfig(Element a_config) so set policy. Region /reportDefinition/extraInfo is setup to live 30sec and have max node of 2 but when I dump my cache I see 5 nodes. Cache dump output is at the end of this post.

      Here is the XML for eviction :

       <config>
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">1000</attribute>
       </region>
       <region name="/org/jboss/data">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLiveSeconds">1000</attribute>
       </region>
       <region name="/org/jboss/test/data">
       <attribute name="maxNodes">5</attribute>
       <attribute name="timeToLiveSeconds">4</attribute>
       </region>
       <!-- ReportDefinition approximate object size:
       1000Kb > very small > 0
       3000Kb > small > 100Kb
       5000Kb > medium > 3000Kb
       10000Kb > large > 5000Kb
       very large > 10000Kb
       -->
       <region name="/reportDefinition/verysmall">
       <attribute name="maxNodes">25</attribute>
       <attribute name="timeToLiveSeconds">3600</attribute>
       </region>
       <region name="/reportDefinition/small">
       <attribute name="maxNodes">15</attribute>
       <attribute name="timeToLiveSeconds">1800</attribute>
       </region>
       <region name="/reportDefinition/medium">
       <attribute name="maxNodes">15</attribute>
       <attribute name="timeToLiveSeconds">1800</attribute>
       </region>
       <region name="/reportDefinition/large">
       <attribute name="maxNodes">8</attribute>
       <attribute name="timeToLiveSeconds">1800</attribute>
       </region>
       <region name="/reportDefinition/verylarge">
       <attribute name="maxNodes">5</attribute>
       <attribute name="timeToLiveSeconds">1800</attribute>
       </region>
       <region name="/reportDefinition/extraInfo">
       <attribute name="maxNodes">2</attribute>
       <attribute name="timeToLiveSeconds">30</attribute>
       </region>
       <!-- The following regions are cached for 8 hrs -->
       <region name="/gpPackage">
       <attribute name="maxNodes">100</attribute>
       <attribute name="timeToLiveSeconds">28800</attribute>
       </region>
       <region name="/translation">
       <attribute name="maxNodes">25</attribute>
       <attribute name="timeToLiveSeconds">28800</attribute>
       </region>
       <region name="/reportConfigPool">
       <attribute name="maxNodes">1</attribute>
       <attribute name="timeToLiveSeconds">28800</attribute>
       </region>
       </config>
      
      
      

      Here is the TreeCache.xml:
      !-- ===================================================================== -->
      <!-- -->
      <!-- Customized TreeCache Service Configuration for Tomcat 5 Clustering -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <server>
      
       <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
      
       <mbean
       code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
       name="mydomain:service=proxyFactory,type=jrmp,target=factory">
       <attribute
       name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
       <attribute
       name="TargetName">jboss.cache:service=TreeCache</attribute>
       <attribute name="JndiName">brsTreeCache</attribute> <attribute
       name="InvokeTargetMethod">true</attribute> <attribute
       name="ExportedInterface">org.jboss.cache.TreeCacheMBean</attribute>
       <attribute name="ClientInterceptors"> <iterceptors>
       <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
       <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
       <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
       </iterceptors> </attribute>
       <depends>jboss:service=invoker,type=jrmp</depends>
       <depends>jboss.cache:service=TreeCache</depends>
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- Defines TreeCache configuration -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.cache.TreeCache"
       name="jboss.cache:service=TreeCache">
      
       <depends>jboss:service=Naming</depends>
       <depends>jboss:service=TransactionManager</depends>
      
       <!-- Enables marshalling which will be used during cluster replication -->
       <attribute name="UseMarshalling">true</attribute>
      
       <!-- Configure the TransactionManager -->
       <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
      
      
       <!--
       Node locking level : SERIALIZABLE
       REPEATABLE_READ (default)
       READ_COMMITTED
       READ_UNCOMMITTED
       NONE
       -->
       <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
      
       <!--
       Valid modes are LOCAL
       REPL_ASYNC
       REPL_SYNC
       -->
       <attribute name="CacheMode">REPL_ASYNC</attribute>
      
       <!-- Name of cluster. Needs to be the same for all clusters, in order
       to find each other
       -->
       <attribute name="ClusterName">${jboss.partition.name}-main-treecache</attribute>
      
      
       <!-- JGroups protocol stack properties. Can also be a URL,
       e.g. file:/home/bela/default.xml
       <attribute name="ClusterProperties"></attribute>
      -->
      
      
       <attribute name="ClusterConfig">
       <config>
       <!-- UDP: if you have a multihomed machine,
       set the bind_addr attribute to the appropriate NIC IP address -->
       <!-- UDP: On Windows machines, because of the media sense feature
       being broken with multicast (even after disabling media sense)
       set the loopback attribute to true -->
       <UDP mcast_addr="228.1.2.3" mcast_port="48866"
       ip_ttl="64" ip_mcast="true"
       mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
       ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
       loopback="false"/>
       <PING timeout="2000" num_initial_members="3"
       up_thread="false" down_thread="false"/>
       <MERGE2 min_interval="10000" max_interval="20000"/>
       <FD shun="true" up_thread="true" down_thread="true"/>
       <VERIFY_SUSPECT timeout="1500"
       up_thread="false" down_thread="false"/>
       <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
       max_xmit_size="8192" up_thread="false" down_thread="false"/>
       <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
       down_thread="false"/>
       <pbcast.STABLE desired_avg_gossip="20000"
       up_thread="false" down_thread="false"/>
       <FRAG frag_size="8192"
       down_thread="false" up_thread="false"/>
       <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
       shun="true" print_local_addr="true"/>
       <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
       </config>
       </attribute>
      
      
       <!--
       The max amount of time (in milliseconds) we wait until the
       initial state (ie. the contents of the cache) are retrieved from
       existing members in a clustered environment
       -->
       <attribute name="InitialStateRetrievalTimeout">5000</attribute>
      
       <!--
       Number of milliseconds to wait until all responses for a
       synchronous call have been received.
       -->
       <attribute name="SyncReplTimeout">10000</attribute>
      
       <!-- Max number of milliseconds to wait for a lock acquisition -->
       <attribute name="LockAcquisitionTimeout">15000</attribute>
      
      
       <!-- Name of the eviction policy class. -->
       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">1000</attribute>
       </region>
       <region name="/org/jboss/data">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLiveSeconds">1000</attribute>
       </region>
       <region name="/org/jboss/test/data">
       <attribute name="maxNodes">5</attribute>
       <attribute name="timeToLiveSeconds">4</attribute>
       </region>
      
       </config>
       </attribute>
      
       </mbean>
      
      </server>
      


      Cache Dump:

      Node: /
      [31-08-2006 11:13:03.843] [292677] [STDOUT] [INFO ] [TP-Processor2] <Empty Node>
      [31-08-2006 11:13:03.843] [292677] [STDOUT] [INFO ] [TP-Processor2] Node: /translation
      [31-08-2006 11:13:03.843] [292677] [STDOUT] [INFO ] [TP-Processor2] enGeneric=com.bfm.app.viewserver.report.translation.VSTranslation@840613
      [31-08-2006 11:13:03.843] [292677] [STDOUT] [INFO ] [TP-Processor2] Node: /reportDefinition
      [31-08-2006 11:13:03.843] [292677] [STDOUT] [INFO ] [TP-Processor2] <Empty Node>
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] Node: /reportDefinition/medium
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] check_oad.amg_COREP/TR-MULTI///=com.bfm.app.viewserver.treedefinition.ReportDefinition@1ab0214
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] null/null///=com.bfm.app.viewserver.treedefinition.ReportDefinition@157e43
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] Node: /reportDefinition/extraInfo
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] libor_sum6/TR-MULTI///=com.bfm.app.viewserver.treedefinition.RptDefCacheInfo@11484a7
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] j_active/TR-MULTI///=com.bfm.app.viewserver.treedefinition.RptDefCacheInfo@110710
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] check_oad/TR-MULTI///=com.bfm.app.viewserver.treedefinition.RptDefCacheInfo@1e6badb
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] krd_pv_active/TR-MULTI///=com.bfm.app.viewserver.treedefinition.RptDefCacheInfo@f5b942
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] nlaf_ancillary_fi/TR-MULTI///=com.bfm.app.viewserver.treedefinition.RptDefCacheInfo@55a6ce
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2]
      Node: /reportDefinition/small
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] libor_sum6/TR-MULTI///=com.bfm.app.viewserver.treedefinition.ReportDefinition@13a26c2
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] j_active/TR-MULTI///=com.bfm.app.viewserver.treedefinition.ReportDefinition@c6bf80
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] krd_pv_active/TR-MULTI///=com.bfm.app.viewserver.treedefinition.ReportDefinition@467a3b
      [31-08-2006 11:13:03.853] [292687] [STDOUT] [INFO ] [TP-Processor2] Node: /authentication_authorization
      [31-08-2006 11:13:03.883] [292717] [STDOUT] [INFO ] [TP-Processor2] com.bfm.app.viewserver.util.collection.ThreeStringKey@f094f2[field1=mcevikce,field2=,field3=fi-tr-multi]=com.bfm.app.viewserver.util.ldap.LDAPCachedCredential@102f00c
      [31-08-2006 11:13:03.893] [292727] [STDOUT] [INFO ] [TP-Processor2] com.bfm.app.viewserver.util.collection.ThreeStringKey@fa0801[field1=mcevikce,field2=,field3=]=com.bfm.app.viewserver.util.ldap.LDAPCachedCredential@1ddcf6e