Your configuration is very messed up. For example, the purgatory size setting is an attribute of the disk cache auxiliary, not the cache region. Please read the documentation, follow the examples, and write back if you have any problems.
Aaron --- On Wed, 9/17/08, Manfred Quasten <[EMAIL PROTECTED]> wrote: > From: Manfred Quasten <[EMAIL PROTECTED]> > Subject: Re: configuration jcs remote rmi cache > To: "JCS Users List" <jcs-users@jakarta.apache.org> > Date: Wednesday, September 17, 2008, 10:26 AM > I've configured 2 queues: one on client side and one on > serverside. I > use the client side queue that I do not need more than 64 > M heapsize > and that at serverside, > that I will not write "too fast" to disk. My > problem is, not all > objects are written to disk. When I try to read the > objects, that I've > written before, I 'll lose a few (only a few, less than > 100 from 50000) > but I think there is > still a mistake in my configuration: I' ve tried with > (with BLOCKED and > RUN too) > > thread_pool.disk_cache_event_queue.whenBlockedPolicy=WAIT > > > When I run the client (and write the 50000 objects to the > server) I see > (with netstat -a) that the port 1102 is used more than > one times .... > Can this be a problem (thread save) ? > > > This are my configurations for client and server > > > jcs.auxiliary.RC=org.apache.jcs.auxiliary.remote.RemoteCacheFactory > jcs.auxiliary.RC.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes > jcs.auxiliary.RC.attributes.FailoverServers=pchl:1102 > jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true > jcs.auxiliary.RC.attributes.GetOnly=false > > > > #Regions preconfirgured for caching > > jcs.region.myRegion1=RC > jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.region.myRegion1.cacheattributes.MaxObjects=-1 > jcs.region.myRegion1.cacheattributes.MaxPurgatorySize=100 > jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > > > jcs.auxiliary.RC.attributes.EventQueueType=POOLED > jcs.auxiliary.RC.attributes.EventQueuePoolName=disk_cache_event_queue > > > # Disk Cache pool > thread_pool.disk_cache_event_queue.boundarySize=50 > thread_pool.disk_cache_event_queue.useBoundary=true > thread_pool.disk_cache_event_queue.maximumPoolSize=15 > thread_pool.disk_cache_event_queue.minimumPoolSize=1 > thread_pool.disk_cache_event_queue.keepAliveTime=3500 > thread_pool.disk_cache_event_queue.startUpSize=1 > thread_pool.disk_cache_event_queue.whenBlockedPolicy=WAIT > > > > > server: > > # Remote RMI Cache set up to failover > jcs.auxiliary.RC=org.apache.jcs.auxiliary.remote.RemoteCacheFactory > jcs.auxiliary.RC.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes > jcs.auxiliary.RC.attributes.FailoverServers=localhost:1102,localhost:1103 > jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true > jcs.auxiliary.RC.attributes.GetOnly=false > > > # Registry used to register and provide the > # IRemoteCacheService service. > registry.host=localhost > registry.port=1102 > # call back port to local caches. > remote.cache.service.port=1102 > # cluster setting > remote.cluster.LocalClusterConsistency=true > remote.cluster.AllowClusterGet=true > > > ############################################################## > ##### Default Region Configuration > jcs.default=RC > jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.default.cacheattributes.MaxObjects=-1 > jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > jcs.default.cacheattributes.UseMemoryShrinker=false > jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 > > ############################################################## > ##### CACHE REGIONS > jcs.region.myRegion1=DC > jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.region.myRegion1.cacheattributes.MaxObjects=-1 > jcs.region.myRegion1.attributes.MaxPurgatorySize=10000 > > jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > #####jcs.region.myRegion1.cacheattributes.DiskUsagePattern=UPDATE > ############################################################## > ##### AUXILIARY CACHES > # Indexed Disk Cache > 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=O:\\liantis/JCS/dump > jcs.auxiliary.DC.attributes.DiskPath=dump > jcs.auxiliary.DC.attributes.MaxPurgatorySize=1000000 > jcs.auxiliary.DC.attributes.MaxKeySize=-1 > jcs.auxiliary.DC.attributes.MaxObjects=-1 > jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 > jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true > jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500 > > jcs.auxiliary.DC.attributes.EventQueueType=POOLED > jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue > > > # Disk Cache pool > ###thread_pool.disk_cache_event_queue.boundarySize=50 > thread_pool.disk_cache_event_queue.useBoundary=true > thread_pool.disk_cache_event_queue.maximumPoolSize=15 > thread_pool.disk_cache_event_queue.minimumPoolSize=1 > thread_pool.disk_cache_event_queue.keepAliveTime=3500 > thread_pool.disk_cache_event_queue.startUpSize=1 > thread_pool.disk_cache_event_queue.whenBlockedPolicy=WAIT > > > > redards and thanks for help. > > Manfred > > > > Aaron Smuts schrieb: > > Purgatory is a buffer where items go on the way to > disk. If you put them in the cache faster than they can go > to disk, the buffer will grow. if you exceed the maximum > size the items will be dropped. You can either make > purgatory bigger or use a thread pool with a when full > policy of BLOCK or RUN. > > > > Aaron > > > > > > --- On Mon, 9/15/08, Manfred Quasten > <[EMAIL PROTECTED]> wrote: > > > > > >> From: Manfred Quasten > <[EMAIL PROTECTED]> > >> Subject: configuration jcs remote rmi cache > >> To: jcs-users@jakarta.apache.org > >> Date: Monday, September 15, 2008, 5:20 AM > >> I try to configure a remote disk cache running on > tomcat. > >> Server and > >> client should run with a minimum java heapsize. > >> > >> My configfiles are (server) : > >> > >> # Registry used to register and provide the > >> # IRemoteCacheService service. > >> registry.host=localhost > >> registry.port=1102 > >> # call back port to local caches. > >> remote.cache.service.port=1102 > >> # cluster setting > >> remote.cluster.LocalClusterConsistency=true > >> remote.cluster.AllowClusterGet=true > >> > >> > >> > ############################################################## > >> ##### CACHE REGIONS > >> jcs.region.myRegion1=DC > >> > jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > >> > >> > >> jcs.region.myRegion1.cacheattributes.MaxObjects=-1 > >> > jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > >> > >> > >> > #jcs.region.myRegion1.cacheattributes.DiskUsagePattern=SWAP > >> > ############################################################## > >> ##### AUXILIARY CACHES > >> # Indexed Disk Cache > >> > 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=dump > >> jcs.auxiliary.DC.attributes.MaxPurgatorySize=100 > >> jcs.auxiliary.DC.attributes.MaxKeySize=-1 > >> > jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 > >> > jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true > >> jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500 > >> jcs.auxiliary.DC.attributes.EventQueueType=POOLED > >> > jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue > >> > >> > >> jcs.auxiliary.DC.attributes.EventQueueType=POOLED > >> > jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue > >> > >> > >> # Disk Cache pool > >> thread_pool.disk_cache_event_queue.boundarySize=50 > >> > thread_pool.disk_cache_event_queue.useBoundary=true > >> > thread_pool.disk_cache_event_queue.maximumPoolSize=15 > >> > thread_pool.disk_cache_event_queue.minimumPoolSize=1 > >> > thread_pool.disk_cache_event_queue.keepAliveTime=3500 > >> thread_pool.disk_cache_event_queue.startUpSize=1 > >> > >> > >> > >> client: > >> > >> > jcs.auxiliary.RC=org.apache.jcs.auxiliary.remote.RemoteCacheFactory > >> > jcs.auxiliary.RC.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes > >> > >> > >> > jcs.auxiliary.RC.attributes.FailoverServers=localhost:1102 > >> > jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true > >> jcs.auxiliary.RC.attributes.GetOnly=false > >> > >> > >> jcs.region.myRegion1=RC > >> > jcs.region.myRegion1.elementattributes.IsEternal=false > >> > jcs.region.myRegion1.elementattributes.MaxLifeSeconds=60000 > >> > jcs.region.myRegion1.elementattributes.IsSpool=true > >> > jcs.region.myRegion1.elementattributes.IsLateral=true > >> > jcs.region.myRegion1.elementattributes.IsRemote=true > >> > jcs.region.myRegion1.elementattributes.IsRemote=true > >> > >> > >> > >> > >> > >> # DEFAULT CACHE REGION > >> jcs.default=RC > >> > jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > >> jcs.default.cacheattributes.MaxObjects=0 > >> > jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > >> > >> > >> > >> > >> > jcs.auxiliary.RC.attributes.OptimizeOnShutdown=true > >> jcs.auxiliary.RC.attributes.MaxRecycleBinSize=7500 > >> jcs.auxiliary.RC.attributes.MaxPurgatorySize=100 > >> jcs.auxiliary.RC.attributes.EventQueueType=POOLED > >> > >> > jcs.auxiliary.RC.attributes.EventQueuePoolName=disk_cache_event_queue > >> > >> > >> > >> # Disk Cache pool > >> thread_pool.disk_cache_event_queue.boundarySize=50 > >> > thread_pool.disk_cache_event_queue.useBoundary=true > >> > thread_pool.disk_cache_event_queue.maximumPoolSize=15 > >> > thread_pool.disk_cache_event_queue.minimumPoolSize=1 > >> > thread_pool.disk_cache_event_queue.keepAliveTime=3500000 > >> thread_pool.disk_cache_event_queue.startUpSize=1 > >> > >> > >> > >> I write 50 000 objects into the cache (within a > for loop) : > >> > >> jcs.putInGroup(id, groupName , object); > >> > >> > >> > >> after this, I try to read the keys back from cache > and > >> there are a lot > >> of objects lost > >> > >> for ( int i=0 ; i < 50000 ; i++ ) { > >> final int x = (int) > (50000*Math.random()); > >> //System.out.println(x); > >> if ( > cacheManager.getFromCache(""+ x) > >> == null ) { > >> lost++; > >> } if (( i % 1000 > == 0 ) > >> && (i > 0 )) > >> System.out.println(i); > >> } > >> > >> This is the output from the servlet after the keys > are > >> written: The Key > >> Map Size is to smal , it is less than 50000 > >> > >> --------------------------- > >> Region Name = myRegion1 > >> HitCountRam = 0 > >> HitCountAux = 38121 > >> ---------------------------LRU Memory Cache > >> List Size = 0 > >> Map Size = 0 > >> Put Count = 50000 > >> Hit Count = 0 > >> Miss Count = 50000 > >> ---------------------------Indexed Disk Cache > >> Is Alive = true > >> Key Map Size = 37986 > >> Data File Length = 1438444745 > >> Hit Count = 38121 > >> Bytes Free = 37866 > >> Optimize Operation Count = 6411 > >> Times Optimized = 0 > >> Recycle Count = 6410 > >> Recycle Bin Size = 1 > >> Startup Size = 0 > >> Purgatory Hits = 0 > >> Purgatory Size = 0 > >> Working = true > >> Destroyed = false > >> Empty = true > >> Queue Size = 0 > >> Queue Capacity = 50 > >> Pool Size = 0 > >> Maximum Pool Size = 15 > >> > >> --------------------------- > >> Region Name = myRegion1 > >> HitCountRam = 0 > >> HitCountAux = 38121 > >> ---------------------------LRU Memory Cache > >> List Size = 0 > >> Map Size = 0 > >> Put Count = 50000 > >> Hit Count = 0 > >> Miss Count = 50000 > >> ---------------------------Indexed Disk Cache > >> Is Alive = true > >> Key Map Size = 37986 > >> Data File Length = 1438444745 > >> Hit Count = 38121 > >> Bytes Free = 37866 > >> Optimize Operation Count = 6411 > >> Times Optimized = 0 > >> Recycle Count = 6410 > >> Recycle Bin Size = 1 > >> Startup Size = 0 > >> Purgatory Hits = 0 > >> Purgatory Size = 0 > >> Working = true > >> Destroyed = false > >> Empty = true > >> Queue Size = 0 > >> Queue Capacity = 50 > >> Pool Size = 0 > >> Maximum Pool Size = 15 > >> > >> > >> Where is the mistake ? Can somebody help ? > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: > >> [EMAIL PROTECTED] > >> For additional commands, e-mail: > >> [EMAIL PROTECTED] > >> > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]