Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 27A406324C4 for ; Tue, 5 Jan 2010 23:25:33 -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 62180-09 for ; Wed, 6 Jan 2010 03:25:22 +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 70548632433 for ; Tue, 5 Jan 2010 23:25:22 -0400 (AST) Received: by pwi15 with SMTP id 15so11687105pwi.3 for ; Tue, 05 Jan 2010 19:25:20 -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=EAV6t2IBErFSwlgyey4q+ONsJ4P6EAd/aDlc2M6Hucg=; b=rcbPxC8qVyJ1ZngWIcskoRNRwzj6jLsrOzMmJHvspVlvRcu1s7SZUGOm1cpnTOLRwk fe6NgirjoWIouWVVHCAQdBheEYcxZRGZxpB24C9W/rRbWWgGCPqeOZR0piLzteQARwqA /4JZ37WIIHBJcgJD+dGkkGaLRBuRkS0Iv5qUU= 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=aJVXm6BW1jMopHHDgabhb67ThVjPxIrtrjpSvPMc0/iseNKT5uFf2CjBBNkHgvEwjs sARkZkM5iKddZTU3XkgDlbQTYNb95hp6jcXTQpNZgfh3YoALMCk+pB3+sJLPTVT9+/Cn LryCDj9el2cPdFACh5kBiQnJ/ytqKQscYwqsI= MIME-Version: 1.0 Received: by 10.115.144.12 with SMTP id w12mr16286666wan.32.1262748320099; Tue, 05 Jan 2010 19:25:20 -0800 (PST) In-Reply-To: <4B4354B0.8030400@squeakycode.net> References: <4B4354B0.8030400@squeakycode.net> From: Dmitri Girski Date: Wed, 6 Jan 2010 14:25:00 +1100 X-Google-Sender-Auth: 5e84ee2b272544c6 Message-ID: Subject: Re: pg_connect takes 3.0 seconds To: Andy Colson Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0016367b6bb40f6dad047c76816c 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/52 X-Sequence-Number: 36932 --0016367b6bb40f6dad047c76816c Content-Type: text/plain; charset=ISO-8859-1 Hi Andy, I tried 2 connections strings: - server name (DB1), which is listed in all machines hosts files. - ip address. There is no difference in both methods, still I have 5-7 pg_connects which last around 3 seconds. 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 --0016367b6bb40f6dad047c76816c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andy,

I tried = =A02 connections strings:
- server= name (DB1), =A0which is listed in all machines hosts files.
- ip address.

There is no difference in both methods, still I have 5-7 pg_connects= which last around 3 seconds.

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
--0016367b6bb40f6dad047c76816c--