6

I am using ehcache entreprise 2.7 with big memory. I want to have a cache that overflow to the disk when full AND I want this cache to be persistent through restarts.

My current configuration is that :

<cache name="dataservice"
            eternal="true"
            maxEntriesLocalHeap="1"
            overflowToOffHeap="true"
            maxBytesLocalOffHeap="60M">
    <persistence strategy="localRestartable"/>
</cache>

This configuration makes the cache persistent through restarts ( and it works very well) but it doesn't seem to overflow to the disk. I really want to use "localRestartable" since it works way better than the old attribute diskPersistent="true". "localRestartable" isn't compatible with the attribute overflowToDisk="true"...

Any idea on how I can make my cache overflowing to the disk??

tibo
  • 5,326
  • 4
  • 37
  • 53

2 Answers2

0

I am using something like this and it is not working with restarts(also it is not enterprise version) BUT, I am using some kind of "cach manager" (own solution) - where I am doing backup of all caches into XML files every 20 sec. If is there any better solution - i would appreciate some advice too.

<cache name="dataservice"
   maxElementsInMemory="1000"
   maxElementsOnDisk="10000"
   overflowToDisk="true"
   eternal="true"
   >
 </cache>
Mário Kapusta
  • 488
  • 7
  • 19
0

As of 4.1 at least, BigMemory Go + Ehcache Enterprise does not support what you are looking for. If you enable the localRestartable option, Ehcache will mirror your memory cache to disk (either synchronously or asynchronously). Note that this is not an "overflow" or "spillover" to disk.

"localRestartable" — Enables the Fast Restart feature which automatically logs all BigMemory data. This option provides fast restartability with fault tolerant data persistence. (from http://www.terracotta.org/documentation/4.1/bigmemorygo/configuration/fast-restart)

David J.
  • 31,569
  • 22
  • 122
  • 174