Why you should never invoke compaction manually

Remember that compaction works by finding multiple SSTable files that are similarly-sized. When you force compaction, you merge SSTable files together, regardless of their size, or whether or not there is a qualifying number of them. This often results in one large SSTable file. The likelihood of other SSTable files growing large enough to be compacted with that big file is very minimal. Essentially, running nodetool compact could cause compaction to pretty much never run again.

As previously mentioned, the best advice is to let Cassandra figure out when it wants to run compaction. Don't get in its way!

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.