Re: [PERFORM] Many connections lingering

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Slavisa Garic <sgaric(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org, Greg Stark <gsstark(at)mit(dot)edu>
Subject: Re: [PERFORM] Many connections lingering
Date: 2005-04-13 12:31:13
Message-ID: EC5523D9-AC17-11D9-AE38-000A95B03262@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-performance


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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Orme 2005-04-13 14:05:10 Update from a subquery using where to match entries between tables
Previous Message David Orme 2005-04-13 12:25:58 Re: SUMMARY - select top N entries from several groups

Browse pgsql-performance by date

  From Date Subject
Next Message Joel Fradkin 2005-04-13 14:41:08 speed of querry?
Previous Message Dave Page 2005-04-13 08:02:56 Re: performance hit for replication