Auto Compaction


I set Autocompaction to the default at 30% fragmentation. It kicks in at expected, but right after finished compaction, fragmentation is still at > 20% overall or between 15 and 25% on host level. Why is that so? Is auto compaction done on a vbucket level, so only vbuckets with > 30% are compacted?

I have enterprise license but while it’s not urgent and maybe interesting for others, i’m posting here first.

Thanks Pascal


Hi @gizmo74,
Compaction works on one vbucket at the time: vbucket1, vbucket2, etc… meaning that while compressing vbucketN, vbucket1 can be fragmented while in use.
Compacting works on vbucket level.

If you want to monitor the compacting more closely you could break down the “data fragmentation” by nodes by clicking on “show by server”, in the admin interface. I think observing the compacting at this level can help you understand better what is happening.

I hope this helps


Hi Martin,

Thanks for your reply. Yes I can see there that only one server is compacting during the auto compaction is running. Of course this is an ideal solution to compact only the server that needs compaction, not all at a time. But also there I see that fragmentation level on this server is going down from 30% to something between 10% to 15%. If I start a manual compaction then all servers goes down to 0%. So I wonder if the auto compaction is only compacting vbuckets that are fragmented > a defined level. Something must be different to manual compaction.
It’s not a problem, but something that I want to understand :smile: We don’t have so massive writes that the compaction level should rise during the short compaction time. At least after manual compaction the level stays at low level (0 to 2 %) for some minutes. So I wonder why it’s not the same after auto compaction.



Hi @gizmo74,
When using Auto compaction, it’s only the vbucket’s that are above the fragmentation threadhold value that are compacted.
When using/trickering compaction manually, all vbucket’s are compacted regardless of the fragmentation level, that is probably why you see a difference between Manual and Auto.

I hope this answers your question.



Thats perfect. :smile: Thanks a lot.