Skip to content

Commit fdebe3f

Browse files
authored
NETOBSERV-1564: do not force flushing maps when rb is triggered (#348)
Flushing (without throttling) has a nefast effect in high stressed scenario, generating a lot of evictions from maps, resulting in many more flows generated. High stressed scenarios should rather rely on rb+accounter, which better handles the number of generated flows. Also, use errno as the reason for the metric
1 parent c8b5e31 commit fdebe3f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/flow/tracer_ringbuf.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,9 @@ func (m *RingBufTracer) listenAndForwardRingBuffer(debugging bool, forwardCh cha
9191
if debugging {
9292
m.stats.logRingBufferFlows(mapFullError)
9393
}
94-
// if the flow was received due to lack of space in the eBPF map
95-
// forces a flow's eviction to leave room for new flows in the ebpf cache
96-
var reason string
97-
if mapFullError {
98-
m.mapFlusher.Flush()
99-
reason = "mapfull"
100-
}
94+
errno := syscall.Errno(readFlow.Metrics.Errno)
10195
// In ringbuffer, a "flow" is a 1-packet flow, it hasn't gone through aggregation yet. So we use the packet counter metric.
102-
m.metrics.EvictedPacketsCounter.WithSourceAndReason("ringbuffer", reason).Inc()
96+
m.metrics.EvictedPacketsCounter.WithSourceAndReason("ringbuffer", errno.Error()).Inc()
10397
// Will need to send it to accounter anyway to account regardless of complete/ongoing flow
10498
forwardCh <- readFlow
10599
return nil

0 commit comments

Comments
 (0)