Skip to content

Commit 7906db8

Browse files
authored
Update BulkProcessor size in the example
By default, it is recommended to start bulk with a size of 10-15MB, and increase it gradually to get the right size for the environment. The example shows originally 1GB, which can lead to some users to just copy-paste the code snippet and start with excessively big sizes. Backport of elastic#21664 in master branch.
1 parent 99f8c21 commit 7906db8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/java-api/docs/bulk.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ BulkProcessor bulkProcessor = BulkProcessor.builder(
7171
Throwable failure) { ... } <4>
7272
})
7373
.setBulkActions(10000) <5>
74-
.setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB)) <6>
74+
.setBulkSize(new ByteSizeValue(5, ByteSizeUnit.MB)) <6>
7575
.setFlushInterval(TimeValue.timeValueSeconds(5)) <7>
7676
.setConcurrentRequests(1) <8>
7777
.setBackoffPolicy(
@@ -85,7 +85,7 @@ BulkProcessor bulkProcessor = BulkProcessor.builder(
8585
with `response.hasFailures()`
8686
<4> This method is called when the bulk failed and raised a `Throwable`
8787
<5> We want to execute the bulk every 10 000 requests
88-
<6> We want to flush the bulk every 1gb
88+
<6> We want to flush the bulk every 5mb
8989
<7> We want to flush the bulk every 5 seconds whatever the number of requests
9090
<8> Set the number of concurrent requests. A value of 0 means that only a single request will be allowed to be
9191
executed. A value of 1 means 1 concurrent request is allowed to be executed while accumulating new bulk requests.

0 commit comments

Comments
 (0)