public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bertrand Drouvot <[email protected]>
To: Andres Freund <[email protected]>
Cc: Melanie Plageman <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: Guillaume Lelarge <[email protected]>
Cc: Pg Hackers <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Cc: [email protected]
Cc: Jelte Fennema-Nio <[email protected]>
Cc: Jacob Champion <[email protected]>
Subject: Re: Log connection establishment timings
Date: Fri, 28 Feb 2025 05:14:17 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <bgn52vsoxoqato3l3wqsc3vqyd6xbkvd6ylhmh2yd5m4srjn3n@j5kocng6bfa2>
References: <CAAKRu_b_smAHK0ZjrnL5GRxnAVWujEXQWpLXYzGbmpcZd3nLYw@mail.gmail.com>
	<CAECtzeW3bFOT8v_th9hu6O9c0p+yNkD0ceBneWOtXYcwVd73rA@mail.gmail.com>
	<[email protected]>
	<CAAKRu_YrNsA7-v5L9d318XZu+tPqcxp+ctCGy2EGYrSt69ON=A@mail.gmail.com>
	<CAAKRu_aV+B2yLpkcfh06tJV7XQPodjasxQ=XKh+MjD8ixkXwrA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAAKRu_bWRipJ2HA8cwvxrZOhSpvpPLkvhcBHecXBx8_wS4cjQQ@mail.gmail.com>
	<[email protected]>
	<bgn52vsoxoqato3l3wqsc3vqyd6xbkvd6ylhmh2yd5m4srjn3n@j5kocng6bfa2>

Hi,

On Thu, Feb 27, 2025 at 11:14:56AM -0500, Andres Freund wrote:
> I don't think the timing overhead is a relevant factor here - compared to the
> fork of a new connection or performing authentication the cost of taking a few
> timestamps is neglegible. A timestamp costs 10s to 100s of cycles, a fork many
> many millions. Even if you have a really slow timestamp function, it's still
> going to be way way cheaper.

That's a very good point, it has to be put in perspective. The difference in
scale is so significant that the timing collection shouldn't be a concern.
Fair point!

Now I'm thinking what about "if" the connection was on a multi-threaded model?

I think we could reach the same conclusion as thread creation overhead is 
still substantial (allocating stack space, initializing thread state, and other
kernel-level operations) as compare to a really slow timestamp function.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






view thread (24+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Log connection establishment timings
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox