Sunday, June 16, 2019

Compaction Threshold Settings in Cassandra

If there were multiple SSTables, read operations are less efficient as columns for associated key may be spread over multiple SSTables.

Adjusting Min and Max compaction thresholds helps in reducing frequent compactions but when it does, more SSTables are compacted.

nodetool getcompactionthreshold

Will give you current min = 4 and max = 32 for all tables which is default.

Change min and max threshold to 5 and 30 as below

nodetool setcompactionthreshold 5 30
Then alter the corresponding tables min_threshold and max_threshold accordingly as in this case to 5 and 30.

min_threshold, will compact minimum number of like sized SSTables and max_threshold controls the maximum number of SSTables that exist before minor compaction is forced. 

***

No comments:

Post a Comment