Re: Log connection establishment timings - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Log connection establishment timings
Date
Msg-id CAOYmi+mGVQ63SwxF7ZKCNEUs1jz4ebD11pWxt8X40k=-L2dQyg@mail.gmail.com
Whole thread Raw
In response to Re: Log connection establishment timings  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-hackers
On Mon, Jan 20, 2025 at 7:01 AM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
> Though time changes are "rare", given the fact that those metrics could provide
> "inaccurate" measurements during that particular moment (time change) then it
> might be worth considering instr_time instead for this particular metric.

+1, I think a CLOCK_MONOTONIC source should be used for this if we've got it.

--

For the EXEC_BACKEND case (which, to be honest, I don't know much
about), I originally wondered if the fork_duration should include any
of the shared memory manipulations or library reloads that are done to
match Unix behavior. But I think I prefer the way the patch does it.
Can the current timestamp be recorded right at the beginning of
SubPostmasterMain(), to avoid counting the time setting up GUCs and
reading the variables file, or do we have to wait?

nit: conn_timing is currently declared in the "interrupts and crit
section" part of miscadmin.h; should it be moved down to the
general-purpose globals?

Thanks,
--Jacob



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Bypassing cursors in postgres_fdw to enable parallel plans
Next
From: Tom Lane
Date:
Subject: Re: Eager aggregation, take 3