Reputation: 533
I am a little unclear about the following lines from the Datastax page on tuning cassandra compactions. Specifically they mention:
"Administrators can also initiate a major compaction through nodetool compact, which merges all SSTables into one. Though major compaction can free disk space used by accumulated SSTables, during runtime it temporarily doubles disk space usage and is I/O and CPU intensive. Also, once you run a major compaction, automatic minor compactions are no longer triggered frequently forcing you to manually run major compactions on a routine basis. So while read performance will be good immediately following a major compaction, it will continually degrade until the next major compaction is manually invoked. For this reason, major compaction is NOT recommended by DataStax." (http://www.datastax.com/docs/1.0/operations/tuning)
The two questions after reading this that came to my mind that I am trying to understand better are:
Thanks.
Upvotes: 1
Views: 2440
Reputation: 180
When major compaction is run, it will merge all SSTables into a single SSTable. For the most part what will happen is that newly created SSTable will be significantly larger than next SSTable that will be flushed from Memtable (defined with memtable_total_space_in_mb). If you are using size tiered compaction, cassandra will wait for 4 (again default) same size SSTables before it triggers next minor compaction. This delays next automatic minor compaction because Cassandra SStable created by major compaction will not be in line of other SSTables (memtable_total_space_in_mb). So Cassandra doesn't necessarily stops automatic minor compactions but frequency is now altered.
"is it even possible and if so how can I revert back to ensure that the minor compaction intervals do not get affected as a result and are reset to the default behavior." - For this you will have to break large sstable created as a result of major compaction. To do this, you can use utility called 'sstablesplit'.
https://docs.datastax.com/en/cassandra/2.1/cassandra/tools/toolsSSTableSplit.html
Upvotes: 1
Reputation: 2660
Answer to your 2nd question:
"is it even possible and if so how can I revert back to ensure that the minor compaction intervals do not get affected"
[CASSANDRA_HOME]/bin/nodetool enableautocompaction
http://datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsNodetool_r.html
Upvotes: 1