Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

adampaul avatar image
adampaul asked ·

What is best practice for compaction process?

Generally compaction runs automatically after gc grace but in prod environments what are the best practice for compaction , is it good to run manual compaction periodically or not

dsecompaction
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered ·

To add to Madhavan's answer, I wrote that KB article a few years ago which I've re-published here on DataStax Community in #6396.

Also for clarification, compactions don't just triggered after GC grace. Compactions get scheduled for various other reasons depending on the compaction strategy for each table.

For example when using SizeTieredCompactionStrategy (STCS), compactions can be triggered when N similar-sized SSTables have been identified as candidates. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

smadhavan avatar image
smadhavan answered ·

@adampaul, you should not manually compact your tables. It is a standard operation that Cassandra manages on its own and does not require manual intervention except in extreme cases.

Our engineers have written about this topic in the past including Why running major compactions is not ideal. The compaction strategies defined on each table will determine when there are suitable SSTable candidates to compact. You should just let the compaction strategy do its job.

For more info, see How data is maintained in Cassandra. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.