1

I have set up an EHcache 3 configuration with OnHeap and Disk. However, it seems that when adding a new entry, the put goes through the disk store (this is normal) but not in a asynchronous way. This dramatically affects my performances on put. Did I miss something or is it the normal behaviour? How can I improve put performances when having a disk tier?

ResourcePoolsBuilder poolBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder().heap(heapSize, MemoryUnit.MB); poolBuilder = poolBuilder.disk(diskSize, MemoryUnit.MB, false);

Thanks for your help

Claudio
  • 10,614
  • 4
  • 31
  • 71
Eric
  • 11
  • 3

1 Answers1

1

This isn't true, the Ehcache 3 disk store does write asynchronously to disk as documented here: https://www.ehcache.org/documentation/3.8/thread-pools.html#using-the-configured-thread-pools

By default, the disk store(s) will use the default thread pool that dynamically shrinks and grows up to the CPU count reported by the OS.

If you configure a cache with a disk store and then write to it, you should see some threads with names like this: Ehcache [_default_]-0. Those are the ones responsible for the disk writes.

Ludovic Orban
  • 396
  • 1
  • 6