You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by arnout cator <ar...@gmail.com> on 2014/10/09 17:43:18 UTC

correct estimate of the disk cache size

I have noticed that our JCS disk cache seems to grow larger than I expect
it to be. In particular it is double the size I expect it to be. Does
anyone know how we can estimate the size of the disk cache? Let’s say I
have a very simple configuration in which I have 1 region defined. I have
set a Maximum key size of 1000. Would the following calculation be a
correct estimate of the disk cache size?



Maximum Key Size x Average Object Size = Cache Size

1000 x 50 KB = 50 MB



In my environment I am seeing the cache has grown much larger and I am
trying to understand why that might be. I have the following configuration



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.MaxPurgatorySize=64

jcs.auxiliary.DC.attributes.MaxKeySize=1000

jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=250

jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true

jcs.auxiliary.DC.attributes.MaxRecycleBinSize=60

jcs.auxiliary.DC.attributes.EventQueueType=POOLED

jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue

Re: correct estimate of the disk cache size

Posted by Thomas Vandahl <tv...@apache.org>.
On 09.10.14 17:43, arnout cator wrote:
> jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=250

That's the key here.

In general, you would expect the cache size that you calculated.
However, considering the way the disk cache works, this is only true if
your data objects are of exactly the same size (which is very
improbable). So if a new data object is somewhat bigger than the
previously expired one, the cache will append to the cache file and the
file will grow.

If you want to have better control over your disk usage, I'd recommend
to test the BlockDiskCache. It may fit your use case better.

Bye, Thomas.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org