# Forcemerge?max\_num\_segments=1 is having any side affect to es engine

**URL:** <https://discuss.elastic.co/t/forcemerge-max-num-segments-1-is-having-any-side-affect-to-es-engine/236136>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [June 8, 2020, 7:47am UTC](https://discuss.elastic.co/t/forcemerge-max-num-segments-1-is-having-any-side-affect-to-es-engine/236136 "2020-06-08T07:47:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilip\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_kumar/32/15459_2.png) [@Dilip\_Kumar](https://discuss.elastic.co/u/Dilip_Kumar)\
**Post date:** [June 8, 2020, 7:47am UTC](https://discuss.elastic.co/t/forcemerge-max-num-segments-1-is-having-any-side-affect-to-es-engine/236136/1 "2020-06-08T07:47:20Z")

</div>

Hi,  
I have used curl -XPOST localhost:9200/myindex/\_forcemerge?max\_num\_segments=1 , after hit this API i have checked segments with this API curl localhost:9200/myindex/\_segments?pretty and find that segment is reduced to 1. My question is that is any side effect in es engine due to segments reduced to 1, where as default segment is more. what is best practice to remove deleted documents.

---

<div class="post-metadata">

**Author:** ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)\
**Post date:** [June 27, 2020, 3:26am UTC](https://discuss.elastic.co/t/forcemerge-max-num-segments-1-is-having-any-side-affect-to-es-engine/236136/2 "2020-06-27T03:26:21Z")

</div>

No side effects as such for the index.

The merge process may have some effect. It takes non-trivial CPU resources to merge segments of a large shard to a single segment. If shard size is 50GB you need additional 60-70 GB space. If this crosses your disk watermark on the node other shards may move.

Generally let ES/Lucene handle segment merges while data is being written to the index. With time based indices after certain time you stop writing to the index and create new index for writing. At this time you can forcemerge the old index. In my experience it reduces index size by 10+% and you need less system resources like file handles.

---

<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:** [July 25, 2020, 3:26am UTC](https://discuss.elastic.co/t/forcemerge-max-num-segments-1-is-having-any-side-affect-to-es-engine/236136/3 "2020-07-25T03:26:23Z")

</div>

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