Re: DNS vs /etc/hosts

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Lowell(dot)Hought(at)faa(dot)gov
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: DNS vs /etc/hosts
Date: 2005-08-04 19:29:56
Message-ID: 20050804192955.GA89372@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 04, 2005 at 12:04:27PM -0500, Lowell(dot)Hought(at)faa(dot)gov wrote:
> Version 7.2 psql - /usr/bin/psql -d dbname -h machine1 ----
> connection time instant
> Version 8.0 psql - /usr/local/pgsql/bin/psql -d dbname -h machine1 ----
> conection time 15 seconds
> Version 8.0 psql - /usr/local/pgsql/bin/psql -d dbname -h ip.address ----
> connection time instant

Do the 8.0 connections to a name take exactly 15 seconds every time,
or does the time vary?

Have you done process traces on 7.2 vs. 8.0 to see what they're
doing differently? You mentioned that you were using Linux, so
something like "strace -o filename -r psql ..." should work (the
-r option should add relative timestamps to the trace so you can
see where the slowness is happening). As others have mentioned,
name resolution is generally done by libraries that aren't part of
PostgreSQL, so if two versions of PostgreSQL behave differently in
that respect then we need to find out what's different about them.
Have you used ldd to see what libraries each version of psql is
linked against? Are there differences aside from libpq?

Have you used a tool like dig, host, or nslookup to test whether
DNS indeed has a problem? That wouldn't answer why different
versions of psql apparently behave differently, but it should at
least tell us whether DNS is really a problem.

Have you used a sniffer like tcpdump or ethereal to watch DNS queries
and PostgreSQL connections?

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard_D_Levine 2005-08-04 20:01:31 Re: DNS vs /etc/hosts
Previous Message Sean Davis 2005-08-04 19:15:42 Re: psqsl -> remote db