pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgreSQL local connection is taking 4 seconds
10+ messages / 5 participants
[nested] [flat]
* PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 13:58 pramod kg <pramod11287@gmail.com>
0 siblings, 2 replies; 10+ messages in thread
From: pramod kg @ 2024-01-02 13:58 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Hi Experts,
We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines. After
upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS and
non TLS connection). Please advise on what to be verified? There is no
change in postgresql.conf or pg_hba.conf.
PostgreSQL version is 13.12.
RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 14:04 Ron Johnson <ronljohnsonjr@gmail.com>
parent: pramod kg <pramod11287@gmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Ron Johnson @ 2024-01-02 14:04 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Tue, Jan 2, 2024 at 8:59 AM pramod kg <pramod11287@gmail.com> wrote:
> Hi Experts,
>
> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines. After
> upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS and
> non TLS connection). Please advise on what to be verified? There is no
> change in postgresql.conf or pg_hba.conf.
>
> PostgreSQL version is 13.12.
> RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
>
What authentication method is used?
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 14:12 pramod kg <pramod11287@gmail.com>
parent: Ron Johnson <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: pramod kg @ 2024-01-02 14:12 UTC (permalink / raw)
To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
MD5
On Tue, Jan 2, 2024 at 7:34 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
> On Tue, Jan 2, 2024 at 8:59 AM pramod kg <pramod11287@gmail.com> wrote:
>
>> Hi Experts,
>>
>> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines.
>> After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS
>> and non TLS connection). Please advise on what to be verified? There is no
>> change in postgresql.conf or pg_hba.conf.
>>
>> PostgreSQL version is 13.12.
>> RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
>>
>
> What authentication method is used?
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 15:49 pramod kg <pramod11287@gmail.com>
parent: pramod kg <pramod11287@gmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: pramod kg @ 2024-01-02 15:49 UTC (permalink / raw)
To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
It's getting slower day by day. Two days back psql was taking 2 seconds to
establish a local connection. Today it is taking more than 4 seconds.
On Tue, Jan 2, 2024 at 7:42 PM pramod kg <pramod11287@gmail.com> wrote:
> MD5
>
> On Tue, Jan 2, 2024 at 7:34 PM Ron Johnson <ronljohnsonjr@gmail.com>
> wrote:
>
>> On Tue, Jan 2, 2024 at 8:59 AM pramod kg <pramod11287@gmail.com> wrote:
>>
>>> Hi Experts,
>>>
>>> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines.
>>> After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS
>>> and non TLS connection). Please advise on what to be verified? There is no
>>> change in postgresql.conf or pg_hba.conf.
>>>
>>> PostgreSQL version is 13.12.
>>> RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
>>>
>>
>> What authentication method is used?
>>
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 15:55 Thomas Kellerer <shammat@gmx.net>
parent: pramod kg <pramod11287@gmail.com>
1 sibling, 2 replies; 10+ messages in thread
From: Thomas Kellerer @ 2024-01-02 15:55 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
pramod kg schrieb am 02.01.2024 um 14:58:
> Hi Experts,
>
> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines. After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS and non TLS connection). Please advise on what to be verified? There is no change in postgresql.conf or pg_hba.conf.
>
> PostgreSQL version is 13.12.
> RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
Did you enable log_hostname?
That does a revers DNS lookup which could be a reason for the connection suddenly taking longer.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 16:04 pramod kg <pramod11287@gmail.com>
parent: Thomas Kellerer <shammat@gmx.net>
1 sibling, 0 replies; 10+ messages in thread
From: pramod kg @ 2024-01-02 16:04 UTC (permalink / raw)
To: Thomas Kellerer <shammat@gmx.net>; +Cc: pgsql-admin@lists.postgresql.org
log_hostname value is off:
postgres=# show log_hostname;
log_hostname
--------------
off
(1 row)
There is no change in postgresql.conf
On Tue, Jan 2, 2024 at 9:25 PM Thomas Kellerer <shammat@gmx.net> wrote:
>
> pramod kg schrieb am 02.01.2024 um 14:58:
> > Hi Experts,
> >
> > We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines.
> After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS
> and non TLS connection). Please advise on what to be verified? There is no
> change in postgresql.conf or pg_hba.conf.
> >
> > PostgreSQL version is 13.12.
> > RHEL Version: Red Hat Enterprise Linux release 8.8 (Ootpa)
>
> Did you enable log_hostname?
>
> That does a revers DNS lookup which could be a reason for the connection
> suddenly taking longer.
>
>
>
>
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-02 16:27 Tom Lane <tgl@sss.pgh.pa.us>
parent: Thomas Kellerer <shammat@gmx.net>
1 sibling, 1 reply; 10+ messages in thread
From: Tom Lane @ 2024-01-02 16:27 UTC (permalink / raw)
To: Thomas Kellerer <shammat@gmx.net>; +Cc: pgsql-admin@lists.postgresql.org
Thomas Kellerer <shammat@gmx.net> writes:
> pramod kg schrieb am 02.01.2024 um 14:58:
>> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines. After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS and non TLS connection). Please advise on what to be verified? There is no change in postgresql.conf or pg_hba.conf.
> Did you enable log_hostname?
> That does a revers DNS lookup which could be a reason for the connection suddenly taking longer.
Even without log_hostname, it could be a slow-DNS-lookup problem.
Rather than guessing, though, it might be time to try strace'ing
the psql session to see what it's waiting for.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-03 07:05 pramod kg <pramod11287@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 10+ messages in thread
From: pramod kg @ 2024-01-03 07:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Kellerer <shammat@gmx.net>; pgsql-admin@lists.postgresql.org
We have made some progress. GSSAPI authentication method is taking time
though we have not enabled the GSSAPI authentication method in postgres
(but the connection request is spending some time there). We continue
troubleshooting on why the GSSAPI authentication method is taking longer
time. For now we have exported the following ENV and local connections are
faster.
export PGGSSENCMODE="disable"
On Tue, Jan 2, 2024 at 9:57 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Kellerer <shammat@gmx.net> writes:
> > pramod kg schrieb am 02.01.2024 um 14:58:
> >> We have upgraded the OS from RHEL7 to RHEL8 in our testbed machines.
> After upgrading, PostgrSQL local connection is taking ~4 seconds (Both TLS
> and non TLS connection). Please advise on what to be verified? There is no
> change in postgresql.conf or pg_hba.conf.
>
> > Did you enable log_hostname?
> > That does a revers DNS lookup which could be a reason for the connection
> suddenly taking longer.
>
> Even without log_hostname, it could be a slow-DNS-lookup problem.
>
> Rather than guessing, though, it might be time to try strace'ing
> the psql session to see what it's waiting for.
>
> regards, tom lane
>
>
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-03 15:56 Tom Lane <tgl@sss.pgh.pa.us>
parent: pramod kg <pramod11287@gmail.com>
1 sibling, 0 replies; 10+ messages in thread
From: Tom Lane @ 2024-01-03 15:56 UTC (permalink / raw)
To: pramod kg <pramod11287@gmail.com>; +Cc: Thomas Kellerer <shammat@gmx.net>; pgsql-admin@lists.postgresql.org
pramod kg <pramod11287@gmail.com> writes:
> We have made some progress. GSSAPI authentication method is taking time
> though we have not enabled the GSSAPI authentication method in postgres
> (but the connection request is spending some time there). We continue
> troubleshooting on why the GSSAPI authentication method is taking longer
> time. For now we have exported the following ENV and local connections are
> faster.
> export PGGSSENCMODE="disable"
Ah, that rings a bell. After a bit of searching I found
https://www.postgresql.org/message-id/flat/16897-2632c6541c9f8491%40postgresql.org
which seems to describe exactly the same symptom. We never got a
final answer from that person, but I continue to think that Postgres
must have been trying to use GSSAPI authentication, suggesting that
the server is being started in an environment where a GSSAPI server
appears to be available.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: PostgreSQL local connection is taking 4 seconds
@ 2024-01-03 17:59 Jeff Janes <jeff.janes@gmail.com>
parent: pramod kg <pramod11287@gmail.com>
1 sibling, 0 replies; 10+ messages in thread
From: Jeff Janes @ 2024-01-03 17:59 UTC (permalink / raw)
To: pramod kg <pramod11287@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Thomas Kellerer <shammat@gmx.net>; pgsql-admin@lists.postgresql.org
On Wed, Jan 3, 2024 at 2:05 AM pramod kg <pramod11287@gmail.com> wrote:
> We have made some progress. GSSAPI authentication method is taking time
> though we have not enabled the GSSAPI authentication method in postgres
> (but the connection request is spending some time there).
>
When a libpq client sees that krb5 credentials exist, it tries to use them
preemptively, without knowing if the server supports them or not. Once
given an error, it then tries again without GSS. The server log file
should show evidence of these failed connections, and the failure reason
given might offer some clues.
But this first try should normally be fast. Is the time taken on the client
side, or on the server side? Using strace on a simple psql invocation
would be the best way to answer this (on Linux). If the server doesn't
support GSS at all, it is hard to see why it should fail slowly on the
server side so that would probably be a bug.
Cheers,
Jeff
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2024-01-03 17:59 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 13:58 PostgreSQL local connection is taking 4 seconds pramod kg <pramod11287@gmail.com>
2024-01-02 14:04 ` Ron Johnson <ronljohnsonjr@gmail.com>
2024-01-02 14:12 ` pramod kg <pramod11287@gmail.com>
2024-01-02 15:49 ` pramod kg <pramod11287@gmail.com>
2024-01-02 15:55 ` Thomas Kellerer <shammat@gmx.net>
2024-01-02 16:04 ` pramod kg <pramod11287@gmail.com>
2024-01-02 16:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 07:05 ` pramod kg <pramod11287@gmail.com>
2024-01-03 15:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-01-03 17:59 ` Jeff Janes <jeff.janes@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox