nodetool cfstats shows me the following output:
Read Count: 746287
Read Latency: 8.772114064696291 ms.
Write Count: 135629
Write Latency: 0.052691931666531494 ms.
Pending Flushes: 0
Table: graphindex
** SSTable count: 230 **
Space used (live): 1532001
Space used (total): 1532001
Space used by snapshots (total): 0
SSTable Compression Ratio: 0.8071848230527264
Memtable cell count: 159436
Memtable data size: 2609278
Memtable switch count: 1
Local read count: 746287
** Local read latency: 8.773 ms **
Local write count: 135629
Local write latency: 0.053 ms
Pending flushes: 0
Bloom filter false positives: 1122
Bloom filter false ratio: 0.00000
Bloom filter space used: 39312
Compacted partition minimum bytes: 43
Compacted partition maximum bytes: 20501
Compacted partition mean bytes: 70
Average live cells per slice (last five minutes): 320.3775491198426
Maximum live cells per slice (last five minutes): 3183.0
** Average tombstones per slice (last five minutes): 7997.852040836836 **
** Maximum tombstones per slice (last five minutes): 27078.0 **
As you can see the number of sstables is quite large. The table uses default compaction SizeTieredCompactionStrategy with min threshold 4 and max 32.
My questions are:
Why there are still so many sstables taking into account that the amount of data in the node is not large and the sstables are quite small? How (when) could this happen?
When SizeTieredCompactionStrategy actually triggers the compaction? In the other post I found that:
By default, a minor compaction can begin any time Cassandra creates four SSTables on disk for a column family. A minor compaction must begin before the total number of SSTables reaches 32.
But what should I do if the number of sstables already exceeds 32? Is running major compaction manually the only solution?
The reason why I'm asking is that because of big number of tombstones (last lines in the output above) and sstables, the read latency is becoming quite bad. The gc_grace_period is kept at low value, but since Cassandra didn't compact the sstables, the tombstones are still there. Or am I missing something?
nodetool enableautocompactionon each node? I think that will make STCS run in the background. - tbsalling