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