# Time for shard size to decrease after forcemerge

**URL:** <https://discuss.elastic.co/t/time-for-shard-size-to-decrease-after-forcemerge/370951>\
**Category:** Elasticsearch\
**Created:** [November 22, 2024, 1:08pm UTC](https://discuss.elastic.co/t/time-for-shard-size-to-decrease-after-forcemerge/370951 "2024-11-22T13:08:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emil/32/49885_2.png) [@Emil](https://discuss.elastic.co/u/Emil)\
**Post date:** [November 22, 2024, 1:08pm UTC](https://discuss.elastic.co/t/time-for-shard-size-to-decrease-after-forcemerge/370951/1 "2024-11-22T13:08:03Z")

</div>

When I do a forcemerge, I noticed shard size at first increases (as expected), and then later on decrease.

However, after the forcemerge task is finished, some of the shards are still larger; it takes some time for them to shrink again.

What is actually happening at that point? What data structures are responsible for the shard size? Note that the individual segments are already smaller, but the total of the segments doesn't add up to the shard size.

Some example.  
Say that I start out with `my_index`, containing 4 shards (2 primary, 2 replicas), that each have 10 5GB segments, with varying degrees of deleted documents. Now, after I do a forcemerge with only\_expunge\_deletes, I see for each shard still 10 segments, now varying from (say) 3 to 4,5 GB.  
But when I query `GET _cat/shards/my_index`, I may get shard sizes from 40 GB (expected) to 80 GB. Only after some time (several hours) does this converge to 4 shards of 40GB each.
