Skip to content

Commit

Permalink
[dbnode] Add aggregator client maxBatchSize config for bigger buffer …
Browse files Browse the repository at this point in the history
…for data sent to aggregator (#2166)
  • Loading branch information
robskillington authored Feb 24, 2020
1 parent 2cdacd3 commit 7e3859c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 7e3859c

Please sign in to comment.