Re: pg_connect takes 3.0 seconds

From: Dave Crooke <dcrooke(at)gmail(dot)com>
To: Dmitri Girski <mitek17(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: pg_connect takes 3.0 seconds
Date: 2010-01-06 17:04:03
Message-ID: ca24673e1001060904wab83fe0ne7277daf02b1080@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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)

Cheers
Dave

On Mon, Jan 4, 2010 at 8:12 PM, Dmitri Girski <mitek17(at)gmail(dot)com> 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.
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Craig James 2010-01-06 18:31:12 Re: pg_connect takes 3.0 seconds
Previous Message Robert Haas 2010-01-06 16:18:38 Re: pg_connect takes 3.0 seconds