Re: Confirming conntrack behavior on environments with multiple network namespaces

Antonio Ojea <[email protected]> Fri, 26 Sep 2025 16:41:10 +0200
Newsgroups gmane.comp.security.firewalls.netfilter.general
Message-ID <CABhP=tY2LnPsYk9uiF4xp4SthASYAaQ6mBWDjqy1OmOom4PK9A@mail.gmail.com>
On Fri, 26 Sept 2025 at 16:03, Florian Westphal <[email protected]> wrote:

> Not sure we should add one, it will result in some overhead for no good
> reason.  Maybe /proc/slabinfo is enough for your use case?
>
> nf_conntrack has its own (global) memory pool, it should provide a
> reasonably good estimate across all netns.

interesting, just to confirm, can I approximate the load factor using
active_objects / buckets, with

active_objects=$(sudo awk '$1 == "nf_conntrack" {print $2}' /proc/slabinfo)
buckets=$(cat /proc/sys/net/netfilter/nf_conntrack_buckets)

that sounds really good