Java ehcache在每次写入时刷新到磁盘

Java ehcache在每次写入时刷新到磁盘,java,ehcache,Java,Ehcache,我正在使用ehcache作为服务器上的热缓存。我希望它完全在内存中,只为持久性而写入磁盘。从应用程序重新启动时加载 我发现ehcache几乎在每一个缓存上都在向磁盘写入数据。以下是文档中的内容 Operation of a Cache where overflowToDisk is false and diskPersistent is true In this configuration case, the disk will be written on flush or shutdown.

我正在使用ehcache作为服务器上的热缓存。我希望它完全在内存中,只为持久性而写入磁盘。从应用程序重新启动时加载

我发现ehcache几乎在每一个缓存上都在向磁盘写入数据。以下是文档中的内容

Operation of a Cache where overflowToDisk is false and diskPersistent is true

In this configuration case, the disk will be written on flush or shutdown.
The next time the cache is started, the disk store will initialise but will not permit overflow from the
MemoryStore. In all other respects it acts like a normal disk store.
然而,当我检查/mnt/ehcache时,我看到它在每个put上都被写入。为什么会这样

这是我的缓存配置

    <diskStore path="/mnt/ehcache/" />

    <cache 
    name="feedLocalCache" 
    maxEntriesLocalHeap="2000000"
    eternal="false"
    timeToLiveSeconds="1800"
    timeToIdleSeconds="0"         
    diskPersistent="true"
    overflowToDisk="false"
    memoryStoreEvictionPolicy="LFU" >
    <bootstrapCacheLoaderFactory class="net.sf.ehcache.store.DiskStoreBootstrapCacheLoaderFactory" properties="bootstrapAsynchronously=true"/>

将其归咎于文档过时

由于Ehcache 2.6最低层(在您的情况下也称为授权磁盘)始终包含所有映射。这是为了提高延迟的可预测性


因此,您看到的是预期的行为。请注意,磁盘写入是异步的,因此不会影响执行put的线程,除非写入太多,以至于写入队列达到其最大大小。

我的服务器负载很大。我会说我每秒的点击量接近2k,每秒的读取量至少为5k。你知道我怎样才能提高我的表现吗?因为当我做一些分析时,put和get被显示为热点之一。