# Bulk Processor question

**URL:** <https://discuss.elastic.co/t/bulk-processor-question/16334>\
**Category:** Elasticsearch\
**Created:** [March 12, 2014, 7:54pm UTC](https://discuss.elastic.co/t/bulk-processor-question/16334 "2014-03-12T19:54:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![IronMike](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@IronMike](https://discuss.elastic.co/u/IronMike)\
**Post date:** [March 12, 2014, 7:54pm UTC](https://discuss.elastic.co/t/bulk-processor-question/16334/1 "2014-03-12T19:54:23Z")

</div>

I don't quite undertsand what the bulk processor is doing, I would like  
someone to explain how it is supposed to work to make sure I designed this  
correctly.  
I specify the number of actions 1000.  
My feeder keeps pushing documents to it "Its more like a loop iterating  
documents folders" where I push each document to the bulk. I expected the  
bulk to queue things until it reaches 1000 docs? Then process the bulk?

Yet, this is how it logs, this comes from the call back functions of the  
bulk processor.

Bulk Called: ID= 1, Actions=33, MB=5.46250  
Bulk Called: ID= 2, Actions=29, MB=5.51660  
Bulk Succeeded: ID= 1, took= 921 ms  
Bulk Called: ID= 3, Actions=12, MB=5.691812  
Bulk Succeeded: ID= 2, took= 1526 ms

.....

Bulk Called: ID= 23, Actions=8, MB=5.45294  
Bulk Succeeded: ID= 23, took= 751 ms  
Bulk Called: ID= 24, Actions=19, MB=5.383918  
Bulk Succeeded: ID= 24, took= 331 ms  
Bulk Called: ID= 25, Actions=22, MB=5.347542  
Bulk Succeeded: ID= 25, took= 694 ms  
Bulk Called: ID= 26, Actions=58, MB=5.249195  
Bulk Succeeded: ID= 26, took= 583 ms  
Bulk Called: ID= 27, Actions=89, MB=5.244396  
Bulk Succeeded: ID= 27, took= 588 ms.....

Bulk Called: ID= 47, Actions=17, MB=5.245771 ...

Bulk Succeeded: ID= 47, took= 431 ms

Finished Processing the whole thing

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 12, 2014, 8:01pm UTC](https://discuss.elastic.co/t/bulk-processor-question/16334/2 "2014-03-12T20:01:53Z")

</div>

BulkProcessor has two thresholds, the number of actions (as you use by  
setting it to 1000) or a bulk request byte volume (default 5M). What you  
see is the 5M limit kicking in, your docs are quite large.

Jörg

On Wed, Mar 12, 2014 at 8:54 PM, ZenMaster80 [sabdalla80@gmail.com](mailto:sabdalla80@gmail.com) wrote:

> I don't quite undertsand what the bulk processor is doing, I would like  
> someone to explain how it is supposed to work to make sure I designed this  
> correctly.  
> I specify the number of actions 1000.  
> My feeder keeps pushing documents to it "Its more like a loop iterating  
> documents folders" where I push each document to the bulk. I expected the  
> bulk to queue things until it reaches 1000 docs? Then process the bulk?
> 
> Yet, this is how it logs, this comes from the call back functions of the  
> bulk processor.
> 
> Bulk Called: ID= 1, Actions=33, MB=5.46250  
> Bulk Called: ID= 2, Actions=29, MB=5.51660  
> Bulk Succeeded: ID= 1, took= 921 ms  
> Bulk Called: ID= 3, Actions=12, MB=5.691812  
> Bulk Succeeded: ID= 2, took= 1526 ms
> 
> .....
> 
> Bulk Called: ID= 23, Actions=8, MB=5.45294  
> Bulk Succeeded: ID= 23, took= 751 ms  
> Bulk Called: ID= 24, Actions=19, MB=5.383918  
> Bulk Succeeded: ID= 24, took= 331 ms  
> Bulk Called: ID= 25, Actions=22, MB=5.347542  
> Bulk Succeeded: ID= 25, took= 694 ms  
> Bulk Called: ID= 26, Actions=58, MB=5.249195  
> Bulk Succeeded: ID= 26, took= 583 ms  
> Bulk Called: ID= 27, Actions=89, MB=5.244396  
> Bulk Succeeded: ID= 27, took= 588 ms.....
> 
> Bulk Called: ID= 47, Actions=17, MB=5.245771 ...
> 
> Bulk Succeeded: ID= 47, took= 431 ms
> 
> Finished Processing the whole thing
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEg11MxwGanPVVJpvjd1py1D2PkwkBGjC05YKzh\_A1P%3Dg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEg11MxwGanPVVJpvjd1py1D2PkwkBGjC05YKzh_A1P%3Dg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![IronMike](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@IronMike](https://discuss.elastic.co/u/IronMike)\
**Post date:** [March 12, 2014, 8:06pm UTC](https://discuss.elastic.co/t/bulk-processor-question/16334/3 "2014-03-12T20:06:45Z")

</div>

My docs vary in size. some a very small, some are pdfs like showing in the  
log there, how do you suggest I do this since I don't know when the docs  
will be small or large?

On Wednesday, March 12, 2014 4:01:53 PM UTC-4, Jörg Prante wrote:

> BulkProcessor has two thresholds, the number of actions (as you use by  
> setting it to 1000) or a bulk request byte volume (default 5M). What you  
> see is the 5M limit kicking in, your docs are quite large.
> 
> Jörg
> 
> On Wed, Mar 12, 2014 at 8:54 PM, ZenMaster80 \<[sabda...@gmail.com](mailto:sabda...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I don't quite undertsand what the bulk processor is doing, I would like  
> > someone to explain how it is supposed to work to make sure I designed this  
> > correctly.  
> > I specify the number of actions 1000.  
> > My feeder keeps pushing documents to it "Its more like a loop iterating  
> > documents folders" where I push each document to the bulk. I expected the  
> > bulk to queue things until it reaches 1000 docs? Then process the bulk?
> > 
> > Yet, this is how it logs, this comes from the call back functions of the  
> > bulk processor.
> > 
> > Bulk Called: ID= 1, Actions=33, MB=5.46250  
> > Bulk Called: ID= 2, Actions=29, MB=5.51660  
> > Bulk Succeeded: ID= 1, took= 921 ms  
> > Bulk Called: ID= 3, Actions=12, MB=5.691812  
> > Bulk Succeeded: ID= 2, took= 1526 ms
> > 
> > .....
> > 
> > Bulk Called: ID= 23, Actions=8, MB=5.45294  
> > Bulk Succeeded: ID= 23, took= 751 ms  
> > Bulk Called: ID= 24, Actions=19, MB=5.383918  
> > Bulk Succeeded: ID= 24, took= 331 ms  
> > Bulk Called: ID= 25, Actions=22, MB=5.347542  
> > Bulk Succeeded: ID= 25, took= 694 ms  
> > Bulk Called: ID= 26, Actions=58, MB=5.249195  
> > Bulk Succeeded: ID= 26, took= 583 ms  
> > Bulk Called: ID= 27, Actions=89, MB=5.244396  
> > Bulk Succeeded: ID= 27, took= 588 ms.....
> > 
> > Bulk Called: ID= 47, Actions=17, MB=5.245771 ...
> > 
> > Bulk Succeeded: ID= 47, took= 431 ms
> > 
> > Finished Processing the whole thing
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a3131fe6-5183-495f-8658-21b276a72eb6%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/23cffa8e-ba3f-49f7-9b23-5b4fdd47b054%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/23cffa8e-ba3f-49f7-9b23-5b4fdd47b054%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 12, 2014, 8:41pm UTC](https://discuss.elastic.co/t/bulk-processor-question/16334/4 "2014-03-12T20:41:09Z")

</div>

If you want to bulk by action count only, set the bulk size threshold to  
-1. Here is an example (check bulkIndexByActions method):

> <https://github.com/bly2k/es-java-examples/blob/master/index/BulkProcessorExample.java>

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/681ba366-4ebd-41a8-a524-847412ed6bf4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/681ba366-4ebd-41a8-a524-847412ed6bf4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:43am UTC](https://discuss.elastic.co/t/bulk-processor-question/16334/5 "2017-07-06T01:43:40Z")

</div>


