You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Julie <ju...@nextcentury.com> on 2010/07/06 16:32:19 UTC

Key cache size seems to be double what I would expect

I am running a 10 node Cassandra cluster (with a replication factor of 3) and am
doing some key cache testing.  

I populate the database with keys numbered '1' through '1,000,000', set the key 
cache and row cache capacity to 100, then attempt to read the key '500'
multiple times.  The key cache size is 0 when I get started and I expect it to
go to 1 and stay at 1 on all the replication nodes containing the key '500'. 
But the key cache size becomes 2 and even 3, which I don't understand.  
 
Here's what I did. (Note: I restarted server4 prior to these reads which is why
its "Read Count" is 4 after my four reads.

1) Read ‘500’ twice with cache on.

2) Read ‘500’ twice more with cache on:
Server4:
                   Column Family: Standard1
                   Read Count: 4
                   Key cache capacity: 100
                   Key cache size: 2
                   Key cache hit rate: 0.0
                   Row cache capacity: 100
                   Row cache size: 1
                   Row cache hit rate: 0.5

Server 5:
                   Column Family: Standard1
                   Read Count: 2004
                   Key cache capacity: 100
                   Key cache size: 2
                   Key cache hit rate: 0.25
                   Row cache capacity: 100
                   Row cache size: 1
                   Row cache hit rate: 0.0

Server 6:
                   Column Family: Standard1
                   Read Count: 2004
                   Key cache capacity: 100
                   Key cache size: 3
                   Key cache hit rate: 0.0
                   Row cache capacity: 100
                   Row cache size: 1
                   Row cache hit rate: 0.0

I need to set my key cache size properly but am not sure how to set it if each 
key cached is stored in the key cache 2 or 3 times.  I'd really appreciate any 
insight into how this works.  
Thanks!
Julie



Re: Key cache size is 0 but .75 hit rate

Posted by Julie <ju...@nextcentury.com>.
> I need to set my key cache size properly but am not sure how to set it if each 
> key cached is stored in the key cache 2 or 3 times.  I'd really appreciate any 
> insight into how this works.  
> Thanks!
> Julie
> 
> 

I actually still have this question but now have another, related one that I'm
puzzling over. What does it mean when my key cache size is 0 but I've got a
successful hit rate?  For example:

        Key cache capacity: 100
	Key cache size: 0
	Key cache hit rate: 0.75


I'm sorry for the barrage of questions!
If anyone knows the answer to this, thank you in advance.

Julie