Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E8E226344A5 for ; Wed, 6 Jan 2010 15:11:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30614-03-3 for ; Wed, 6 Jan 2010 19:10:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f204.google.com (mail-yw0-f204.google.com [209.85.211.204]) by mail.postgresql.org (Postfix) with ESMTP id F3765634EE6 for ; Wed, 6 Jan 2010 14:31:17 -0400 (AST) Received: by ywh42 with SMTP id 42so14957929ywh.28 for ; Wed, 06 Jan 2010 10:31:15 -0800 (PST) Received: by 10.150.6.28 with SMTP id 28mr13100562ybf.262.1262802675725; Wed, 06 Jan 2010 10:31:15 -0800 (PST) Received: from ?192.168.0.80? (rrcs-64-183-7-130.west.biz.rr.com [64.183.7.130]) by mx.google.com with ESMTPS id 36sm8333006yxh.13.2010.01.06.10.31.14 (version=SSLv3 cipher=RC4-MD5); Wed, 06 Jan 2010 10:31:14 -0800 (PST) Message-ID: <4B44D6F0.3090107@emolecules.com> Date: Wed, 06 Jan 2010 10:31:12 -0800 From: Craig James User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: pg_connect takes 3.0 seconds References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.295 tagged_above=-10 required=5 tests=AWL=-2.894, BAYES_50=0.001, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/62 X-Sequence-Number: 36942 Dave Crooke wrote: > The fact that the delays are clustered at (3 + 0.2 n) seconds, rather > than a distributed range, strongly indicates a timeout and not > (directly) a resource issue. > > 3 seconds is too fast for a timeout on almost any DNS operation, unless > it has been modified, so I'd suspect it's the TCP layer, e.g. perhaps > the SYN packet goes awol and it has to retry. > > I'd second the vote for investigation with a packet sniffing tool > (Wireshark, tcpdump, etc) If you have a PC (Windows), pingplotter is a remarkable and simple tool to use that quickly identifies problems, and gives results that are convincing when you show them to your network admin. Wireshark and tcpdump have a pretty steep learning curve and are overkill if your problem is simple. Craig