Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 867E9633205 for ; Tue, 5 Jan 2010 01:14:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 56987-03 for ; Tue, 5 Jan 2010 05:14:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id EA7BC6325AB for ; Tue, 5 Jan 2010 01:14:10 -0400 (AST) 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 o055E94Y028250; Tue, 5 Jan 2010 00:14:09 -0500 (EST) To: Dmitri Girski cc: pgsql-performance@postgresql.org Subject: Re: pg_connect takes 3.0 seconds In-reply-to: References: Comments: In-reply-to Dmitri Girski message dated "Tue, 05 Jan 2010 13:12:53 +1100" Date: Tue, 05 Jan 2010 00:14:09 -0500 Message-ID: <28249.1262668449@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.589 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/39 X-Sequence-Number: 36919 Dmitri Girski writes: > I am running a PostgreSQL server 8.3.5 with a pretty much standard config. > The web application server which runs Apache 1.3/PHP2.9 has an intermittent > problem: > pg_connect takes exactly 3.0 seconds. The usual connection time is 0.0045. > The long request happens at approximate rate 1:100. Sounds a lot like a dropped-packets problem. The exact timing would be explained if that is the retransmit timeout in your client-side TCP stack. If that's what it is, you need some network engineers, not us database geeks ... regards, tom lane