Establishing remote connections is slow

From: Mindaugas Žakšauskas <mindas(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Establishing remote connections is slow
Date: 2012-01-17 12:44:26
Message-ID: CAKTEH83nqC5NBZjWJ2ZAW8eBMWjW3N6G3RhbsWy68rMgf=MF1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

I have a very weird problem related to establishing remote connections
to PostgreSQL server and hopefully someone can give me some hints how
can I debug this.

The essence is that establishing remote connection takes anywhere from
10 to 30 seconds. Once connected, the queries are fast - it's just
establishing new connection that takes ages. This problem is not
applicable to establishing local connections: running psql command
from the local machine takes no time to connect, same applies if a
client connects to the PostgreSQL via ssh tunnel.

Immediately after restarting PostgreSQL daemon, the problem
temporarily goes away but later resurfaces again.

Things we have tried:
- doing all sorts of DNS queries against the connecting client IP --
seems to be fine, DNS resolution takes no time;

- enabling debug for HA
(http://docs.oracle.com/cd/E19680-01/html/821-1534/fumuy.html#scrolltoc)
-- debugging showed no problems. We were probing for the problem
described in by
http://blogs.oracle.com/js/entry/the_nscd_does_not_cache

- asking PostgreSQL to listen not only on multipath IP (used for
failover), but also on an ethernet interface. This is the most
interesting. When remote connection via multipath IP is slow to
establish, establishing remote connections via ethernet interface is
still snappy.

At this point it is reasonable to think that the problem lies
somewhere in the networking (multipath IP), and that well might be
true. But we tried running simple netcat server-client and it was all
instant via both interfaces (multipath and eth).

Can anyone suggest any ideas how to debug this further? Many thanks in advance.

Environment:
- Solaris 5.10 / Intel
- Sun cluster
- HA for PostgreSQL
(http://docs.oracle.com/cd/E19680-01/html/821-1534/cacjgdbc.html#scrolltoc)
- PostgreSQL server version: 9.0.4

Regards,
Mindaugas

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2012-01-17 15:09:42 Re: Establishing remote connections is slow
Previous Message Fujii Masao 2012-01-17 03:44:09 Re: PG synchronous replication and unresponsive slave