Ehcache, fast restart and overflow to disk

I am using ehcache entreprise 2.7 with large memory. I want to have a cache that overflows to disk when it is full. And I want this cache to be persistent with a restart.

My current configuration is as follows:

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

This configuration makes the cache persistent by restarting (and it works very well), but it does not seem to overflow to disk. I really want to use "localRestartable" as it works much better than the old diskPersistent = "true" attribute. "localRestartable" is incompatible with the overflowToDisk = "true" attribute ...

Any idea on how I can overlap my cache to disk?

+6
source share
2 answers

I use something like this and it does not work with reboots (also this is not a corporate version). BUT, I use some kind of "cache manager" (my own solution) - where I backup all caches to XML files every 20 seconds. If there is any better solution, I would also admit some advice.

 <cache name="dataservice" maxElementsInMemory="1000" maxElementsOnDisk="10000" overflowToDisk="true" eternal="true" > </cache> 
0
source

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 map your memory cache to disk (synchronously or asynchronously). Please note that this is not “overflow” or “overflow” to disk.

"localRestartable" - Enables a quick restart function that automatically logs all BigMemory data. This option provides fast restart with data fault tolerance. (from http://www.terracotta.org/documentation/4.1/bigmemorygo/configuration/fast-restart )

0
source

Source: https://habr.com/ru/post/943497/


All Articles