Skip to content

Commit

Permalink
fixup! Smooth out chunk flush operations
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum committed Jul 25, 2023
1 parent 18ed977 commit f18a57b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ingester/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f18a57b

Please sign in to comment.