Re: pgstat_send_connstats() introduces unnecessary timestamp and UDP overhead

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: laurenz(dot)albe(at)cybertec(dot)at, andres(at)anarazel(dot)de, magnus(at)hagander(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstat_send_connstats() introduces unnecessary timestamp and UDP overhead
Date: 2021-08-25 04:21:52
Message-ID: 20210825.132152.1188572223287129372.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 25 Aug 2021 12:51:58 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> On Wed, Aug 25, 2021 at 10:12:41AM +0900, Kyotaro Horiguchi wrote:
> > Yes, it can be called two or more times for a call to
> > pgstat_report_stat, but the patch causes only the first of them convey
> > effective connection stats numbers. This is the same way as how
> > transaction stats are treated. If no table activities have taken
> > place at all, pgStatXactCommit/Rollback are not consumed then the
> > following condition:
>
> I was looking at this WIP patch, and plugging in the connection
> statistics to the table-access statistics looks like the wrong
> abstraction to me. I find much cleaner the approach of HEAD to use a
> separate API to report this information, as of
> pgstat_send_connstats().
>
> As of the two problems discussed on this thread, aka the increased
> number of UDP packages and the extra timestamp computations, it seems
> to me that we had better combine the following ideas for HEAD and 14,
> for now:
> - Avoid the extra timestamp computation as proposed by Laurenz in [1]
> - Throttle the frequency where the connection stat packages are sent,
> as of [2].
>
> Magnus, this open item is assigned to you as the committer of
> 960869d. Could you comment on those issues?
>
> [1]: https://www.postgresql.org/message-id/4095ceb328780d1bdba77ac6d9785fd7577ed047.camel@cybertec.at
> [2]: https://www.postgresql.org/message-id/20210801205501.nyxzxoelqoo4x2qc@alap3.anarazel.de

About [2], we need to maintain session active/idel times on additional
menbers in backend status. Letting gpgstat_report_activity to
directly scribble on backend status array would work?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-08-25 04:22:11 Re: Skipping logical replication transactions on subscriber side
Previous Message Michael Paquier 2021-08-25 04:00:10 Re: [PATCH] Disable bgworkers during servers start in pg_upgrade