# Total store size of index with only one shard and one replica is three times the size of primary

**URL:** <https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057>\
**Category:** Elasticsearch\
**Created:** [August 21, 2019, 7:40am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057 "2019-08-21T07:40:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 21, 2019, 7:40am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/1 "2019-08-21T07:40:58Z")

</div>

![53](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc365b2596c8f948d51db4fbeffed31463b3697a.png)

Is there any kind of background task that would reduce the total number of segments increasing the total store size while leaving the respective primary values unaffected, as shown in the graphs?

Version: 6.8.0

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 21, 2019, 8:11am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/2 "2019-08-21T08:11:59Z")

</div>

the background task happening is a so-called merge. See [https://www.elastic.co/guide/en/elasticsearch/reference/7.3/index-modules-merge.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/index-modules-merge.html)

Just to rule this out, are there any open scroll contexts or snapshots going on that might leave files open?

---

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 21, 2019, 8:20am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/3 "2019-08-21T08:20:50Z")

</div>

Hello Alexander. Thank you for the quick reply. The response of `GET _cluster/pending_tasks` is `"tasks" : []`. I have not used the scroll API on that index and have not provided an external API for anyone else to do so. The latest snapshot was taken on 2019-08-19.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 21, 2019, 8:29am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/4 "2019-08-21T08:29:32Z")

</div>

Any chance you can share the output of

```auto
GET _stats?human

```

---

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 21, 2019, 8:37am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/5 "2019-08-21T08:37:55Z")

</div>

Of course. All: [https://www.dropbox.com/s/ctn97bl95gyh97f/all.txt?dl=1](https://www.dropbox.com/s/ctn97bl95gyh97f/all.txt?dl=1) and the index in question: [https://www.dropbox.com/s/6aqlc7nvs1ykqsg/index.txt?dl=1](https://www.dropbox.com/s/6aqlc7nvs1ykqsg/index.txt?dl=1)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 21, 2019, 9:08am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/6 "2019-08-21T09:08:14Z")

</div>

can you also include some more parameters to get more stats for that index

```auto
GET your_index/_stats?human&level=shards&include_segment_file_sizes=true

```

Thanks!

---

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 21, 2019, 9:15am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/7 "2019-08-21T09:15:05Z")

</div>

Sure. [https://www.dropbox.com/s/vlqe8o4feqv93mb/details.txt?dl=1](https://www.dropbox.com/s/vlqe8o4feqv93mb/details.txt?dl=1) Thank you!

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [August 21, 2019, 10:54am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/8 "2019-08-21T10:54:11Z")

</div>

@kmousikos can you try running `_flush&force=true&wait_if_ongoing=true` followed by an `_refresh` and see if the issue persists

---

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 21, 2019, 11:28am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/9 "2019-08-21T11:28:31Z")

</div>

Flushing the index solved the issue. Thank you very much for the assistance @s1monw .

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [August 28, 2019, 10:33am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/10 "2019-08-28T10:33:29Z")

</div>

@kmousikos thanks for the feedback. I tried to address this to be less trappy here: [https://github.com/elastic/elasticsearch/pull/46066](https://github.com/elastic/elasticsearch/pull/46066)

thanks for reporting this issue on the forum. I think we used to have protection for this in the past but it seemed to be a regression.

---

<div class="post-metadata">

**Author:** ![kmousikos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmousikos/32/41566_2.png) [@kmousikos](https://discuss.elastic.co/u/kmousikos)\
**Post date:** [August 28, 2019, 11:03am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/11 "2019-08-28T11:03:38Z")

</div>

@s1monw my pleasure. Thanks for the support. Just for documentation completeness, I observed the same thing on that same index the following day, only that time the size of the primary was ~10GB (double the actual data) and the total size was ~15GB. After flushing again it returned to normal (5GB and 10GB) and has not displayed that behaviour since (it now is at 6.4GB, 12.7GB)

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [August 28, 2019, 11:50am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/12 "2019-08-28T11:50:35Z")

</div>

got it! I think it's the same issue. It's inconvenient for sure. Lets see if we can easily fix / address it to happen automatically.

---

<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:** [September 25, 2019, 11:50am UTC](https://discuss.elastic.co/t/total-store-size-of-index-with-only-one-shard-and-one-replica-is-three-times-the-size-of-primary/196057/13 "2019-09-25T11:50:38Z")

</div>

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