Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 1814A1DA4C1E for ; Tue, 17 Jan 2012 11:41:28 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RnBA6-0001te-53 for pgsql-admin@postgresql.org; Tue, 17 Jan 2012 15:41:27 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q0HFfCGL016645; Tue, 17 Jan 2012 10:41:12 -0500 (EST) To: =?UTF-8?Q?Mindaugas_=C5=BDak=C5=A1auskas?= cc: pgsql-admin@postgresql.org Subject: Re: Establishing remote connections is slow In-reply-to: References: <15697.1326812982@sss.pgh.pa.us> Comments: In-reply-to =?UTF-8?Q?Mindaugas_=C5=BDak=C5=A1auskas?= message dated "Tue, 17 Jan 2012 15:31:23 +0000" Date: Tue, 17 Jan 2012 10:41:12 -0500 Message-ID: <16644.1326814872@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/63 X-Sequence-Number: 38975 =?UTF-8?Q?Mindaugas_=C5=BDak=C5=A1auskas?= writes: >> What about "psql -h localhost", ie physically local connection but >> via TCP not unix socket? > user@dbserver> psql -h 127.0.0.1 -p5432 -U user -W db > This works fast. But > user@dbserver> psql -h -p5432 -U user -W db > (where is the multipath interface) > This is slow! So it is definitely something network-related or > something how PostgreSQL deals with multipath interface. Hm. AFAIR postgres doesn't know anything particular about multipath interfaces --- it just listens where you tell it to. So I'm thinking this is a system-level issue. It still seems like it could be DNS lookup related though. Do you have log_hostname turned on, and if so does turning it off make a difference? regards, tom lane