pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Login with LDAP authentication takes 5 seconds
Date: Thu, 31 May 2018 17:54:50 +0300
Message-ID: <cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAKeZVDov+j2ZfUuSXNN-98_Nn_kAXr2e7UmKHhFNODHuEnUwUg@mail.gmail.com>
References: <CAKeZVDov+j2ZfUuSXNN-98_Nn_kAXr2e7UmKHhFNODHuEnUwUg@mail.gmail.com>

On 28/05/2018 17:26, Andreas Schmid wrote:
> Hi,
>
> I configured my PostgreSQL 10 DB on Debian 9.2 with LDAP authentication (simple bind mode). While this basically works, it has the strange effect that the first login with psql takes around 5 
> seconds. When I reconnect within 60 seconds, the login completes immediately.
>
> The LDAP server is behind a firewall. So for a test, in pg_hba.conf I put the LDAP servers IP address instead of its DNS name (for parameter ldapserver). Like that, all logins complete immediately. 
> But in general I prefer specifying the DNS name rather than the IP.
>
> When I checked on the DB machine with the following commands
> host my.ldap.server.org <http://my.ldap.server.org;
> dig my.ldap.server.org <http://my.ldap.server.org;
> both always returned the host name and IP address of the LDAP server immediately.
>
> Does anyone of you have an explanation for this, or a hint, where I could do some further investigation?
IPv4 vs IPv6 ? any strange timeouts? look in the postgresql logs for any messages.
Also definitely ran wireshark, it'll tell you a lot on what's happening between postgresql and your LDAP .
>
> Thanks,
> Andy
>

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (5+ messages)  latest in thread

Message-ID: <cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com>
Permalink:  ../cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: Login with LDAP authentication takes 5 seconds
  In-Reply-To: <cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com>
  References: <CAKeZVDov+j2ZfUuSXNN-98_Nn_kAXr2e7UmKHhFNODHuEnUwUg@mail.gmail.com> <cd435c2d-ffa1-471b-8803-bd2bfbc29ee8@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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