diff --git a/pkg/flow/account.go b/pkg/flow/account.go index bca28dd42267df3de3eced6d8ad3134d6cadae97..f1eca97013ba96c3a1a7a83da57ebfbf191c8cb3 100644 --- a/pkg/flow/account.go +++ b/pkg/flow/account.go @@ -74,6 +74,9 @@ func (c *Accounter) Account(in <-chan *RawRecord, out chan<- []*Record) { logrus.WithField("flows", len(evictingEntries)). Debug("evicting flows from userspace accounter after reaching cache max length") c.evict(evictingEntries, out) + // Since we will evict flows because we reached to cacheMaxFlows then reset + // evictTimer to avoid unnecessary another eviction when timer expires. + evictTick.Reset(c.evictTimeout) } c.entries[record.Id] = &record.Metrics }