I am creating a disk space watchdog for my app which uses
couchbase server 6.0 community on a single node. I’d like to delete older documents if the occupied disk space for couchbase data exceeds a threshold.
Is there a recommended way to do so?
Currently, I am planning to measure the size of the data folder (
/opt/couchbase/var/lib/couchbase/data in Linux) and delete records from Scala SDK using
remove (eq to N1QL
DELETE). However, I noticed after I delete a bunch of records using the web console with N1QL DELETE, the size of the
data folder increases. Specifically, the size of every related index item in
data/@2i goes up.
Why is this happening? How can I actually release disk space occupied by older data?