diff --git a/pkg/network/tracer/connection/ebpfless/tcp_processor.go b/pkg/network/tracer/connection/ebpfless/tcp_processor.go index c071971f78f1f..c83a5430b96f1 100644 --- a/pkg/network/tracer/connection/ebpfless/tcp_processor.go +++ b/pkg/network/tracer/connection/ebpfless/tcp_processor.go @@ -70,7 +70,7 @@ type TCPProcessor struct { } // TODO make this into a config value -const maxPendingConns = 1024 +const maxPendingConns = 4096 // NewTCPProcessor constructs an empty TCPProcessor func NewTCPProcessor(cfg *config.Config) *TCPProcessor { diff --git a/pkg/network/tracer/connection/ebpfless_tracer.go b/pkg/network/tracer/connection/ebpfless_tracer.go index bd9c60ea43aa2..88c744239fd39 100644 --- a/pkg/network/tracer/connection/ebpfless_tracer.go +++ b/pkg/network/tracer/connection/ebpfless_tracer.go @@ -242,9 +242,11 @@ func (t *ebpfLessTracer) processConnection( case ebpfless.ProcessResultStoreConn: maxTrackedConns := int(t.config.MaxTrackedConnections) ok := ebpfless.WriteMapWithSizeLimit(t.conns, conn.ConnectionTuple, conn, maxTrackedConns) - // we don't have enough space to add this connection, remove its TCP state tracking - if !ok && conn.Type == network.TCP { - t.tcp.RemoveConn(conn.ConnectionTuple) + if !ok { + // we don't have enough space to add this connection, remove its TCP state tracking + if conn.Type == network.TCP { + t.tcp.RemoveConn(conn.ConnectionTuple) + } ebpfLessTracerTelemetry.droppedConnections.Inc() } case ebpfless.ProcessResultCloseConn: