You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by Silvano <me...@ipsoft.it> on 2009/08/18 10:01:25 UTC

Indexed Disk Cache and MaxPurgatorySize

Dear All,

I'm using the Indexed Disk Cache in my application and I encountered 
some strange behavior that I try to summarize following.

The steps are:
1. I fill in the cache using a preliminary job which goal is to 
"warm-up" the cache.
2. When I try to retrieve the same items put in cache during the step 
one, it seems they are not in cache, or at least some of them are missing.
REMARK: As you can see in the configuration chunk below, the elements 
are eternal.

I have already found a problem in the "MaxKeySize" parameter that was 
too small, but after fixing it, the problem is still there :-(

So my questions are:
1. Is it possible that the "MaxPurgatorySize" can lead to this kind of 
problem? I set it to 5000
2. What are the drawbacks if I set "MaxPurgatorySize" equal to -1 
(infinite)? Is there the risk to obtain memory exceptions?
3. What are your suggestions to debug/solve the problem?

Following some details of the configuration:

# DEFAULTS
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.DiskUsagePatternName=UPDATE

# REGION
jcs.region.Common=DC
jcs.region.Common.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.Common.cacheattributes.MaxObjects=50
jcs.region.Common.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.Common.cacheattributes.UseMemoryShrinker=true
jcs.region.Common.cacheattributes.MaxMemoryIdleTimeSeconds=30
jcs.region.Common.cacheattributes.ShrinkerIntervalSeconds=20

jcs.region.Common.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.Common.elementattributes.IsEternal=true

jcs.region.Common.elementattributes.IsSpool=true
jcs.region.Common.elementattributes.IsRemote=false
jcs.region.Common.elementattributes.IsLateral=true

# AUX
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=/usr/local/ptt/liferay/pttCache
jcs.auxiliary.DC.attributes.MaxPurgatorySize=5000
jcs.auxiliary.DC.attributes.MaxKeySize=1000000


If You need the full .ccf I can send you!

Thanks in advance,
    Silvano.



---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: Indexed Disk Cache and MaxPurgatorySize

Posted by Aaron Smuts <as...@yahoo.com>.
Purgatory is a queue with a size limit.  If you exceed the size, by putting a very large number of elements in faster than they can be written to disk, then the oldest will be expelled.  They won't make it to disk, as they've been dropped from the queue.

The danger in having an unlimited queue is that you could run out of memory if there is a tremendous spike. . . .

We need some utility for creating a disk files and then telling the disk cache to use them  . . . 

Aaron

--- On Tue, 8/18/09, Silvano <me...@ipsoft.it> wrote:

> From: Silvano <me...@ipsoft.it>
> Subject: Indexed Disk Cache and MaxPurgatorySize
> To: "JCS Users List" <jc...@jakarta.apache.org>
> Date: Tuesday, August 18, 2009, 1:01 AM
> Dear All,
> 
> I'm using the Indexed Disk Cache in my application and I
> encountered some strange behavior that I try to summarize
> following.
> 
> The steps are:
> 1. I fill in the cache using a preliminary job which goal
> is to "warm-up" the cache.
> 2. When I try to retrieve the same items put in cache
> during the step one, it seems they are not in cache, or at
> least some of them are missing.
> REMARK: As you can see in the configuration chunk below,
> the elements are eternal.
> 
> I have already found a problem in the "MaxKeySize"
> parameter that was too small, but after fixing it, the
> problem is still there :-(
> 
> So my questions are:
> 1. Is it possible that the "MaxPurgatorySize" can lead to
> this kind of problem? I set it to 5000
> 2. What are the drawbacks if I set "MaxPurgatorySize" equal
> to -1 (infinite)? Is there the risk to obtain memory
> exceptions?
> 3. What are your suggestions to debug/solve the problem?
> 
> Following some details of the configuration:
> 
> # DEFAULTS
> jcs.default=DC
> jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.default.cacheattributes.MaxObjects=1000
> jcs.default.cacheattributes.DiskUsagePatternName=UPDATE
> 
> # REGION
> jcs.region.Common=DC
> jcs.region.Common.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.region.Common.cacheattributes.MaxObjects=50
> jcs.region.Common.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> jcs.region.Common.cacheattributes.UseMemoryShrinker=true
> jcs.region.Common.cacheattributes.MaxMemoryIdleTimeSeconds=30
> jcs.region.Common.cacheattributes.ShrinkerIntervalSeconds=20
> 
> jcs.region.Common.elementattributes=org.apache.jcs.engine.ElementAttributes
> jcs.region.Common.elementattributes.IsEternal=true
> 
> jcs.region.Common.elementattributes.IsSpool=true
> jcs.region.Common.elementattributes.IsRemote=false
> jcs.region.Common.elementattributes.IsLateral=true
> 
> # AUX
> 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=/usr/local/ptt/liferay/pttCache
> jcs.auxiliary.DC.attributes.MaxPurgatorySize=5000
> jcs.auxiliary.DC.attributes.MaxKeySize=1000000
> 
> 
> If You need the full .ccf I can send you!
> 
> Thanks in advance,
>    Silvano.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org