我在EhCache中使用Hibernate的二级缓存。我几乎90%的电话都是只读的。因此,为了提高性能,计划增加应用服务器内存(约16 DB ),并期望EhCache将加载最大的数据并减少我的DB调用。
为此,我做了以下配置
<defaultCache
maxElementsInMemory="10000000"
eternal="true"
timeToIdleSeconds="1200"
timeToLiveSeconds="1200"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
</defaultCache>
<cache name="org.hibernate.cache.StandardQueryCache"
maxElementsInMemory="500"
eternal="true"
overflowToDisk="false">
</cache>
<cache name="org.hibernate.cache.UpdateTimestampsCache"
maxElementsInMemory="500"
eternal="true"
overflowToDisk="false"
memoryStoreEvictionPolicy = "LFU">
</cache>用这个,我试图期待两件事
eternal="true",它将忽略timeToLiveSeconds="1200"。如何在EhCache中重新加载更新的对象?建议您是否可以使用EhCache来提高性能和减少DB调用。
发布于 2017-07-25 07:57:08
用例很好。
https://stackoverflow.com/questions/45232285
复制相似问题