2 Replies Latest reply on Jul 20, 2018 3:41 AM by SAURABH SUMAN

    Cache configuration in JBOSS EAP 7.1

    SAURABH SUMAN Newbie

      Hi,

       

      I recently migrated our application from JBOSS EAP 6.3 to JBOSS EAP 7.1, But facing a high performance issue as now. I think there is some issue with cache configuration. It will be much appreciating if some one can review my cache configuration and advise on this if I have done something wrong.

       

      <subsystem xmlns="urn:jboss:domain:infinispan:4.0" default-cache-container="hibernate">

         <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">

         <local-cache name="default">

         <transaction mode="BATCH"/>

         </local-cache>

         </cache-container>

         <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">

         <local-cache name="passivation">

         <locking isolation="REPEATABLE_READ"/>

         <transaction mode="BATCH"/>

         <file-store passivation="true" purge="false"/>

         </local-cache>

         </cache-container>

         <cache-container name="ejb" aliases="sfsb" default-cache="passivation"
         module="org.wildfly.clustering.ejb.infinispan">

         <local-cache name="passivation">

         <locking isolation="REPEATABLE_READ"/>

         <transaction mode="BATCH"/>

         <file-store passivation="true" purge="false"/>

         </local-cache>

         </cache-container>

         <cache-container name="hibernate" module="org.hibernate.infinispan" default-cache="local-query">

         <local-cache name="entity">

         <transaction mode="NON_XA"/>

         <eviction strategy="LRU" max-entries="10000"/>

         <expiration max-idle="100000"/>

         </local-cache>

         <local-cache name="local-query">

         <eviction strategy="LRU" max-entries="10000"/>

         <expiration max-idle="100000"/>

         </local-cache>

         <local-cache name="timestamps">

         <transaction mode="NONE"/>

         <eviction strategy="NONE"/>

         </local-cache>

         </cache-container> 

      </subsystem>

       

       

       

       

       

      <subsystem xmlns="urn:jboss:domain:ejb3:5.0">

         <session-bean>

         <stateless>

         <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>

         </stateless>

         <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>

         <singleton default-access-timeout="5000"/>

         </session-bean>

         <mdb>

         <resource-adapter-ref resource-adapter-name="activemq-ra"/>

         <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

         </mdb>

         <pools>

         <bean-instance-pools>

         <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools"
         instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

         <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count"
         instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

         </bean-instance-pools>

         </pools>

         <caches>

         <cache name="simple"/>

         <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>

         </caches>

         <passivation-stores>

         <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>

         </passivation-stores>

         <async thread-pool-name="default"/>

         <timer-service thread-pool-name="default" default-data-store="default-file-store">

         <data-stores>

         <file-data-store name="default-file-store" path="timer-service-data"
         relative-to="jboss.server.data.dir"/>

         </data-stores>

         </timer-service>

         <remote connector-ref="http-remoting-connector" thread-pool-name="default">

         <channel-creation-options>

         <option name="READ_TIMEOUT" value="${prop.remoting-connector.read.timeout:20}" type="xnio"/>

         <option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>

         </channel-creation-options>

         </remote>

         <thread-pools>

       

         <thread-pool name="default">

         <max-threads count="10"/>

         <keepalive-time time="100" unit="milliseconds"/>

         </thread-pool>

         </thread-pools>

         <iiop enable-by-default="false" use-qualified-name="false"/>

         <default-security-domain value="other"/>

         <default-missing-method-permissions-deny-access value="false"/>

         <log-system-exceptions value="true"/>

      </subsystem>

       

      Persistence file :

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence">

         <persistence-unit name="casdm">

         <jta-data-source>java:/jboss/datasources/CollateralDS</jta-data-source>

         <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

         <properties>

         <!-- <property name="hibernate.hbm2ddl.auto" value="update"/>-->
         <property name="hibernate.generate_statistics" value="true"/>

         <property name="hibernate.default_schema" value="s_casdm"/>

         <property name="hibernate.bytecode.use_reflection_optimizer" value="false"/>

         <property name="hibernate.implicit_naming_strategy" value="legacy-jpa"/>

         <!--<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>-->
         <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2012Dialect"/>

         <property name="jboss.entity.manager.jndi.name" value="CASDMManager"/>

         <property name="jboss.entity.manager.factory.jndi.name" value="CASDMFactory"/>

        
         <property name="hibernate.ejb.interceptor"
         value="triggers.interceptor.TriggerInterceptor"/>

         <property name="hibernate.session_factory_name" value="hibernate/server/SessionFactory"/>

         <property name="hibernate.cache.use_query_cache" value="true"/>  
         <property name="hibernate.cache.use_second_level_cache" value="true"/>

         <!--<property name="hibernate.cache.region.factory_class"
        value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>-->
         <property name="hibernate.id.new_generator_mappings" value="false"/> 
         <property name="hibernate.default_batch_fetch_size" value="100"/>

         </properties>

         </persistence-unit>

      </persistence>

       

      I am using INFINISPAN as second level cache...thanks.

        • 1. Re: Cache configuration in JBOSS EAP 7.1
          Paul Ferraro Master

          Can you elaborate on what you mean by "performance issues"?  Other than the 2nd level cache, I can't tell which of the configuration you've pasted is actually used by your application.

          • 2. Re: Cache configuration in JBOSS EAP 7.1
            SAURABH SUMAN Newbie

            Hi Paul..Thanks for the reply...  After migration with JBOSS EAP 7.1 every CRUD operation is taking very long time with respect to JBOSS EAP 6.3. So I am just going to figure out the issues and first want to make sure our cache configuration is fine and according to EAP 7.1 spec.  We tried to use INFINISPAN cache  and posted the persistence file in my previous post. WE are using the below JBOSS cache configuration

             

             

             

            <cache-container name="hibernate" module="org.hibernate.infinispan" default-cache="local-query">

               <local-cache name="entity">

               <transaction mode="NON_XA"/>

               <eviction strategy="LRU" max-entries="10000"/>

               <expiration max-idle="100000"/>

               </local-cache>

               <local-cache name="local-query">

               <eviction strategy="LRU" max-entries="10000"/>

               <expiration max-idle="100000"/>

               </local-cache>

               <local-cache name="timestamps">

               <transaction mode="NONE"/>

               <eviction strategy="NONE"/>

               </local-cache>

               </cache-container>