# Shard size increase right after rollover

**URL:** <https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261>\
**Category:** Elasticsearch\
**Created:** [December 15, 2022, 7:05am UTC](https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261 "2022-12-15T07:05:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nairobi](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nairobi](https://discuss.elastic.co/u/nairobi)\
**Post date:** [December 15, 2022, 7:05am UTC](https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261/1 "2022-12-15T07:05:27Z")

</div>

I have index that

- primaries 3
- replicas 1
- ilm: roll over when any primary shard reaches 50gb (hot to warm)

So when it reached to 300gb, it roll over to warm phase.  
But after it roll over, size of shard increase to about to 600gb. And after some time it comes back to 300gb.

Can you explain why this happen?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/9/093c1025d46604200ad41f55c247736bdfd12e65.png)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 15, 2022, 7:17am UTC](https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261/2 "2022-12-15T07:17:57Z")

</div>

That is most likely due to merging of segments in the background. Lucene, which Elasticsearch uses, creates immutable segments when refreshes are performed and data is made searchable. These periodically are merged, at which point a new segment is created holding all the data in some other segmenst. Only once this new segment has been completed are the old segments deleted, which results in periodic increases in disk usage. If you are forcemerging read-only indices down to a single segment as part of your ILM policy (good thing to do) all segments of shards will be merged, which will temporarily require twice the amount of disk space.

---

<div class="post-metadata">

**Author:** ![nairobi](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nairobi](https://discuss.elastic.co/u/nairobi)\
**Post date:** [December 15, 2022, 7:48am UTC](https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261/3 "2022-12-15T07:48:01Z")

</div>

Thanks for the quick reply!!  
That's perfect explain for me.

After saw your reply, i could find about it on docs too.

> **[Force merge API | Elasticsearch Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html)**

Thank you

---

<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:** [January 12, 2023, 7:48am UTC](https://discuss.elastic.co/t/shard-size-increase-right-after-rollover/321261/4 "2023-01-12T07:48:28Z")

</div>

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