99% fragmentation on indexes


#1

Hello,

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?


GSI: different sporadic bugs + fragmentation up to 98%
#2

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


#3

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


#4

@moon0326,
take a look at responses for:
https://issues.couchbase.com/browse/MB-19781
https://issues.couchbase.com/browse/MB-19792
also: /opt/couchbase/etc/couchdb/default.ini .
but seems like it needs more additional explanations.


#5

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:


#6

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.
thanks
-cihan