Hello Vikas,

On 18/08/2014 12:05, Vikas Saurabh wrote:
> Hi,
>
> ...
> specify a cache size. While I agree that cache should be a memory
> hog... but entry size of a document in cache is quite variable in
> nature and as an admin I can make guesses about JCR nodes and their
> access patters. Document size, otoh, would vary even during the
> lifetime of repository.
>
> Moreover, the only downside (assuming RAM is cheap) of increasing
> cache to large number is making cache invalidation expensize.
>
> So, IMHO, document caches should be limited in terms of number of
> entries in cache. And if we still want to have byte size limitation,
> we can probably have both and cache respects whichever constraint hits
> first (sort of min(byte size, entry size)).
First of all I don't know MongoNS implementation details so I can be wrong.

I'd rather keep the size in bytes as it gives me much more control over
the memory I have and what I decide to provide to the application. If we
say, to take an extreme example, 1 document only in cache and then this
single document exceed the amount of available memory I fear an OOM. On
the other hand having bytes ensure us the application keeps working and
it will be task of a sysadmin to monitor the eventual hit/miss ratio to
adjust the cache accordingly.

About cache invalidation I'm not sure but it could be that the MongoNS
implementation uses off-heap for caching.

Cheers
Davide


Reply via email to