From f18a57b7bc2b4a81372e1be784f8dc91a12939ab Mon Sep 17 00:00:00 2001 From: Christian Haudum Date: Tue, 25 Jul 2023 07:52:52 +0200 Subject: [PATCH] fixup! Smooth out chunk flush operations Signed-off-by: Christian Haudum --- pkg/ingester/flush.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ingester/flush.go b/pkg/ingester/flush.go index a2d33b9bfc88a..eaddcc5566ec3 100644 --- a/pkg/ingester/flush.go +++ b/pkg/ingester/flush.go @@ -137,8 +137,8 @@ func (i *Ingester) setFlushRate() { for _, q := range i.flushQueues { totalQueueLength += q.Length() } - const fudge = 1.05 // aim to finish a little bit before the end of the period - flushesPerSecond := float64(totalQueueLength) / i.cfg.FlushCheckPeriod.Seconds() * fudge + const jitter = 1.05 // aim to finish a little bit before the end of the period + flushesPerSecond := float64(totalQueueLength) / i.cfg.FlushCheckPeriod.Seconds() * jitter // Avoid going very slowly with tiny queues if flushesPerSecond*i.cfg.FlushCheckPeriod.Seconds() < minFlushes { flushesPerSecond = minFlushes / i.cfg.FlushCheckPeriod.Seconds()