-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix subscriber service dropping writes under high write load #7407
Conversation
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.
This means that the PointsWriter implementations need to be safe for concurrent calls to WritePoints.
I checked and the existing implementation are, but we should add a comment to the Interface so that its clear for future implementations.
Just one small typo but otherwise this looks good to me.
@@ -8,7 +8,9 @@ import ( | |||
) | |||
|
|||
const ( | |||
DefaultHTTPTimeout = 30 * time.Second | |||
DefaultHTTPTimeout = 30 * time.Second | |||
DefaultWriteConcurrenty = 40 |
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.
Should this be DefaultWriteConcurrency
?
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.
Yep
The subscriber write goroutine would drop points if the write load was higher than it could process. This could happen with a just a few writers to the server. Instead, process the channel with multiple writers to avoid dropping writes so easily. This also adds some config options to control how large the channel buffer is as well as how many goroutines are started. Fixes #7330
@nathanielc Updated. |
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.
LGTM
Required for all non-trivial PRs
The subscriber write goroutine would drop points if the write load
was higher than it could process. This could happen with a just
a few writers to the server.
Instead, process the channel with multiple writers to avoid dropping
writes so easily. This also adds some config options to control how
large the channel buffer is as well as how many goroutines are started.
Fixes #7330
cc @nathanielc