# Flash to disk

**URL:** <https://discuss.elastic.co/t/flash-to-disk/181332>\
**Category:** Elasticsearch\
**Created:** [May 16, 2019, 8:08am UTC](https://discuss.elastic.co/t/flash-to-disk/181332 "2019-05-16T08:08:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roiwexler](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@roiwexler](https://discuss.elastic.co/u/roiwexler)\
**Post date:** [May 16, 2019, 8:08am UTC](https://discuss.elastic.co/t/flash-to-disk/181332/1 "2019-05-16T08:08:45Z")

</div>

Hi,  
at ES documentations is says - By default, Elasticsearch uses heuristics in order to automatically trigger flushes as required.

does anyone knows when ES triggers flush to disk and if there is a way to configure it..

we saw that when running a heavy indexing process, and the RAM is getting full, flash to disk happens every few seconds, and that slows our indexing speed..

with Solr you have the ability to control when a this flash runs (called hard commit)  
any ideas what can we do to control it?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [May 16, 2019, 8:25am UTC](https://discuss.elastic.co/t/flash-to-disk/181332/2 "2019-05-16T08:25:48Z")

</div>

> [@roiwexler](#):
>
> we saw that when running a heavy indexing process, and the RAM is getting full, flash to disk happens every few seconds, and that slows our indexing speed..

Elasticsearch allows you to specify the [refresh\_interval](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#bulk) for an index, setting this to -1 is something I do before bulk indexing or reindexing to speed things up:

```
PUT /my_index/_settings
{
    "index" : {
        "refresh_interval" : "-1"
    }
}

```

Then when I'm done indexing I set **"refresh\_interval" : "null"** which resets the refresh interval to its default value (1 second).

If you need to force a flush on an index, to persist it to disc, use the [Flush](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html) API.

---

<div class="post-metadata">

**Author:** ![roiwexler](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@roiwexler](https://discuss.elastic.co/u/roiwexler)\
**Post date:** [May 20, 2019, 12:30pm UTC](https://discuss.elastic.co/t/flash-to-disk/181332/3 "2019-05-20T12:30:30Z")

</div>

Hi, we know about refresh\_interval and setting it to -1 is the default configuration for us in tests. the scenario I specified above is with this set already.  
this affect the

but coming back to my original question, do you know when ES triggers flush to disk and how can we control it?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [May 20, 2019, 12:49pm UTC](https://discuss.elastic.co/t/flash-to-disk/181332/4 "2019-05-20T12:49:58Z")

</div>

> [@roiwexler](#):
>
> do you know when ES triggers flush to disk

No, I'm sorry. I only know what the documentation says, that ES uses heuristics to trigger flushes and that the user can trigger this manually in order to reduce the recovery time when restarting nodes.

But are you sure flushing is the cause for the slowness you experience every few seconds? If you've turned off refreshing it could still be the garbage collector kicking in. Perhaps you could check that?

I regularly re-index hundreds of millions of documents and terabytes of data and the Reindex API uses bulk indexing underneath, but I've never experienced the problem you mention. All I ever do is turn off the index refreshing and shard replication, after that it's all smooth sailing.

I hope you can figure it out or that someone else, who knows more about the flush mechanism, can help you.

---

<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:** [May 20, 2019, 2:07pm UTC](https://discuss.elastic.co/t/flash-to-disk/181332/5 "2019-05-20T14:07:55Z")

</div>

What type of storage/dusk do you have?

---

<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:** [June 17, 2019, 2:07pm UTC](https://discuss.elastic.co/t/flash-to-disk/181332/6 "2019-06-17T14:07:57Z")

</div>

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