99% fragmentation on indexes


We are seeing 99% fragmentation on 8 out of 10 indexes.

I don’t have solid understanding of how fragmentation works.

What’s causing it and how do I improve it?

take a look at this: GSI: different sporadic bugs + fragmentation up to 98%
something like that ?

Thank you for the link.

Not exactly…1:50 in my case.

In my case, I have

Data size: 290 KB
Disk size: 339 MB

take a look at responses for:
also: /opt/couchbase/etc/couchdb/default.ini .
but seems like it needs more additional explanations.

Thank you egrep.

It looks like we get 99% fragment because our index is so small. At this point we don’t really have any problems as it’s only 339MB, but I will watch the thread :slight_smile:

Thanks folks,
So to validate compaction is running and completing pls grep the indexer log for the following lines;

“CompactionDaemon: Finished compacting index instance”

This line in indexer.log signals the completion of compaction.

Like you mentioned there are conditions where compaction does not run because it isn’t worth compacting smaller files or compaction tries to keep itself in the background to ensure ongoing workload isn’t greatly impacted by the background operation compactiondaemon is pushing so there may be cases where we favor a larger file to compacting aggressively.