# Index size is increasing during the forcemerge

**URL:** <https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073>\
**Category:** Elasticsearch\
**Created:** [September 11, 2019, 11:41am UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073 "2019-09-11T11:41:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![worapojc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/worapojc/32/42782_2.png) [@worapojc](https://discuss.elastic.co/u/worapojc)\
**Post date:** [September 11, 2019, 11:41am UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/1 "2019-09-11T11:41:32Z")

</div>

Hi Elastic team,

I'm using hot-warm-cold ILM to manage my indexes.

However, in forcemerge action, I'm curious why the index size is increasing during the forcemerge.

From the picture below, the primary shard size is only 238.2GB but the store size is 746.8GB!!!.

 ![index](https://us1.discourse-cdn.com/elastic/original/3X/7/4/7406c793f3d33f55a144dc80be6c64315ea8996d.png)

Furthermore, it tooks a very long time in forcemerge step (it still not finish).

Example task here.

```
      "wp1XHBmkTmGgotuC0Autiw:16080117" : {
          "node" : "wp1XHBmkTmGgotuC0Autiw",
          "id" : 16080117,
          "type" : "transport",
          "action" : "indices:admin/forcemerge",
          "description" : "",
          "start_time_in_millis" : 1568122238700,
          "running_time_in_nanos" : 79752320903239,
          "cancellable" : false,
          "headers" : { }
       },

```

Could you please help to explain this behaviour?

Thank you

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 11, 2019, 12:25pm UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/2 "2019-09-11T12:25:05Z")

</div>

A merge writes out a fresh copy of all the data it's merging and then cleans up the old segments that are no longer needed. If you are force-merging to a single segment then that means it must write out a fresh copy of the entire shard. Only once it's finished making a new (huge) segment can it clean up the old segments.

---

<div class="post-metadata">

**Author:** ![worapojc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/worapojc/32/42782_2.png) [@worapojc](https://discuss.elastic.co/u/worapojc)\
**Post date:** [September 11, 2019, 12:41pm UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/3 "2019-09-11T12:41:04Z")

</div>

Thank you. How do I track the forcemerge progress? How can I make it faster? Does the increasing of " **indices**. **memory**. **index\_buffer\_size**" help the speed?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 11, 2019, 1:37pm UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/4 "2019-09-11T13:37:41Z")

</div>

There isn't much you can do to tune the speed of a merge. It's quite an expensive and complicated operation and on a large shard it can take a long time to complete.

---

<div class="post-metadata">

**Author:** ![worapojc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/worapojc/32/42782_2.png) [@worapojc](https://discuss.elastic.co/u/worapojc)\
**Post date:** [September 11, 2019, 1:52pm UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/5 "2019-09-11T13:52:12Z")

</div>

Thank you. It was old one. I increased the number of shards for the new one.

Will more shards help the indexing performance? From my understanding, it helps only the search.

---

<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:** [October 9, 2019, 1:52pm UTC](https://discuss.elastic.co/t/index-size-is-increasing-during-the-forcemerge/199073/6 "2019-10-09T13:52:14Z")

</div>

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