netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <dave.seddon.ca@gmail.com>
Cc: <netdev@vger.kernel.org>, <kuniyu@amazon.com>
Subject: Re: tcp_diag for all network namespaces?
Date: Tue, 10 Dec 2024 11:00:57 +0900	[thread overview]
Message-ID: <20241210020057.26127-1-kuniyu@amazon.com> (raw)
In-Reply-To: <CANypexQX+MW_00xAo-sxO19jR1yCLVKNU3pCZvmFPuphk=cRFw@mail.gmail.com>

From: dave seddon <dave.seddon.ca@gmail.com>
Date: Mon, 9 Dec 2024 11:24:18 -0800
> G'day,
> 
> Short
> Is there a way to extract tcp_diag socket data for all sockets from
> all network name spaces please?

I think there's no such interface.

I remember there was a similar request for TCP BPF iterator,
but now it's difficult because each netns could have its own
TCP hash table for established connections.


> 
> Background
> I've been using tcp_diag to dump out TCP socket performance every
> minute and then stream the data via Kafka and then into a Clickhouse
> database.  This is awesome for socket performance monitoring.
> 
> Kubernetes
> I'd like to adapt this solution to <somehow> allow monitoring of
> kubernetes clusters, so that it would be possible to monitor the
> socket performance of all pods.  Ideally, a single process could open
> a netlink socket into each network namespace, but currently that isn't
> possible.
> 
> Would it be crazy to add a new feature to the kernel to allow dumping
> all sockets from all name spaces?

Iterating netns in userspace is much simpler than in kernel that needs
iterating net_namespace_list under net_rwsem and remembering the last
netns with the refcount bumped.


> 
> Maybe I'm missing some other better option(s)?
> 
> Thanks in advance

  reply	other threads:[~2024-12-10  2:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 19:24 tcp_diag for all network namespaces? dave seddon
2024-12-10  2:00 ` Kuniyuki Iwashima [this message]
2024-12-19 18:11   ` Martin KaFai Lau
2024-12-10  5:17 ` Cong Wang
2024-12-10 20:45   ` Jay Vosburgh
2024-12-11  6:35     ` Xiao Liang
2024-12-11 17:28       ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210020057.26127-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=dave.seddon.ca@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).