Re: contrib/pg_stat_tcpinfo

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: contrib/pg_stat_tcpinfo
Date: 2025-11-10 08:34:58
Message-ID: CAKZiRmxEOkK4E-o5fG5qvzUirE3-KV1w=UQZk-FGBJAmcGfDsQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 8, 2025 at 1:18 AM Andres Freund <andres(at)anarazel(dot)de> wrote:

Hi Andres!

>> But maybe it's very useful in practice, don't know.

> FWIW, I've needed this many times. Without the TCP information it's very hard
> to figure out why higher latency connections aren't keeping up - is it packet
> loss, it it too small network buffers on the sending/receiving side, is it the
> remote side not keeping up on the CPU level...

Pretty much the same!

> > I don't follow? Why do you want to format data the way "ss" does?
>
> Yea, I don't get that either - IMO ss's format is just about the worst
> possible format. It's very hard to parse and doesn't seem to have advantages
> making up for that.

Well yes, I've probably used the wrong expression there ("format as
the ss does"). Technically `ss` might return multiple lines and lacks
extraction of specific hosts/ports (well one can use filters, but...),
but here we have normal fields like src/dst/srcport/dstport + we can
apply WHERE on extracted JSON columns (->). I think it's way better in
pg_stat_tcpinfo even today than in ss, but I could adapt further based
on some feedback. E.g. rather than appending Vegas/BBR info like `ss`
does, we could put nested structure, just like I've did with "skmem",
so technically it's the same data as in ss, but format would not be
exactly the same, but use similar-looking names, so that someone
familiar with `ss` would know how to use it.

Still , it is still PoC, and I'm not sure if the community is open to
accept (or reject it).

-J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-11-10 08:39:31 Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
Previous Message Jakub Wartak 2025-11-10 08:30:22 Re: contrib/pg_stat_tcpinfo