public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: Daniel Westermann (DWE) <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: Delays between "connection received" and "connection authenticated" because of localhost entries in hba
Date: Wed, 30 Oct 2024 07:24:06 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <GV0P278MB0419EB5885DF99C5354804A9D24B2@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM>
References: <GV0P278MB0419EB5885DF99C5354804A9D24B2@GV0P278MB0419.CHEP278.PROD.OUTLOOK.COM>

On Tue, 2024-10-29 at 16:30 +0000, Daniel Westermann (DWE) wrote:
> we're facing a strange issue with delays between "connection received" and "connection authenticated".
> 
> # select version();
>                                                               version
> -----------------------------------------------------------------------------------------------------------------------------------
>  PostgreSQL 15.6 (Ubuntu 15.6-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
> (1 ligne)
> 
> I know, this is not the latest minor version.
> 
> # \! cat /etc/os-release | head -1
> PRETTY_NAME="Ubuntu 22.04.4 LTS"
> 
> What we see in the log is this (around 4 seconds delay):
> 
> 2024-05-07 15:29:50.244 CEST [369909] LOG:  connection received: host=xx.xx.xx.100 port=48434
> 2024-05-07 15:29:54.518 CEST [369909] LOG:  connection authenticated: identity="xxxxxx" method=md5 (/etc/postgresql/15/main/pg_hba.conf:121)
> 
> The matching line is this ( I know md5 ):
> host    all             xxxxx     xx.xx.xx.0/24            md5
> 
> What we've found out so far is, that this only happens if we have a localhost(or any other hostname) line before the line matching our connection, something like this:
> host    replication     xxxxx     localhost                md5
> host    all             xxxxx     xx.xx.xx.0/24            md5

I'd "strace" such a database connection to see where the time is spent.

Yours,
Laurenz Albe


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]
  Subject: Re: Delays between "connection received" and "connection authenticated" because of localhost entries in hba
  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