Deleted files create tombstones in Cassandra. When too many tombstones collect, the speed
of transactions decreases. Tombstones are routinely removed to maintain performance.
About this task
To remove tombstones in Cassandra:
Procedure
- Monitor the average transaction time to gauge how often to remove tombstones.
- Stop each Cassandra node.
- Edit the following settings in cassandra.yaml that affect
tombstone removal and compaction:
- tombstone_threshold
- Default value is 0.2 (20%)
- tombstone_compaction_interval
- Default: 86400 seconds (1 day)
Important: If you expect messages to be deleted very rapidly, set smaller
values for the
tombstone_threshold and
tombstone_compaction_interval parameters. All Cassandra settings must be tested
in a test environment before deploying in a production environment, to confirm the expected results.
Failure to test can have unexpected consequences. For more information about the tombstone purge
interval, see
Configuring the tombstone purge interval.
- Run reaper and compaction processes.
- Repeat steps for each node.
- Restart each node.
Results
Tombstones are removed when Cassandra is compacted, according to the settings
in
cassandra.yaml.