3

When I delete a table in Cassandra, it takes close to forever.

From what I can see, this is because it first creates a snapshot of the table. However, what I do not understand is that they say the snapshot is done by creating a hard link with Copy on Write. So... Why would it still take that long? Once the hard link is created, you delete the original file and that should take a split second, right?

On my VMs and even my main computer, it can take minutes to delete one single table!!!

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156

1 Answers1

7

One minute is a bit high and I don't think a snapshot can take that long. What you are probably seeing is the memtables flushing before the snapshots are taken, and a flush could lead to a compaction.

Try disabling the "auto_snapshot" property in the yaml file, and check again how long it takes. Check also the number of sstables, since without snapshots C* will remove all of them, and as long as their number is low enough performance should be fine, but when you have a large number of sstables the unlink operation speed of your filesystem will be your bottleneck.

xmas79
  • 5,060
  • 2
  • 14
  • 35
  • Yeah, I just changed the `auto_snapshot` option. I'll see what happens next time I do a drop. My VMs hard drives access is very slow. I was thinking that could be because I have two drives used in RAID and they do not both have the same speed (5000 and 7200 respectively.) Still, when I first started with Cassandra, it used to be a lot faster. (I started with 0.8) – Alexis Wilke Sep 14 '16 at 18:32