【发布时间】:2014-07-07 16:33:55
【问题描述】:
我正在使用 JSC 缓存来存储我的应用程序正在使用的大量对象(超过 10.000.000) 我写了一个快速测试来检查配置,虽然元素似乎存储在缓存中,但当我试图检索它们时,它们中的大多数都不存在。 我使用了一个区域缓存和一个辅助磁盘缓存,你可以从我的配置文件中看到
jcs.region.testCache1=DC
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=1000
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true
jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500
jcs.region.testCache1.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.testCache1.elementattributes.IsEternal=true
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=${user.dir}/jcs_swap
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
jcs.auxiliary.DC.attributes.MaxKeySize=-1
我将永恒属性设置为'true',这样元素就永远不会过期和移除,内存收缩器将元素周期性地放入DiscCache,还有一个MaxKeySize设置为-1的DiscCache,表示它可以托管任何数量的元素。你有没有发现任何配置错误?
当我将此配置与中等数量的元素(~10.000)一起使用时,一切正常。当我使用超过 1.000.000 时,我无法检索大部分元素。
【问题讨论】:
标签: apache caching configuration