couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

compaction schedule at database level

Open Sdas0000 opened this issue 8 months ago • 2 comments

Summary

Desired Behaviour

Possible Solution

Additional context

Sdas0000 avatar Apr 22 '25 18:04 Sdas0000

WE have 500 databases own by team 'A' and another 500 databases own by team 'B', we would like to have a different compaction schedule for each database set so that the resource(disk space/CPU etc) can be utilized properly.

Sdas0000 avatar Apr 22 '25 19:04 Sdas0000

Per-db compaction schedule is not something we support.

If the two types of databases have very different sizes could try using min_size / max_size or min_priority / max_priority channel configurations with separate from/to windows size and after removing the default channels (so they don't get picked up by those).

https://docs.couchdb.org/en/stable/config/compaction.html

There is also an un-documented [smoosh.ignore] $shard = true set of settings.

It would look like:

[smoosh.ignore]
shards/50000000-5fffffff/foo.1563328001 = true
shards/... = true

You'd have to list them by shard range, name and creation suffix and then maybe toggle the lists periodically between A and B.

But your best bet might be to just create a custom script call POST _compact for each database based on your specific constraints.

nickva avatar Apr 22 '25 23:04 nickva