1
votes

There is any way to make the compaction process manual in Cassandra? When does it happen automatically? What is the time period? Also, how does the memtable threshold limit factor in?

2
There was a question on this over on Stack's DBA site several years ago, but the points on compaction are still mostly relevant, and worth taking a look at: dba.stackexchange.com/questions/71781/cassandra-maintenance - Aaron

2 Answers

2
votes

Compaction in Cassandra happens automatically, but the frequency of it depends on the selected compaction strategy (default is size tiered compaction, where you need to have at least 4 SSTable files of similar size to trigger the compaction). Manual compaction is also supported via nodetool compact but it's not recommended (or at least with nodetool compact -s).

I strongly recommend you to watch DS201 & DS210 courses on DataStax Academy, and read DSE Architecture Guide (it's applicable to Cassandra as well).

1
votes

If you want to start a compaction manually you can use nodetool compact command, here is a link to the documentation :

http://cassandra.apache.org/doc/latest/tools/nodetool/compact.html

When does compaction happen, it depends on your compaction strategy. You can check this link where you can find some details about compactions :

https://docs.datastax.com/en/archived/cassandra/3.0/cassandra/dml/dmlHowDataMaintain.html

I hope this helps !