Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6A0m-00B3W8-LN for pgsql-general@arkaria.postgresql.org; Wed, 30 Oct 2024 14:49:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t6A0k-009UAt-P0 for pgsql-general@arkaria.postgresql.org; Wed, 30 Oct 2024 14:49:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6A0k-009UAl-Dm for pgsql-general@lists.postgresql.org; Wed, 30 Oct 2024 14:49:26 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6A0h-003pwe-VE for pgsql-general@lists.postgresql.org; Wed, 30 Oct 2024 14:49:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 49UEnFLe567475; Wed, 30 Oct 2024 10:49:15 -0400 From: Tom Lane To: Greg Sabino Mullane cc: "Daniel Westermann (DWE)" , Laurenz Albe , "pgsql-general@lists.postgresql.org" Subject: Re: Delays between "connection received" and "connection authenticated" because of localhost entries in hba In-reply-to: References: <376cac6e4ffe1dfb9f59f47a9652dfa49c033ec6.camel@cybertec.at> Comments: In-reply-to Greg Sabino Mullane message dated "Wed, 30 Oct 2024 10:22:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <567473.1730299755.1@sss.pgh.pa.us> Date: Wed, 30 Oct 2024 10:49:15 -0400 Message-ID: <567474.1730299755@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greg Sabino Mullane writes: > I'd echo the suggestion to strace this. You can use the pre_auth_delay > 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