From 90fc6be70f5c11aabcc25a86b5e0bd22a15ae832 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 9 Sep 2020 21:00:23 +0100 Subject: [PATCH] Default to bigger remote_write sends (#5267) * Default to bigger remote_write sends Raise the default MaxSamplesPerSend to amortise the cost of remote calls across more samples. Lower MaxShards to keep the expected max memory usage within reason. Signed-off-by: Bryan Boreham * Change default Capacity to 2500 To maintain ratio with MaxSamplesPerSend Signed-off-by: Bryan Boreham --- config/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/config.go b/config/config.go index be21b25d6..223c8abfe 100644 --- a/config/config.go +++ b/config/config.go @@ -104,16 +104,16 @@ var ( // DefaultQueueConfig is the default remote queue configuration. DefaultQueueConfig = QueueConfig{ - // With a maximum of 1000 shards, assuming an average of 100ms remote write - // time and 100 samples per batch, we will be able to push 1M samples/s. - MaxShards: 1000, + // With a maximum of 200 shards, assuming an average of 100ms remote write + // time and 500 samples per batch, we will be able to push 1M samples/s. + MaxShards: 200, MinShards: 1, - MaxSamplesPerSend: 100, + MaxSamplesPerSend: 500, - // Each shard will have a max of 500 samples pending in it's channel, plus the pending - // samples that have been enqueued. Theoretically we should only ever have about 600 samples - // per shard pending. At 1000 shards that's 600k. - Capacity: 500, + // Each shard will have a max of 2500 samples pending in its channel, plus the pending + // samples that have been enqueued. Theoretically we should only ever have about 3000 samples + // per shard pending. At 200 shards that's 600k. + Capacity: 2500, BatchSendDeadline: model.Duration(5 * time.Second), // Backoff times for retrying a batch of samples on recoverable errors.