Add max size limit to requests for bulk import #996
+41
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a new parameter
max_size
, in bytes, which is used toenforce an upper limit on the overall HTTP POST size. This is useful
when trying to maximize bulk import speed by reducing roundtrips to
retrieve and send data.
This is needed for scenarios where there is no control over
Elasticsearch's maximum HTTP request payload size. For example, AWS'
elasticsearch offering has either a 10MiB or 100MiB HTTP request payload
size limit.
batch_size
is good for bounding local runtime memory usage, but whenindexing large sets of big objects, it's entirely possible to hit a
service provider's underlying request size limit and biff the import
mid-run. This is even worse when
force
is true - then the index isleft in an incomplete state with no obvious value to adjust batch_size
down to, in order to sneak under the limit.
The
max_size
defaults to10_000_000
, to catch the worst-casescenario on AWS.