I am currently doing read performance tuning and had a few questions on Cassandra caching:
From describe keyspace, I see these two settings under the ColumnFamily section:
Row cache size / save period in seconds / keys to save : 0.0/0/all
Key cache size / save period in seconds: 200000.0/14400
1. I understand the row/key cache sizes can be set, how is the save period in seconds set?
2. If there is x rows in cache, will these rows get flushed regardless after however many seconds set above in the save period (even if the cache doesn’t fill up)?
3. These settings are cluster level and not node level, right?
4. When inserting into the Cassandra cluster, before the MemTable is flushed to the SSTable, if we make a query to data that is currently in the MemTable, will it fetch it directly from memory (MemTable) then? Will the MemTable memory (for inserts) share the same configuration (row/key cache size) and space as the cache memory for reads?
5. How does the caching mechanism work? Least recently read, first to leave the cache?
I know this is quite a few questions, partial responses would be awesome too. Thanks so much in advance!