Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3187E6324C4 for ; Tue, 5 Jan 2010 23:30:01 -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 62912-02 for ; Wed, 6 Jan 2010 03:29:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mail.postgresql.org (Postfix) with ESMTP id 56EF1632433 for ; Tue, 5 Jan 2010 23:29:50 -0400 (AST) Received: by pwi15 with SMTP id 15so11690046pwi.3 for ; Tue, 05 Jan 2010 19:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=WclkT0vAK7IKA1/6qn1A8ekcrl8vuaPr1ewIpEUoFKk=; b=DZLruaTGiSdqM1t/7hchJp8L0UR/qDIYhlz6Cxfh8XcRqwhe/pS3cc/E0aPZWnN0Vg c6LJd0VqFEE11srL9sOoxQWdha1FWjSnC8TQ6akiCIOY+aCFRB9Pez59lV0cKmbLEZW2 H67QsAj/V3pRrJcbmtCB9SAYgLRnMqGMoLRqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=vkSA/NAHu5toyg87yhJLve9g6bBzoNDAOZRIg95h5Q9S3oBNGwKpPS7xJZipbo08ag crgUXc8kmKTKsJKvfg3j1YdVGmoxZxU5bhoygqFvbeKGQbL8wdstNIxpZ99HZ0UEcYnO Exwlj+8UofOdyJdpnm076+IaSYpAhSHWo9VRg= MIME-Version: 1.0 Received: by 10.115.114.9 with SMTP id r9mr15599691wam.19.1262748588174; Tue, 05 Jan 2010 19:29:48 -0800 (PST) In-Reply-To: <4B4354B0.8030400@squeakycode.net> References: <4B4354B0.8030400@squeakycode.net> From: Dmitri Girski Date: Wed, 6 Jan 2010 14:29:28 +1100 X-Google-Sender-Auth: 965cca4de90de79b Message-ID: Subject: Re: pg_connect takes 3.0 seconds To: Andy Colson Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0016e64b99f409ef12047c769173 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.59 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/54 X-Sequence-Number: 36934 --0016e64b99f409ef12047c769173 Content-Type: text/plain; charset=ISO-8859-1 Thank you for reply , Andy! I tried both cases: server name which is listed in hosts file and ip address ( 192.168.2.2) - no difference so far. Cheers, Dmitri. On Wed, Jan 6, 2010 at 2:03 AM, Andy Colson wrote: > On 1/4/2010 8:12 PM, Dmitri Girski wrote: > >> Hi everybody, >> >> 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. >> >> I turned on logs on postgres server side, and there is >> nothing suspicious for me there. When a connection request comes, it is >> being served without any delay. >> >> Could anyone point me to the direction in which I should investigate >> this problem further? >> Thank you in advance! >> >> >> PS The hardware is: Dell SC1435/4Gb/2x2.0GHz/Gentoo Linux. >> The database & web servers are in the 2 local subnets. >> >> >> Dmitri. >> >> > How do you have the connect string? With an IP or a name? Maybe its a DNS > lookup timeout? You could switch to IP or drop the name in the hosts file > and see if that makes a difference. > > -Andy > -- @Gmail --0016e64b99f409ef12047c769173 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you for reply , Andy!

I tried both cases: server name which is listed in hosts file = and ip address ( 192.168.2.2) - no difference so far.

Cheers,
Dmitri.

On Wed, Jan 6, 2010 at 2:= 03 AM, Andy Colson <andy@squeakycode.net> wrote:
On 1/4/20= 10 8:12 PM, Dmitri Girski wrote:
Hi everybody,

I am running a PostgreSQL server 8.3.5 with a pretty much standard config.<= br>
The web application server which runs Apache 1.3/PHP2.9 =A0has an
intermittent problem:
pg_connect takes exactly 3.0 seconds. The usual connection time is 0.0045.<= br> The long request happens at approximate rate 1:100.

I turned on logs on postgres server side, and there is
nothing suspicious for me there. When a connection request comes, it is
being served without any delay.

Could anyone point me to the direction in which I should investigate
this problem further?
Thank you in advance!


PS The hardware is: Dell SC1435/4Gb/2x2.0GHz/Gentoo Linux.
The database & web servers are in the 2 local subnets.


Dmitri.


How do you have the connect string? =A0With an IP or a name? =A0Maybe its a= DNS lookup timeout? =A0You could switch to IP or drop the name in the host= s file and see if that makes a difference.

-Andy



--
@Gmail
--0016e64b99f409ef12047c769173--