# Optimal chunk size for bulk & scan

**URL:** <https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941>\
**Category:** Elasticsearch\
**Created:** [December 9, 2017, 7:34pm UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941 "2017-12-09T19:34:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [December 9, 2017, 7:34pm UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941/1 "2017-12-09T19:34:42Z")

</div>

We are using Elasticsearch python lib. We are doing a lot of `bulk` and `scan` operations. I wonder if there is any recommendation about the optimal bulk size for write/update operations and chuck size for scan read operations.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 10, 2017, 8:15am UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941/2 "2017-12-10T08:15:06Z")

</div>

We suggest aiming for 5MB for `_bulk`. Work backwards to see what that means for doc count, then try adjusting up and down till you get the best performance.

---

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [December 10, 2017, 11:08am UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941/3 "2017-12-10T11:08:12Z")

</div>

just want to make sure that the 5MB suggestion is relevant for version 1.4.7 as well 🙂  
Can you approve please?  
And what about scan?  
What is the simple way to see document size?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 10, 2017, 9:59pm UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941/4 "2017-12-10T21:59:22Z")

</div>

The only solid recommendation I can make for 1.4 is to upgrade, it was EOL [nearly 2 years ago](https://www.elastic.co/support/eol).

I am not sure if there is comparable suggestions for scroll, but you should definitely run some automated testing.

---

<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, 2018, 9:59pm UTC](https://discuss.elastic.co/t/optimal-chunk-size-for-bulk-scan/110941/5 "2018-01-07T21:59:29Z")

</div>

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