Re: LDAP with TLS is taking more time in Postgresql 11.5

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Mani Sankar <manisankar01695(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: LDAP with TLS is taking more time in Postgresql 11.5
Date: 2020-02-26 01:14:47
Message-ID: CA+hUKG+L31qbQXYCkXfvf-Mz0r+1HEt9JvOzT-QK_CJogNGarQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Wed, Feb 26, 2020 at 7:37 AM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
> On 2/25/20 10:23 AM, Mani Sankar wrote:
> > Hi Adrian,
> >
> > Both the machines are in same network and both are pointing towards the
> > same LDAP server
>
> I don't see any errors in the Postgres logs.
>
> You probably should take a look at the LDAP server logs to see if there
> is anything there.
>
> You could also turn up the logging detail in Postgres to see if it
> reveals anything.

A couple more ideas:

If you take PostgreSQL out of the picture and run the equivalent LDAP
queries with the ldapsearch command line tool, do you see the same
difference in response time? If so, I'd trace that with strace etc
with timings to see where the time is spent -- for example, is it
simply waiting for a response from the LDAP (AD?) server? If not,
I'd try tracing the PostgreSQL process and looking at the system calls
(strace -tt -T for high res times and elapsed times), perhaps using
PostgreSQL's pre_auth_delay setting to get time to attach strace.

A wild stab in the dark: if it's slow from one computer and not from
another, perhaps the problem has something to do with a variation in
reverse DNS lookup speed on the LDAP server side when it's verifying
the certificate. Or something like that.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Gillum 2020-02-26 04:53:58 information_schema performance in Postgres 12
Previous Message Ian Barwick 2020-02-26 00:38:27 Re: Highly academic: local etcd & Patroni Cluster for testing on a single host

Browse pgsql-performance by date

  From Date Subject
Next Message Guillaume Cottenceau 2020-02-26 16:17:21 much slower query in production
Previous Message Dipanjan Ganguly 2020-02-25 19:53:57 Re: Connections dropping while using Postgres backend DB with Ejabberd