Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 36B851DA4C1F for ; Tue, 17 Jan 2012 13:37:03 -0400 (AST) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RnCxu-0007zz-GY for pgsql-admin@postgresql.org; Tue, 17 Jan 2012 17:37:03 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 17 Jan 2012 11:36:45 -0600 Message-Id: <4F155D480200002500044884@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 17 Jan 2012 11:36:40 -0600 From: "Kevin Grittner" To: "Tom Lane" Cc: , Subject: Re: Establishing remote connections is slow References: <4F15517F0200002500044874@gw.wicourts.gov><4F15517F0200002500044874@gw.wicourts.gov> <20244.1326820717@sss.pgh.pa.us> In-Reply-To: <20244.1326820717@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201201/68 X-Sequence-Number: 38980 Tom Lane wrote: > =22Kevin Grittner=22 writes: >> Mindaugas *ak*auskas wrote: >>> The essence is that establishing remote connection takes >>> anywhere from 10 to 30 seconds. Once connected, the queries are >>> fast > =20 >> The only time I=27ve seen something similar, there was no reverse >> DNS entry to go from IP address to host name. Adding that >> corrected the issue. I would try that. > =20 >> If that fixes it, the questions would be whether PostgreSQL is >> doing an unnecessary reverse DNS lookup. >=20 > Having log_hostname off is supposed to prevent us from attempting > a reverse DNS lookup ... but it would be worth checking into > whether one is happening anyway. (I would think though that such > activity would be visible in strace/truss output. Perhaps you > should turn log_hostname *on* and verify that you see the lookup > activity in strace that wasn=27t there before.) =20 Actually, where I=27ve seen this sort of problem, it was the client code which was doing the unnecessary reverse DNS lookup. What controls this in psql? =20 -Kevin