Database Reference
In-Depth Information
Key Cache
With key cache, references to actual row keys will be cached in memory for each
column family. Having a large key cache is recommended for heavily used, read-based
applications, obviously within permissible JVM settings. Various key cache configura-
tions that can be configured with cassandra.yaml are described in Table 8-1 .
Table 8-1 . Key Cache Configurations
Name
Description
Key cache size in megabytes. By default it is 5% of heap
or 100MB (whatever is less). It can be disabled by setting
value as 0.
key_cache_size_in_mb
Time period to save key cache on configured cache direct-
ory. Default is 4 hours
key_cache_save_period
Number of keys to be saved, by default it is disabled but
recommended setting is to set it for high value.
key_cache_keys_to_save
With 2.0 onwards, key cache has been moved to off-heap, which reduces the time
spent on serialization of keys significantly. We will discuss off-heap versus on-heap
later in this chapter. As discussed earlier, memory utilization is one of the important
KPIs for performance and while configuring row caches, we must avoid Full GC activ-
ities, regardless of whether the key cache has been moved to off-heap now.
populate_io_cache_on_flush
By default it is disabled and set to false. Prior to Cassandra 1.2.x, it was supported at
node level but now it is possible to enable it at column family level. The purpose of
this flag is to enable/disable page cache at the column family during memtable flush
and compaction. If set to true, it will keep a cache of the specific column family's data
in memory. As discussed in Chapter 1 , memtables keep flushing data onto the disc in
the form of sstables. If this parameter is set to true Cassandra keeps a page cache for all
rows of this column family. Please note that page cache refresh only happens in case of
flushing and compaction to keep the updated data on the node for the respective
column family. Users need to make sure that data size fits well within the node's
memory. We can enable it while creating the table or altering the existing table:
 
 
Search WWH ::




Custom Search