Re: pgstat_send_connstats() introduces unnecessary timestamp and UDP overhead

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
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 03:51:58
Message-ID: YSW+XqWhMTHzw7sR@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-08-25 04:00:10 Re: [PATCH] Disable bgworkers during servers start in pg_upgrade
Previous Message Michael Paquier 2021-08-25 03:03:09 Re: [PATCH] Add tab completion for EXECUTE after EXPLAIN