Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EE6AA632F30 for ; Tue, 5 Jan 2010 18:33:19 -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 92427-05 for ; Tue, 5 Jan 2010 22:33:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-1.exch018.msoutlookonline.net (exhub018-1.exch018.msoutlookonline.net [64.78.17.16]) by mail.postgresql.org (Postfix) with ESMTP id CEE77633404 for ; Tue, 5 Jan 2010 18:32:56 -0400 (AST) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-1.exch018.msoutlookonline.net ([64.78.17.16]) with mapi; Tue, 5 Jan 2010 14:32:54 -0800 From: Scott Carey To: Dmitri Girski , "pgsql-performance@postgresql.org" Date: Tue, 5 Jan 2010 14:32:12 -0800 Subject: Re: pg_connect takes 3.0 seconds Thread-Topic: [PERFORM] pg_connect takes 3.0 seconds Thread-Index: AcqNrLJATCjOPbXERRGU/CUCOXfaBwAqjpEl Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.999 tagged_above=-10 required=5 tests=AWL=-1.588, BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/48 X-Sequence-Number: 36928 Delays that are almost exactly 3 seconds over a network are almost always some sort of network configuration issue. Inside a datacenter, mis-configured load balancers or routers can cause low level network issues that result in intermittent network delays of exactly = 3 seconds (a loop in a routing network?). DNS timeouts are often 3 seconds. Not sure if any of the above is it, but this sounds like a network configuration problem to me. On 1/4/10 6:12 PM, "Dmitri Girski" wrote: > Hi everybody, >=20 > I am running a PostgreSQL server 8.3.5 with a pretty much standard config= . >=20 > The web application server which runs Apache 1.3/PHP2.9 =A0has an intermi= ttent > problem: > pg_connect takes exactly 3.0 seconds. The usual connection time is 0.0045= . > The long request happens at approximate rate 1:100. >=20 > I turned on logs on postgres server side, and there is nothing=A0suspicio= us=A0for > me there. When a connection request comes, it is being served without any > delay.=A0 >=20 > Could anyone point me to the direction in which I should investigate this > problem further? > Thank you in advance! >=20 >=20 > PS The hardware is: Dell=A0SC1435/4Gb/2x2.0GHz/Gentoo Linux. > The database & web servers are in the 2 local subnets.=A0 >=20 >=20 > Dmitri. >=20 >=20