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

[dbnode] Add aggregator client maxBatchSize config for bigger buffer for data sent to aggregator #2166

Merged
merged 3 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/aggregator/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Configuration struct {
ShardCutoffLingerDuration *time.Duration `yaml:"shardCutoffLingerDuration"`
Encoder EncoderConfiguration `yaml:"encoder"`
FlushSize int `yaml:"flushSize"`
MaxBatchSize int `yaml:"maxBatchSize"`
MaxTimerBatchSize int `yaml:"maxTimerBatchSize"`
QueueSize int `yaml:"queueSize"`
QueueDropType *DropType `yaml:"queueDropType"`
Expand Down Expand Up @@ -127,6 +128,9 @@ func (c *Configuration) newClientOptions(
if c.FlushSize != 0 {
opts = opts.SetFlushSize(c.FlushSize)
}
if c.MaxBatchSize != 0 {
opts = opts.SetMaxBatchSize(c.MaxBatchSize)
}
if c.MaxTimerBatchSize != 0 {
opts = opts.SetMaxTimerBatchSize(c.MaxTimerBatchSize)
}
Expand Down
10 changes: 6 additions & 4 deletions src/aggregator/client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const (
// By default there is no limit on the timer batch size.
defaultMaxTimerBatchSize = 0

defaultInstanceQueueSize = 4096
// defaultInstanceQueueSize determines how many metrics can be buffered
// before it must wait for an existing batch to be flushed to an instance.
defaultInstanceQueueSize = 2 << 15 // ~65k

// By default traffic is cut over to shards 10 minutes before the designated
// cutover time in case there are issues with the instances owning the shards.
Expand All @@ -51,10 +53,10 @@ const (
// By default the oldest metrics in the queue are dropped when it is full.
defaultDropType = DropOldest

// By default set maximum batch size to 32k
defaultMaxBatchSize = 2 << 14
// By default set maximum batch size to 8mb.
defaultMaxBatchSize = 2 << 22

// By default write at least every 100ms
// By default write at least every 100ms.
defaultBatchFlushDeadline = 100 * time.Millisecond
)

Expand Down