Number of Segments


(Matt Hughes) #1

I have daily indices. The ES guide talks about forcemerging any index without new activity down to 1 segment. Some places talk about forcemerging as being an overoptimization. The curator optimize action has "max_num_segments" as 2.

I feel like there is a lot of conflicting advice here. Assuming you have an index with no new activity:

  • what are the benefits of merging? reduced memory? less file handles? improved search speed? all of the above?
  • how much better are the benefits of merging to 1 vs merging to 2?
  • is it faster to merge to 1 than 2?
  • what should you merge down to? 1 segment? 2? it depends? If "it depends", depends on what? index size?

(Nik Everett) #2

Pretty much all of the above

It is hard to say. I mean, it is half the number of segments but an index that gets written to constantly is going to have dozens of segments and that performs just fine for most things.

Slower, I think.

I'd do one, but only after I'm super sure I'll never write to the index again. I don't expect you'll see a huge difference between one shard and two but it might be worth testing if you are particularly concerned about performance.


(system) #3