# Es 5.6.x force merege question about max\_num\_segments/max\_merge\_count/max\_thread\_count

**URL:** https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298
**Category:** Elasticsearch
**Created:** [July 3, 2018, 1:49am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298 "2018-07-03T01:49:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 3, 2018, 1:49am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/1 "2018-07-03T01:49:24Z")

</div>

i see the doc have setting with the indices about force merege  
**index.merge.scheduler.max\_merge\_count**  
**index.merge.scheduler.max\_thread\_count**  
with **not ssd** the docs give **index.merge.scheduler.max\_thread\_count** to **"1"** ,and the  
**index.merge.scheduler.max\_merge\_count** aslo need set to **1**

the question is :

- 1.the **max\_num\_segments** in the flow cmd when force merege is same as **max\_merge\_count**?  
curl -XPOST "[http://xxxxx:9200/xxxx/\_forcemerge](http://xxxxx:9200/xxxx/_forcemerge)? **max\_num\_segments** =1
- 2.have many segments better with index search or small segment better with index search?

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 3, 2018, 2:00am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/2 "2018-07-03T02:00:18Z")

</div>

with monitoring  
the one index have so many segment count  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/c/dc10dfb3a3afb52c5ca5704ff19b4df56173ddd8.png)

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 3, 2018, 7:22am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/5 "2018-07-03T07:22:48Z")

</div>

some one can help me?

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 3, 2018, 3:13pm UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/6 "2018-07-03T15:13:43Z")

</div>

i test it. can't find how setting about it........

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 5, 2018, 2:17am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/7 "2018-07-05T02:17:05Z")

</div>

there no doc about this..  
i see the soure code about this .

> <https://github.com/elastic/elasticsearch/blob/5.6/core/src/main/java/org/elasticsearch/index/MergeSchedulerConfig.java#L60>

  
only with +5 ...  
i don't know which is better about index.merge.scheduler.max\_merge\_count and index.merge.scheduler.max\_thread\_count and max\_num\_segments for kibana search.  
the index have 4.3b docs..  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a829db639d0327953a0123a386461d5fbf20b242.png)

---

<div class="post-metadata">

### Author: ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)
#### Post date: [July 5, 2018, 7:38am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/8 "2018-07-05T07:38:19Z")

</div>

I'm not sure what your question is, but you'll find the documentation about \_forcemerge and its request parameters [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html).

In general Elasticsearch will handle its own segment merging well, but it's sometimes useful to trigger a forcemerge as it will expunge deleted documents when merging two segments into one and therefore save you disk space.

But note that \_forcemerge should not be called on an active index as that may result in huge (\>5G) segments that will usually never be merged again and therefore could build up many deleted documents if that shard is still being updated.

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 5, 2018, 8:15am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/9 "2018-07-05T08:15:53Z")

</div>

about the this i want to know about which number is better as flow  
**"index.merge.scheduler.max\_merge\_count": "20",**  
**"index.merge.scheduler.max\_thread\_count": "2"**  
i want to know ,use kibana search the index before **\_forcemerge?max\_num\_segments=1** is good or after **forcemerge**?

and the **max\_num\_segments** can set as "2" or other greater than 1 number ,which is better for search index data?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 2, 2018, 8:15am UTC](https://discuss.elastic.co/t/es-5-6-x-force-merege-question-about-max-num-segments-max-merge-count-max-thread-count/138298/10 "2018-08-02T08:15:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
