i use ehcache hibernate second level cache , query caching. fine, cpu have 100 per cent 10 users via jmeter. if disable ehcache, cpu becomes appropriate. have opinions on this? instead of improving performance, ehcache loaded cpu.
it's dependency:
<dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-ehcache</artifactid> <version>4.3.8.final</version> </dependency>
ehcache.xml
<?xml version="1.0" encoding="utf-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/xmlschema-instance " xsi:nonamespaceschemalocation="ehcache.xsd" updatecheck="true" name="cachemanager" monitoring="autodetect" dynamicconfig="true"> <diskstore path="user.home/ehcacheentriesstore" /> <defaultcache maxentrieslocalheap="100" eternal="false" timetoidleseconds="10" timetoliveseconds="10" diskspoolbuffersizemb="30" maxentrieslocaldisk="1000" diskexpirythreadintervalseconds="1200" memorystoreevictionpolicy="lru" statistics="false"> <persistence strategy="localtempswap"/> </defaultcache> <cache name="servicecache" maxbyteslocalheap="500m" eternal="false" timetoidleseconds="300" overflowtodisk="true" maxelementsondisk="1000" memorystoreevictionpolicy="lru"/> <cache name="org.hibernate.cache.standardquerycache" maxentrieslocalheap="50000" eternal="false" timetoliveseconds="300"> <persistence strategy="localtempswap"/> </cache> <cache name="org.hibernate.cache.spi.updatetimestampscache" maxentrieslocalheap="50000" eternal="true"> <persistence strategy="localtempswap"/> </cache> </ehcache>
persistence.xml
<properties> <property name="hibernate.dialect" value="org.hibernate.dialect.postgresql9dialect"/> <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.jbossappserverjtaplatform"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.singletonehcacheregionfactory"/> <property name="hibernate.cache.use_second_level_cache" value="true"/> <property name="hibernate.cache.use_query_cache" value="true"/> <property name="net.sf.ehcache.configurationresourcename" value="ehcache.xml"/> <property name="hibernate.cache.default_cache_concurrency_strategy" value="transactional"/> <property name="hibernate.max_fetch_depth" value="4"/> <property name="hibernate.auto_close_session" value="true"/> <!--<property name="hibernate.transaction.flush_before_completion" value="true"/>--> <property name="hibernate.transaction.auto_close_session" value="true" /> <property name="hibernate.c3p0.timeout" value="30" /> <!--<property name="hibernate.generate_statistics" value="true"/>--> <!--<property name="hibernate.cache.use_structured_entries" value="true"/>--> </properties
>
Comments
Post a Comment