# Refresh store stats

**URL:** <https://discuss.elastic.co/t/refresh-store-stats/160200>\
**Category:** Elasticsearch\
**Created:** [December 10, 2018, 3:13pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200 "2018-12-10T15:13:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuvalPruss](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@YuvalPruss](https://discuss.elastic.co/u/YuvalPruss)\
**Post date:** [December 10, 2018, 3:13pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200/1 "2018-12-10T15:13:15Z")

</div>

Hi,  
I opened this issue in the ES github: [Elasticsearch store.size and pri.store.size does not updated after creating an index · Issue #36274 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/36274)  
Shortly, I had this problem:

> When I'm creating an index, I'm looking at the cat indices path with `http;//localhost:9200/_cat/indices/<indexes>` for the store.size which the index takes, and it's always takes only 324 bytes, thought after 10 seconds approximately the store.size is updated to the real storage size of the index.  
> I tried to `flush` the index, I tried to `forcemerge` the index and to `refresh` the index. nothing changed. The `store.size` only gets updated only after 10 seconds, no matter what.  
> Not only that, the `_stats` path of the index ( `http;//localhost:9200/<indexes>/_stats` ) also show the wrong storage size (in the `store` key).

I got this answer:

> Elasticsearch caches store size and performs refresh  
> each index.store.stats\_refresh\_interval, which is exactly 10 seconds  
> by default. Consider changing this setting.

But I don't want to overload my easticsearch and want the refresh to occur only once, after I create the index.

Is there any REST request I can perform to update the store stats immediately after the index creation?

---

<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:** [December 10, 2018, 3:36pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200/2 "2018-12-10T15:36:14Z")

</div>

> [@YuvalPruss](#):
>
> Is there any REST request I can perform to update the store stats immediately after the index creation?

It looks like if you do something drastic like closing and reopening the index then the cached value is discarded, but otherwise I can't see how.

Why do you want to do know the exact size of an empty index just after creation?

---

<div class="post-metadata">

**Author:** ![YuvalPruss](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@YuvalPruss](https://discuss.elastic.co/u/YuvalPruss)\
**Post date:** [December 10, 2018, 3:48pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200/3 "2018-12-10T15:48:21Z")

</div>

Not after the index creation, I am sending in bulk the index docs.  
I want to have a REST API call to refresh the stats right after this operation ends, so I won't have to wait this 10 seconds.

---

<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:** [December 10, 2018, 4:43pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200/4 "2018-12-10T16:43:00Z")

</div>

I see. No, I don't think this is possible. Note that the size of the index on disk is not a very well-defined concept, because of background activity like merges and refreshes and so on, so even if you disable caching by setting the refresh time to zero to get a completely up-to-date value it is not necessarily correct by the time it arrives at the client.

---

<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 7, 2019, 4:43pm UTC](https://discuss.elastic.co/t/refresh-store-stats/160200/5 "2019-01-07T16:43:04Z")

</div>

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