Reduce default max in flight requests to 5 #108
Merged
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 package has historically been very aggressive regarding how many requests it will allow to be in flight to Elasticsearch.
We lowered the maximum number of in-flight requests to 10 recently (see #76), but I think this is still too high. Recently we have seen some Elasticsearch timeouts when running highly parallel imports.
My suspicion is that it's very unlikely a high number of in-flight bulk index requests is the best way to ensure high performance. For geocode.earth, we run planet builds on a 36 core machine, with a total of 6 importer processes running at once at the start (2 OA, OSM, polylines, geonames, WOF).
Since the bulk import endpoint already allows importing many records in parallel (500 by default in this package), 6 importers could lead to up to 60 bulk requests in flight at once, totaling 3000 records. My guess is even 2-3 bulk requests is enough to keep Elasticsearch busy, so the default config is doing nothing but filling up the Elasticsearch bulk threadpool and queue and bringing the cluster closer to tipping over the edge of too much load and having to drop requests.
Eventually I'd like to allow us to configure this option easily across all importers, but for now lets test this value.
Connects #76
Connects #83