Re: pgstat_send_connstats() introduces unnecessary timestamp and UDP overhead
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, magnus@hagander.net, pgsql-hackers@postgresql.org
Date: 2021-08-31T02:55:35Z
Lists: pgsql-hackers
On Fri, 2021-08-27 at 13:57 +0900, Michael Paquier wrote: > > I think in that case we'd have to do the bigger redesign and move "live" > > connection stats to backend_status.c... > > Hmm. A redesign is not really an option for 14 at this stage. And I > am not really comfortable with the latest proposal from upthread to > plug in that to pgstat_send_tabstat to report things once per > transaction, either. It really looks like this needs more thoughts, > and it would mean that a revert may be the most appropriate choice > for the moment. That's the last-resort option, surely, but we are > post-beta3 so there is no much margin left. In the view of that, how about doubling PGSTAT_STAT_INTERVAL to 1000 milliseconds? That would mean slightly less up-to-date statistics, but I doubt that that will be a problem. And it should even out the increase in statistics messages, except in the case of lots of short-lived sessions. But in that scenario you cannot have session statistics without lots of extra messages, and such a workload has enough performance problems as it is, so I don't think we have to specifically worry about it. Yours, Laurenz Albe
Commits
-
Fix performance regression from session statistics.
- 7890a423470b 14.0 landed
- 37a9aa659111 15.0 landed
-
Add pg_stat_database counters for sessions and session time
- 960869da0803 14.0 cited