giovanni.p.cruz
giovanni.p.cruz

Reputation: 21

Invoke a Major Compaction in one node or in all nodes

Good day guys. I'm still a noob to Cassandra so please bear with me.

My question is when I run a major compaction, do I have to run it in all the nodes or do I only have to run it in one node and that will trigger a major compaction in all of the remaining nodes?

Upvotes: 2

Views: 1661

Answers (2)

Jeff Jirsa
Jeff Jirsa

Reputation: 4426

Your data model sounds very much like a queue, which is a well known cassandra antipattern.

Generally speaking, if you wanted your data to only live for 5 minutes at a time, forcing major compaction is probably the worst thing you can do - ideally you'd want to use TTLs, or perhaps drop your GCGS very low and consider using Date Tiered Compaction rather than Size tiered or Leveled, so that the entire sstables can be dropped quickly and efficiently.

Upvotes: 2

Andy Tolbert
Andy Tolbert

Reputation: 11638

If using nodetool compact it will execute a major compaction only on the cassandra node you are running nodetool against. I would refrain from doing major compactions on all nodes at once in production, as compaction has performance implications. You should also have a good reason to do a major compaction, since it is an expensive operation and is not something you would do in most use cases.

Upvotes: 3

Related Questions