-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: set max conns idle per host as docappender max request #12035
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2b13b9d
perf: set max conns idle per host as docappender max request
kruskall 3f0ccbc
fix: use default value of 10
kruskall e7c4819
fix: only overwrite maxidleconnsperhost if maxrequests is not zero
kruskall 20f07a8
fix: set max idle conns per host before creating the es client
kruskall bd127ae
Merge branch 'main' into perf/idle-max-request
kruskall 6d23501
Merge branch 'main' into perf/idle-max-request
simitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why setting it to
10
here and then only later toesConfig.MaxRequests
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10
is the default valueWe overwrite this value with
esConfig.MaxRequests
after the config has been unpacked.I've made it more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other default values are set in the
elasticsearch/config.go
; IMO the default value should also be set there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would change the value for every ES client which might not be ideal.
The default value of
10
only makes sense for the docappender client because it's the same as the default number of max requests handled by the docappender.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in this case, shouldn't this default value then always be set via
esConfig.MaxRequests
in line724
? Why setting it to a hardcoded default, that easily gets outdated (as the docappender default value comes from a different source)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded default is for when
MaxRequests
is 0.Without this line,
MaxIdleConnsPerHost
will use a default value of 0 and thehttp.Transport
will use the internal default (which is 2).The docappender on the other hand will use a default value of 10, leading to the same issue we have right now (resources being underused and connections being recreated).
We need to pass the es config before creating the es client which is then passed to the docappender so we can't do this in the go-docappender library.