jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: Limiting Disk Cache Size?
Date Tue, 20 Sep 2005 18:50:32 GMT
 

 

________________________________

From: Joshua Fuller [mailto:joshfuller@gmail.com] 
Sent: Tuesday, September 20, 2005 12:40 PM
To: Smuts, Aaron
Cc: JCS Users List
Subject: Re: Limiting Disk Cache Size?

 

Thanks for your quick response and help.  So would you recommend setting
up multiple disk cache, and using the MaxKeySize value to limit it?  Or
is your last statement saying that the MaxKeySize will not actually
limit the size of objects on the disk anyway, but only the number of
keys in memory?  

 

The indexec disk cache is a memory index of items on disk.  The keys and
the starting location of on disk for an item are stored in memory.  The
maxkeysize on the disk cache limits the number of keys stored in the
index.  This has nothing to do with the max size setting on the memory
cache.  

 

So to clarify, if I have a database of 100,000 records that are heavily
used - and I have a cache setup with a MaxKeySize of 1,000 - then there
is nothing preventing all 100,000 records from being spooled to disk as
long as they have yet to expire?

 

Yes and no.  All of them can get spooled, but only 1000 will be
available.  



A follow-up question to that would be - Does the memory shrinker thread
get used also to clean up the disk cache items that may have expired, or
how do they get cleaned out?



Nope.  It is just a memory cache shrinker.

 

They get cleaned out when remove is called.  Remove is called when you
call remove or when you call get and an item is found to be expired.

 


Thanks,
Josh Fuller

On 9/20/05, Smuts, Aaron <Aaron.Smuts@travelocity.com> wrote:

You can only limit the number of keys, not the size of the file.  The
disk cache keeps track of empty spots from where an item has been
removed and it tries to reuse them, but this doesn't stop it from
growing indefinitely if you keep putting larger and larger items on 
disk.  I don't think that the disk cache marks a spot as available when
a key is spooled off the disk cache key lru.  . . .

> -----Original Message-----
> From: Joshua Fuller [mailto: joshfuller@gmail.com
<mailto:joshfuller@gmail.com> ]
> Sent: Monday, September 19, 2005 9:07 PM
> To: jcs-users@jakarta.apache.org
> Subject: Fwd: Limiting Disk Cache Size?
> 
> Sorry, if this is a repeat - the last email didnt seem to send so I'm
> trying
> again......
>
> Is there a way to limit the size of the items in the cache being
stored to
> disk for a given region, or even globally? I can't find any setting 
> anywhere
> that limits the size of the files on disk (by number of elements or
> physical).
>
> Thanks,
> Josh Fuller

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message