starFLax
starFLax

Reputation: 11

Low disk space issue in Cassandra

How does Cassandra solve disk space issues? My disk space is a priority. I'm using the STCS strategy for one table and deleting data via disk monitoring. However, I need to wait for automatic compression to free up space. What's the minimum amount of disk space that's considered insufficient? Is 50% free space necessary? That's too much. If I only want to set 50GB as the threshold for insufficient space, how can I do that?

I'd like to know how to handle low disk space issues in Cassandra. Specifically, if I want to set the threshold for insufficient space to 50GB, what should I do? Ideally, I want this to be handled automatically by Cassandra, rather than manually through operations management.

Upvotes: 1

Views: 132

Answers (1)

Andrew
Andrew

Reputation: 27294

The 50% disk space for STCS is on the basis of the worst case scenario being 100% of the data needs re-compacting within a major compaction, which can require just as much space for the new files as the existing files are using. This is quite uncommon and it is not unusual to see nodes with the bulk of the tables using STCS to run with less than 50% available.

Cassandra does not have the ability to warn with 50 Gb to go, it will just keep going until there is no space left on the device mounted for the data volume. (Please avoid using more than 1 data directory in the cassandra.yaml, you will cause yourself a lot of pain / performance problems and space usage will get worse, not better).

The "and deleting data via disk monitoring" requires more explanation, that sounds like you are just deleting SSTable files to remove data?

If the data is being aged out with TTLs, then there is the potential of using Time Windows Compaction Strategy. TWCS though comes with some caveats on how the table is used - if you are performing manual deletions / updates, then TWCS is not going to work out well for you.

More information about the table size / usage would be needed to properly consider the compaction options though.

Upvotes: 0

Related Questions