The pooled queue is a wrapper around the util concurrent pooled executor. You can read more here:
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.html Aaron --- Vladimir Olenin <[EMAIL PROTECTED]> wrote: > This thread pool is a bit confusing.... What's the > difference between > 'WAIT' and 'BLOCK'? The default one I guess is > 'POLICY_DISCARDOLDEST'... > Will 'RUN' policy avoid discarding the entries? > Where can I find a bit > more detailed explanation on thread pool > properties?... Started to > browse through JCS source code, but I'm a bit short > on time at this > point, so some quick link would be very appriciated! > > Vlad > > -----Original Message----- > From: Aaron Smuts [mailto:[EMAIL PROTECTED] > Sent: Monday, August 28, 2006 6:03 PM > To: JCS Users List > Subject: RE: configuration question > > Yes, you should be able to setup a queue that will > block or try to run > in the current thread. Configure it to use a pooled > type of queue. Set > that queue with a when blocked policy of BLOCK or > RUN. Configure the > purgatory size to -1 or to higher than the max > buffer size of the queue. > This way the queue will effectively manage the > purgatory size. (This > does make the disk cache potentially blocking. I've > never tried this > but it shoudl work.) > > /** abort when queue is full and max threads is > reached. */ > public static final String POLICY_ABORT = > "ABORT"; > > /** block when queue is full and max threads is > reached. */ > public static final String POLICY_BLOCK = > "BLOCK"; > > /** run in current thread when queue is full and > max threads is > reached. */ > public static final String POLICY_RUN = "RUN"; > > /** wait when queue is full and max threads is > reached. */ > public static final String POLICY_WAIT = "WAIT"; > > /** discard oldest when queue is full and max > threads is reached. */ > public static final String POLICY_DISCARDOLDEST > = "DISCARDOLDEST"; > > There are some details a the bottom of this page: > http://jakarta.apache.org/jcs/IndexedDiskAuxCache.html > > Also, you can call getStats to see how many items > are in purgatory etc. > > > [YOUR FILE] > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.EventQueueType=POOLED > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.EventQueuePoolName=disk_cach > e_event_queue > > ############################################################## > ################## OPTIONAL THREAD POOL > CONFIGURATION ######## > > # Disk Cache Event Queue Pool > thread_pool.disk_cache_event_queue.useBoundary=true > thread_pool.disk_cache_event_queue.boundarySize=50000 > 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=RUN > > > > --- Vladimir Olenin <[EMAIL PROTECTED]> wrote: > > > Still having problems with 'Purgatory' settings... > > > > Questions: > > > > 1) Is the purgatory object pool ever being > 'shrinked' (when all data > > is already written to disk) > > 2) if so, does JCS do it automatically or there > are some specific > > settings? (couldn't find anything in the docs) > > 3) Is there a way to 'ask' Purgatory to 'block' > any subsequent 'put' > > requests until the current 'bounded buffer' (with > > MaxPurgatorySize) is > > dumped to the disk and space in the purgatory > becomes available again > > (I realized it's quite against the rational why > the Purgotory was > > introduced in the first place, but read on) > > > > > > The thing I need to do is this: > > > > 1) I need to put, lets say, 100K entries into the > cache, and keep > > _ONLY_ 1K of them readily available in the memory. > The rest should be > > dynamically load from the disk when required > (replacing least > > frequently used entries in memory) > > 2) the cache is written into only ONCE, at the > application startup > > 3) the cache is then accessed (read-only) > extensively during the > > application life cycle > > > > > > The problem I'm having is this: > > > > 1) with current settings (see below) everything > works as expected, > > with only one exception: > > 2) the memory consumption with 'unbounded' > Purgatory size > > (MaxPurgatorySize=-1, correct?) is at least 150M > higher than a bounded > > > one (the values I tried ranged from 100 to 1000), > even after all data > > is loaded into cache. In my case 100M higher means > twice as much (300M > > > vs > > 150M) > > 3) while it's unknown right now whether the memory > would eventually be > > > freed-up, I suspect it might not > > 4) with bounded purgatory (MaxPurgatorySize = > 1000), some entries got > > evicted from the cache before they were written to > the disk. > > > > > > Below are my current settings: > > > > #---------------------- > > jcs.default = DC_SMALL_FOOTPRINT > > jcs.default.cacheattributes = > > org.apache.jcs.engine.CompositeCacheAttributes > > jcs.default.cacheattributes.MaxObjects = 1000 > > jcs.default.cacheattributes.MemoryCacheName = > > org.apache.jcs.engine.memory.lru.LRUMemoryCache > > jcs.default.cacheattributes.DiskUsagePatternName = > UPDATE > > > > > jcs.auxiliary.DC_SMALL_FOOTPRINT=org.apache.jcs.auxiliary.disk.indexed.I > > ndexedDiskCacheFactory > > > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes=org.apache.jcs.auxiliary.dis > > k.indexed.IndexedDiskCacheAttributes > > > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.maxKeySize=-1 > > > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.MaxPurgatorySize=-1 > > > jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.DiskPath=jcs > > #---------------------- > > > > Thanks! > > > > -----Original Message----- > > From: Aaron Smuts [mailto:[EMAIL PROTECTED] > > Sent: Monday, August 28, 2006 9:33 AM > > To: JCS Users List > > Subject: RE: configuration question > > > > > > > > --- Vladimir Olenin <[EMAIL PROTECTED]> wrote: > > > > > Thanks. It seems to work now. I wonder if > 'UPDATE' > > > policy is set, does > > > 'MaxPurgatorySize' property has any effect then? > > > > Yes. In JCS mythology, purgatory is simply a > queue on the way to > > disk, where the items can be accessed. > > It's a map on top of a queue. All items that go > to disk, go to the > > queue. You can set a limit on the queue size > regardless of the disk > === message truncated === --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]