Re: [PERFORM] Many connections lingering - Mailing list pgsql-novice

From John DeSoi
Subject Re: [PERFORM] Many connections lingering
Date
Msg-id EC5523D9-AC17-11D9-AE38-000A95B03262@pgedit.com
Whole thread Raw
In response to Re: [PERFORM] Many connections lingering  (Slavisa Garic <sgaric@gmail.com>)
List pgsql-novice
On Apr 13, 2005, at 1:09 AM, Slavisa Garic wrote:

> This is not a Windows server. Both server and client are the same
> machine (done for testing purposes) and it is a Fedora RC2 machine.
> This also happens on debian server and client in which case they were
> two separate machines.
>
> There are thousands (2+) of these waiting around and each one of them
> dissapears after 50ish seconds. I tried psql command line and
> monitored that connection in netstats. After I did a graceful exit
> (\quit) the connection changed to TIME_WAIT and it was sitting there
> for around 50 seconds. I thought I could do what you suggested with
> having one connection and making each query a full BEGIN/QUERY/COMMIT
> transaction but I thought I could avoid that :).


If you do a bit of searching on TIME_WAIT you'll find this is a common
TCP/IP related problem, but the behavior is within the specs of the
protocol.  I don't know how to do it on Linux, but you should be able
to change TIME_WAIT to a shorter value. For the archives, here is a
pointer on changing TIME_WAIT on Windows:

http://www.winguides.com/registry/display.php/878/


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-novice by date:

Previous
From: David Orme
Date:
Subject: Re: SUMMARY - select top N entries from several groups
Next
From: David Orme
Date:
Subject: Update from a subquery using where to match entries between tables