Skip to content
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

Merged
merged 1 commit into from
Oct 5, 2016
Merged

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Oct 4, 2016

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

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

@jwilder jwilder added this to the 1.0.2 milestone Oct 4, 2016
Copy link
Contributor

@nathanielc nathanielc left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be DefaultWriteConcurrency?

Copy link
Contributor Author

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
@jwilder
Copy link
Contributor Author

jwilder commented Oct 4, 2016

@nathanielc Updated.

Copy link
Contributor

@nathanielc nathanielc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants