# So many segments under 2mb

**URL:** https://discuss.elastic.co/t/so-many-segments-under-2mb/306536
**Category:** Elasticsearch
**Created:** [June 7, 2022, 7:52am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536 "2022-06-07T07:52:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ericsoul](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@ericsoul](https://discuss.elastic.co/u/ericsoul)
#### Post date: [June 7, 2022, 7:52am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/1 "2022-06-07T07:52:12Z")

</div>

The default parameter `index.merge.policy.floor_segment` is 2mb,  
but why there are still so many segments under 2mb,  
even through I send command `POST indices_name/_forcemerge` many times.

---

<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: [June 7, 2022, 8:00am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/2 "2022-06-07T08:00:43Z")

</div>

It would help if you provide some more information about your cluster, which version you are using and how you are indexing data into your cluster.

---

<div class="post-metadata">

### Author: ![ericsoul](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@ericsoul](https://discuss.elastic.co/u/ericsoul)
#### Post date: [June 7, 2022, 8:10am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/3 "2022-06-07T08:10:20Z")

</div>

version:ES 7.12  
Using bulk to load data.

With configuration:

```auto
      "merge" : {
          "scheduler" : {
            "max_thread_count" : "4",
            "auto_throttle" : "true",
            "max_merge_count" : "9"
          },
          "policy" : {
            "reclaim_deletes_weight" : "2.0",
            "floor_segment" : "2mb",
            "max_merge_at_once_explicit" : "30",
            "max_merge_at_once" : "10",
            "max_merged_segment" : "5gb",
            "expunge_deletes_allowed" : "10.0",
            "segments_per_tier" : "10.0",
            "deletes_pct_allowed" : "33.0"
          }
        },

```

---

<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: [June 7, 2022, 8:14am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/4 "2022-06-07T08:14:19Z")

</div>

Are these the defaults? If not, how did you arrive at these values?

What is your refresh interval set to? Are you manually invoking refreshes while indexing or querying?

---

<div class="post-metadata">

### Author: ![ericsoul](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@ericsoul](https://discuss.elastic.co/u/ericsoul)
#### Post date: [June 7, 2022, 8:21am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/6 "2022-06-07T08:21:23Z")

</div>

It default configuration.  
refresh interval is `1s` with default too.

---

<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: [June 7, 2022, 8:21am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/7 "2022-06-07T08:21:59Z")

</div>

Is this causing any problems? How large is the shard/index?

What is the output of the [index stats API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-stats.html)?

---

<div class="post-metadata">

### Author: ![ericsoul](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@ericsoul](https://discuss.elastic.co/u/ericsoul)
#### Post date: [June 7, 2022, 8:26am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/8 "2022-06-07T08:26:31Z")

</div>

No problem yet.  
But it makes confuse about so many segments under 2mb with the `index.merge.policy.floor_segment` is 2mb.  
This `floor_segment` setting do not means it will run a merge to these segment under 2mb in one shard?

---

<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 5, 2022, 8:26am UTC](https://discuss.elastic.co/t/so-many-segments-under-2mb/306536/9 "2022-07-05T08:26:40Z")

</div>

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