Search Postgresql Archives

Re: DNS vs /etc/hosts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry to re-reply, but I had a much simpler idea.  From the client machine
that is slow to connect, type the command "nslookup hostname1".  If it
takes 15 seconds.  If it does, DNS is the problem.

Rick

pgsql-general-owner@xxxxxxxxxxxxxx wrote on 08/04/2005 03:01:31 PM:

> I'd start by comparing the /etc/nsswitch.conf files on the various
> machines.  If the second column contains "files" for passwd and hosts on
> the fast machines, and "dns" on the slow machine, then change the slow
> machine to "files" and see if it speeds up.  That's an easy way to rule
out
> or condemn DNS.
>
> If you change a machine to "files", make sure the /etc/passwd has at
least
> the user you intend to login as, and /etc/hosts has the hostnames.
>
> Rick
>
>
>

>              Michael Fuhr

>              <mike@xxxxxxxx>

>              Sent by:
To
>              pgsql-general-own         Lowell.Hought@xxxxxxx

>              er@xxxxxxxxxxxxxx
cc
>                                        Tino Wildenhain

>                                        <tino@xxxxxxxxxxxxx>,

>              08/04/2005 02:29          pgsql-general@xxxxxxxxxxxxxx

>              PM
Subject
>                                        Re:  DNS vs /etc/hosts

>

>

>

>

>

>

>
>
>
>
> On Thu, Aug 04, 2005 at 12:04:27PM -0500, Lowell.Hought@xxxxxxx 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
>        message can get through to the mailing list cleanly
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux