Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPayt-0007HQ-WF for pgsql-general@arkaria.postgresql.org; Sun, 03 Jun 2018 21:56:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fPays-0003Qr-TO for pgsql-general@arkaria.postgresql.org; Sun, 03 Jun 2018 21:56:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPays-0003Qh-GI for pgsql-general@lists.postgresql.org; Sun, 03 Jun 2018 21:56:06 +0000 Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fPayp-0003If-8L for pgsql-general@postgresql.org; Sun, 03 Jun 2018 21:56:04 +0000 Received: by mail-pg0-x235.google.com with SMTP id l65-v6so3188419pgl.8 for ; Sun, 03 Jun 2018 14:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=9Z/gIYg5ptuPaSDkN1KmwJjD/Onbf51AsFo9hSXmD1A=; b=pWpy9m6fjMKI54g39RuR8UtWKjDa9Q9V1QlS85e6V6N4R1JNU5rr9LpGB6zE8teW+v Ab3ifXIuhV6NoSNWv+h6cxb9nlbPHvD0pqVMxvTsiGhAsesc8z196CYilfxze89B06It cSS/DBDS0YONsQmAEDQqzcPsf4fTbVpnbTrXOh9BsVl5B/yg1DEOvkjnADLvjH3imtCX ntS9pVQVEUkS+5FbMUR7+34ROqJvlnl7a1zDrVG+EUaFSS3MfmVt9qXOuDxh+LmQBi8z iTBxlK6oOkj1hHJOrlgC6r4kaN+J6a89jBWzRTL0cMKXLJvYZq0kcgqhIz+9aQxI4VGb R3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=9Z/gIYg5ptuPaSDkN1KmwJjD/Onbf51AsFo9hSXmD1A=; b=BiscMtIL5Nhku2h+uJPxp2UVtcOkbYcsfIfZe/0w9xBlhG3yaGQV8k0hvE8T5a4nSY AYDaXOsC9TdCU+6hZsiqOe/JBbZMbdJE/6xM1SpKRHWjjBTHqciSjSrWTCHqEfENz5ra VBnXbjzSa2OVDxa+Y+Ks191YrG9ZvO0fpdrgQAYwWpktANOe3gbFyAu0NGKNghAyKv+T yRldWclc9gEGp1MaLtv+lc1TlRLoOABnzo1gZYf/pFhLVBWWmrpY6pF18YDiDqpfq8Yx GbnXRJuLpedcvslqwVkIeT6gW1G1Y7a/LsZ81Jjgl417YWlrj027awVu3i00QZF6aDNa jacQ== X-Gm-Message-State: ALKqPwecqaOQQ/E5/NWojuctNRBiN0kTrrrTD0MbgYqe0m3Gafp98sGt iRRxoZ5ix4h++c1pSc3a2WdGfLmc X-Google-Smtp-Source: ADUXVKIA8q+mRjOojB1v0yhjpLfIwIsuK326fnG8x3dq2woMaywKPH6UaBikiL2Qw+fmEb4OslBc9A== X-Received: by 2002:a62:6710:: with SMTP id b16-v6mr18836079pfc.37.1528062961134; Sun, 03 Jun 2018 14:56:01 -0700 (PDT) Received: from tim-desktop (2001-44b8-31f2-bb00-edae-7c0e-1106-8848.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:edae:7c0e:1106:8848]) by smtp.gmail.com with ESMTPSA id x72-v6sm27343325pff.176.2018.06.03.14.55.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jun 2018 14:56:00 -0700 (PDT) References: <20180530160451.GS27724@tamriel.snowman.net> <20180530185018.GT27724@tamriel.snowman.net> <87zi0gvkrd.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 26.1 From: Tim Cross To: Jeff Janes Cc: C GG , Stephen Frost , Postgres General Subject: Re: LDAP authentication slow In-reply-to: Date: Mon, 04 Jun 2018 07:55:45 +1000 Message-ID: <87y3fvilge.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeff Janes writes: > On Thu, May 31, 2018 at 8:23 AM, C GG wrote: > > In the meantime, I did what I promised Adrian Klaver I would do and I added >> the AD servers to the /etc/hosts file. That had an immediate and dramatic >> effect on the performance. That confirms (at least to me) that DNS >> resolution was playing a large part in the slowdown. I'm going to >> experiment with running a local DNS caching server to see if that will give >> the same effect. >> > > I had this problem at one site, and with the same solution. As best as I > could tell, Windows was not using DNS as the main way of resolving > hostnames. (People assure me that NetBIOS and WINS are almost completely > dead, but WireShark tells a different tail--I don't recall the exact name, > but it was certainly something other than DNS). So the fact that AD's > built in DNS sucks was not a problem for Windows users, which means there > was no impetus on the Windows admin to fix it. And the delay on resolution > was always 5 seconds plus a very small handful of milliseconds. So it was > clearly some kind of designed throttling or timeout, there is no way random > congestion could get you so close to 5.00 every time. > We had particular problems with a specific client. In the end, it turned out that this client used a DNS resolve library which, unlike most other libraries, did not use local DNS cache. Every name lookup involved a full DNS resolution process. Temporary solution was to use IP addresses until admins/devs could work out how to fix the client or find a more robust solution where address isn't 'hard coded'. At the time, the admins responsible for managing the DNS were getting frustrated as their service was being blamed for a local client problem. Key take away, this stuff can be complex to diagnose and a systematic evidence based investigation is often required - problem is, that takes time and is seldom welcomed. -- Tim Cross