-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Ehcache/Hibernate consuming insane amounts of disk
PostPosted: Thu Mar 25, 2010 12:27 pm 
Newbie

Joined: Fri Jan 13, 2006 5:52 pm
Posts: 6
Crossposting this from the EhCache forums, since maybe this is the better place to post this:
---------------------------------------------------------------------------------------------------------------

We are looking at implementing a fully replicated Hibernate/Ehcache solution with a second level cache. Everything persistent on disk, synced via RMI, etc.

All seems to work fine, but we are astounded by the insane amount of disk that is consumed for the disk store.

In our initial test we created 400,000 objects (100,000 of one type and 300,000 of another). Set the cache so it mostly overflows right away to disk.

The size of the two .data files are: 1.2 GB and 445 MB. Each of these object types is a typical Hibernate JPA.

So taking the second example 445 MB (that is 467379000 bytes) is used to store 100,000 POJOs. That comes out to 4673 bytes per POJO, i.e. nearly 4.5 KB.

4.5 KB for a single POJO is insane...what type of data does Hibernate store that mushrooms a POJO that has 10 properties and 2 FKs on it to that size? This should be in bytes, not KBs.

We need to handle volumes of 10,000,000 at first (i.e. 40,000,000 approx. of both types) and potentially up to 100,000,000 in a few years. There is no way we can do this with Hibernate/Ehcache if it eats disk up at this rate.

Any suggestions or clarifications would be welcome.

This is how our Spring Hibernate is configured:

Code:
   <bean id="sessionFactory" parent="sessionFactoryAbstract">
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</prop>
            <prop key="hibernate.jdbc.batch_size">3000</prop>
            <prop key="hibernate.cache.use_second_level_cache">true</prop>
            <prop key="hibernate.cache.use_query_cache">false</prop>
            <prop key="hibernate.cache.use_structured_entries">false</prop>
            <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
            <prop key="net.sf.ehcache.configurationResourceName">META-INF/aps-ehcache.xml</prop>
         </props>
      </property>
   </bean>


And this is how we configured EhCache during testing:

Code:
   <defaultCache
            maxElementsInMemory="1000"
            eternal="true"
            overflowToDisk="true"
            diskSpoolBufferSizeMB="30"
            diskPersistent="true"
            diskAccessStripes="5"
            diskExpiryThreadIntervalSeconds="43200"
            memoryStoreEvictionPolicy="LRU"
      />


We're on Hibernate 3.3.2 and EhCache 2.0.0 (I tried with 1.7.2 and had pretty much the same issue with disk size)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.