Performance Tuning: Bloom Filters, Key Cache & Row Cache
Understand the caching and probabilistic data structures Cassandra uses to accelerate reads, and how to tune them.
A read may need to check the memtable and every SSTable, because a row's columns can be scattered across all of them. Three structures keep that affordable.
The bloom filter is like a quick 'definitely not here' checklist you glance at before searching a filing cabinet, saving you from opening cabinets that certainly don't have what you need. The key cache is like remembering exactly which drawer and folder a frequently requested document lives in. The row cache is like keeping photocopies of your most-requested documents right on your desk so you never need to visit the cabinet at all — until someone updates that document, at which point your desk copy becomes stale and must be discarded.
Key Concepts
30 SSTables, bloom filters say:
27 definitely not -> skipped, zero disk access
3 probably yes -> 3 lookups (one may be a false positive) SSTables per read high -> compaction strategy is wrong for this workload
bloom FP ratio high -> lower bloom_filter_fp_chance
key cache hit rate low -> cache too small, or the access pattern is random