Subject: Re: Delays between "connection received" and "connection authenticated" because of localhost entries in hba

From: Greg Sabino Mullane <[email-masked]>
Date: Wed, 30 Oct 2024 10:22:42 -0400

I'd echo the suggestion to strace this. You can use the pre_auth_delay
setting to help facilitate that. See:

https://www.postgresql.org/docs/current/runtime-config-developer.html

Cheers,
Greg

---

From: Tom Lane <[email-masked]>
Date: Wed, 30 Oct 2024 10:49:15 -0400

> setting to help facilitate that. See:

IIUC, the delays are rare and unpredictable, so that strace'ing seems
unlikely to be practical.

If rebuilding from source is feasible, you could insert monitoring
elog(LOG) calls around the name lookup (that is, around the
pg_getnameinfo_all call in src/backend/libpq/hba.c).  This would
confirm or disprove the theory that the name lookup is the source
of the issue, which is about as much as we'd get out of strace.

			regards, tom lane

---

From: "Daniel Westermann (DWE)" <[email-masked]>
Date: Wed, 30 Oct 2024 15:07:32 +0000

>of the issue, which is about as much as we'd get out of strace.

Thanks for all your tips/hints

Regards
Daniel