Skip to content
Snippets Groups Projects
Unverified Commit fdebe3f4 authored by Joel Takvorian's avatar Joel Takvorian Committed by GitHub
Browse files

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
parent c8b5e31f
No related branches found
No related tags found
No related merge requests found
...@@ -91,15 +91,9 @@ func (m *RingBufTracer) listenAndForwardRingBuffer(debugging bool, forwardCh cha ...@@ -91,15 +91,9 @@ func (m *RingBufTracer) listenAndForwardRingBuffer(debugging bool, forwardCh cha
if debugging { if debugging {
m.stats.logRingBufferFlows(mapFullError) m.stats.logRingBufferFlows(mapFullError)
} }
// if the flow was received due to lack of space in the eBPF map errno := syscall.Errno(readFlow.Metrics.Errno)
// forces a flow's eviction to leave room for new flows in the ebpf cache
var reason string
if mapFullError {
m.mapFlusher.Flush()
reason = "mapfull"
}
// In ringbuffer, a "flow" is a 1-packet flow, it hasn't gone through aggregation yet. So we use the packet counter metric. // In ringbuffer, a "flow" is a 1-packet flow, it hasn't gone through aggregation yet. So we use the packet counter metric.
m.metrics.EvictedPacketsCounter.WithSourceAndReason("ringbuffer", reason).Inc() m.metrics.EvictedPacketsCounter.WithSourceAndReason("ringbuffer", errno.Error()).Inc()
// Will need to send it to accounter anyway to account regardless of complete/ongoing flow // Will need to send it to accounter anyway to account regardless of complete/ongoing flow
forwardCh <- readFlow forwardCh <- readFlow
return nil return nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment