# Bulk size in bulk processor

**URL:** <https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030>\
**Category:** Elasticsearch\
**Created:** [September 11, 2017, 10:07am UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030 "2017-09-11T10:07:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sambit\_Kabi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sambit\_Kabi](https://discuss.elastic.co/u/Sambit_Kabi)\
**Post date:** [September 11, 2017, 10:07am UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030/1 "2017-09-11T10:07:57Z")

</div>

Hello ,

I would like to understand what does bulk size actually mean? Which size does it refer to?  
Is it the size of the documents we are indexing in a bulk manner per request?

Please help me with it.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 11, 2017, 11:04am UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030/2 "2017-09-11T11:04:48Z")

</div>

`setBulkSize()` defines the total size of the bulk before it's sent to elasticsearch.

If you set it to 10kb and add a JSON of around 1kb, then around every 10 documents (probably less because of the headers), a bulk request will be sent to elasticsearch.

`setBulkActions(10000)` sets the number of requests before executing the bulk. Here every 10000 requests.

`setFlushInterval(TimeValue.timeValueSeconds(5))` performs a bulk call every 5 seconds whatever the number of documents or the size in bytes (if there is at least one request of course).

HTH

---

<div class="post-metadata">

**Author:** ![Sambit\_Kabi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sambit\_Kabi](https://discuss.elastic.co/u/Sambit_Kabi)\
**Post date:** [September 11, 2017, 11:07am UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030/3 "2017-09-11T11:07:59Z")

</div>

Thanks David.  
So basically it is the size of the payload(here it is size of JSON docs) that is flushed to the server.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 11, 2017, 12:19pm UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030/4 "2017-09-11T12:19:57Z")

</div>

Yes.

---

<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:** [October 9, 2017, 12:20pm UTC](https://discuss.elastic.co/t/bulk-size-in-bulk-processor/100030/5 "2017-10-09T12:20:16Z")

</div>

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