# Please help to describe indexing buffer related parameters' workflow

**URL:** <https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927>\
**Category:** Elasticsearch\
**Created:** [December 24, 2015, 10:12am UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927 "2015-12-24T10:12:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![makeyang](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@makeyang](https://discuss.elastic.co/u/makeyang)\
**Post date:** [December 24, 2015, 10:12am UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927/1 "2015-12-24T10:12:44Z")

</div>

let's assume below parameters are all default and index.refresh\_interval set -1:  
indices.memory.index\_buffer\_size (10%)  
indices.memory.min\_index\_buffer\_size (48mb)  
indices.memory.max\_index\_buffer\_size (unbounded)  
indices.memory.min\_shard\_index\_buffer\_size (4mb)

when start to index, ES will allocate 4mb memory for indexing and this buffer is keep fill, when it is full, how ES manage this memory? will it keep expand until it/them hit 10% limit and then flush this in memory data structure into disk or just flush this shard into disk when it hit 4mb?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [December 24, 2015, 10:54am UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927/2 "2015-12-24T10:54:44Z")

</div>

What this means is that elasticsearch will compute the size of the indexing buffer as follows:

- first take 10% of the available memory of the machine
- then divide this amount of memory among _active_ shards (shards that are actually indexing)
- if this number is less than 4MB, then bump it to 4MB

---

<div class="post-metadata">

**Author:** ![makeyang](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@makeyang](https://discuss.elastic.co/u/makeyang)\
**Post date:** [December 24, 2015, 11:11am UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927/3 "2015-12-24T11:11:45Z")

</div>

what if it is more than 4mb?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [December 24, 2015, 11:23am UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927/4 "2015-12-24T11:23:27Z")

</div>

If 10% of the memory of the machine divided by the number of active shards is less than 4MB, then elasticsearch will use 4MB for the indexing buffer.

---

<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, 2017, 11:28pm UTC](https://discuss.elastic.co/t/please-help-to-describe-indexing-buffer-related-parameters-workflow/37927/5 "2017-07-05T23:28:51Z")

</div>


