# Bulk Processor

**URL:** https://discuss.elastic.co/t/bulk-processor/16332
**Category:** Elasticsearch
**Created:** [March 12, 2014, 7:51pm UTC](https://discuss.elastic.co/t/bulk-processor/16332 "2014-03-12T19:51:36Z")
**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:51pm UTC](https://discuss.elastic.co/t/bulk-processor/16332/1 "2014-03-12T19:51:36Z")

</div>

I don't quite undertsand what the bulk processor is doing this, I would  
like someone to explain how it is upposed to work to make sure I designed  
this correctly.  
I specify the number of actions 1000.  
my feeder keeos pushing documents to it "Its more like a loop iterating  
documents folders", and I push eash document to the bulk. I expected the  
bulk to queue things until it reaches 1000 docs, then processes the bulk?

Yet, this is how it logs, thie 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/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [March 12, 2014, 8:05pm UTC](https://discuss.elastic.co/t/bulk-processor/16332/2 "2014-03-12T20:05:49Z")

</div>

It also flush docs after a given time, let's say every 5 seconds.  
BTW there is a small issue which basically flush the Bulk every n-1 docs instead of n.

Fix is on the way.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 12 mars 2014 à 20:51, ZenMaster80 [sabdalla80@gmail.com](mailto:sabdalla80@gmail.com) a écrit :

I don't quite undertsand what the bulk processor is doing this, I would like someone to explain how it is upposed to work to make sure I designed this correctly.  
I specify the number of actions 1000.  
my feeder keeos pushing documents to it "Its more like a loop iterating documents folders", and I push eash document to the bulk. I expected the bulk to queue things until it reaches 1000 docs, then processes the bulk?

Yet, this is how it logs, thie 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/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com).  
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/ECA7026F-218A-4AB0-8C50-7AA223FCD1FB%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/ECA7026F-218A-4AB0-8C50-7AA223FCD1FB%40pilato.fr).  
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 14, 2014, 2:50pm UTC](https://discuss.elastic.co/t/bulk-processor/16332/3 "2014-03-14T14:50:45Z")

</div>

David,

Sorry, I didn't quite follow, does it do the flushing automatically or am I  
supposed to tell it?

On Wednesday, March 12, 2014 4:05:49 PM UTC-4, David Pilato wrote:

> It also flush docs after a given time, let's say every 5 seconds.  
> BTW there is a small issue which basically flush the Bulk every n-1 docs  
> instead of n.
> 
> Fix is on the way.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 12 mars 2014 à 20:51, ZenMaster80 \<[sabda...@gmail.com](mailto:sabda...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> I don't quite undertsand what the bulk processor is doing this, I would  
> like someone to explain how it is upposed to work to make sure I designed  
> this correctly.  
> I specify the number of actions 1000.  
> my feeder keeos pushing documents to it "Its more like a loop iterating  
> documents folders", and I push eash document to the bulk. I expected the  
> bulk to queue things until it reaches 1000 docs, then processes the bulk?
> 
> Yet, this is how it logs, thie 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/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%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/9cb96ece-d30d-49a2-bcb4-bb09098094fc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9cb96ece-d30d-49a2-bcb4-bb09098094fc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [March 14, 2014, 3:01pm UTC](https://discuss.elastic.co/t/bulk-processor/16332/4 "2014-03-14T15:01:15Z")

</div>

It does it automatically.

You just have to properly call .close() when you stop you application.  
It will process the pending requests before actually exiting.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 14 mars 2014 à 15:50:48, ZenMaster80 ([sabdalla80@gmail.com](mailto:sabdalla80@gmail.com)) a écrit:

David,

Sorry, I didn't quite follow, does it do the flushing automatically or am I supposed to tell it?

On Wednesday, March 12, 2014 4:05:49 PM UTC-4, David Pilato wrote:  
It also flush docs after a given time, let's say every 5 seconds.  
BTW there is a small issue which basically flush the Bulk every n-1 docs instead of n.

Fix is on the way.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 12 mars 2014 à 20:51, ZenMaster80 [sabda...@gmail.com](mailto:sabda...@gmail.com) a écrit :

I don't quite undertsand what the bulk processor is doing this, I would like someone to explain how it is upposed to work to make sure I designed this correctly.  
I specify the number of actions 1000.  
my feeder keeos pushing documents to it "Its more like a loop iterating documents folders", and I push eash document to the bulk. I expected the bulk to queue things until it reaches 1000 docs, then processes the bulk?

Yet, this is how it logs, thie 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). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3f06e4bc-eb79-4dd8-b987-1bf86c028062%40googlegroups.com). 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/9cb96ece-d30d-49a2-bcb4-bb09098094fc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9cb96ece-d30d-49a2-bcb4-bb09098094fc%40googlegroups.com).  
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/etPan.532319bc.1190cde7.1ccf%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532319bc.1190cde7.1ccf%40MacBook-Air-de-David.local).  
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/16332/5 "2017-07-06T01:43:08Z")

</div>


