Thread: Disconnected Backends

Disconnected Backends

From
"Glen and Rosanne Eustace"
Date:
I have recently allowed one of my clients to use ipsql as a means to manage
one of his databases on my server.  The server is currently running 6.5.1
and will be upgraded to 7.0 on 1/1 so if this is version specific the
problem may go away.

It would seem that the postmaster either doesn't shut down a remote
connection properly or is not able to detect when the remote client has gone
away.  I get lots of postmasters for what I know to be old connections still
hanging about.  This is a bit of a worry as they consume resources and keep
databases open that could easily be closed.

Any comments would be appreciated.
--
Glen and Rosanne Eustace,
GodZone Internet Services, a division of AGRE Enterprises Ltd.,
P.O. Box 8020, Palmerston North, New Zealand
Ph: +64 6 357 8168, Mobile: +64 21 424 015


Re: Disconnected Backends

From
Tom Lane
Date:
"Glen and Rosanne Eustace" <agree@godzone.net.nz> writes:
> I have recently allowed one of my clients to use ipsql as a means to manage
> one of his databases on my server.  The server is currently running 6.5.1
> and will be upgraded to 7.0 on 1/1 so if this is version specific the
> problem may go away.

"ipsql"?  Did you mean psql?  If not, I'm clueless what client software
you are talking about.

> It would seem that the postmaster either doesn't shut down a remote
> connection properly or is not able to detect when the remote client has gone
> away.  I get lots of postmasters for what I know to be old connections still
> hanging about.

Hm.  The backend should shut down when it's informed by the kernel that
the client connection socket has been closed.  We have heard about
problems of this sort before, but AFAIR all the identifiable cases
have turned out to trace to client misbehavior, namely failure to close
a connection that the client isn't using anymore.  What does "netstat"
show about the state of the connections?  What is your client code
exactly?

            regards, tom lane

Re: Disconnected Backends

From
"Glen and Rosanne Eustace"
Date:
Hi Tom,

> "ipsql"?  Did you mean psql?  If not, I'm clueless what client software
> you are talking about.

No, ipsql is a Win32 application that is available from
http://www.zeos.dn.ua, it works really well other than this apparent
disconnect problem. I have also had the same problem using the Win32 ODBC
client and MS-Access.

> What does "netstat" show about the state of the connections?  What is
> your client code exactly?

netstat still things the connections are ESTABLISHED, which is obviously why
the postmasters are still there. Re: the client, there is a newer version
which I will get.  I haven't dug around in the code but is there any form of
inactivity timeout in the postmaster for remote connections ? It might be a
good solution if there was.

Glen.