You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Artie Copeland <ye...@gmail.com> on 2010/08/17 19:55:27 UTC

cache sizes using percentages

if i set a key cache size of 100% the way i understand how that works is:

- the cache is not write through, but read through
- a key gets added to the cache on the first read if not already available
- the size of the cache will always increase for ever item read.  so if you
have 100mil items your key cache will grow to 100mil

Here are my questions:

if that is the case then what happens if you only have enough mem to store
10mil items in your key cache?
do you lose the other 90% how is it determined what is removed?
will the server keep adding til it gets OOM?
if you add a row cache as well how does that affect your percentage?
if there a priority between the cache? or are they independant so both will
try to be satisfied which would result in an OOM?

thanx,
artie

-- 
http://yeslinux.org
http://yestech.org

Re: cache sizes using percentages

Posted by Edward Capriolo <ed...@gmail.com>.
On Tue, Aug 17, 2010 at 1:55 PM, Artie Copeland <ye...@gmail.com> wrote:
> if i set a key cache size of 100% the way i understand how that works is:
> - the cache is not write through, but read through
> - a key gets added to the cache on the first read if not already available
> - the size of the cache will always increase for ever item read.  so if you
> have 100mil items your key cache will grow to 100mil
> Here are my questions:
> if that is the case then what happens if you only have enough mem to store
> 10mil items in your key cache?
> do you lose the other 90% how is it determined what is removed?
> will the server keep adding til it gets OOM?
> if you add a row cache as well how does that affect your percentage?
> if there a priority between the cache? or are they independant so both will
> try to be satisfied which would result in an OOM?
> thanx,
> artie
> --
> http://yeslinux.org
> http://yestech.org
>

Artie,

In my experience, what ends up happening.. You start your server and
all is well, your cache builds up, cache hit rate keeps climbing! Of
course so does memory usage. At some point you start reaching your
XMX. Java keeps trying to garbage collect often. A couple things can
happen, all of them bad. One is just hitting an OOM. Another thing
that can happen is the JVM spends too much time garbage collection and
so little time processing its throws another exception (might be a
subtype of OOM).

 do you lose the other 90% how is it determined what is removed?
Items are removed when full is reached actual memory usage is NOT
taken into account.

if you add a row cache as well how does that affect your percentage?
Mutually exclusive.

> if there a priority between the cache?
No

Re: cache sizes using percentages

Posted by Ryan King <ry...@twitter.com>.
On Tue, Aug 17, 2010 at 10:55 AM, Artie Copeland <ye...@gmail.com> wrote:
> if i set a key cache size of 100% the way i understand how that works is:
> - the cache is not write through, but read through
> - a key gets added to the cache on the first read if not already available
> - the size of the cache will always increase for ever item read.  so if you
> have 100mil items your key cache will grow to 100mil
> Here are my questions:
> if that is the case then what happens if you only have enough mem to store
> 10mil items in your key cache?

Then don't use a percentage.

> do you lose the other 90% how is it determined what is removed?

second-chance fifo.

> will the server keep adding til it gets OOM?

that or a gc storm

> if you add a row cache as well how does that affect your percentage?
> if there a priority between the cache? or are they independant so both will
> try to be satisfied which would result in an OOM?

they are independent

-ryan