From: Donald Fraser <demolish@cwgsy.net>
To: pgsql-admin@postgresql.org
Subject: Lost connections
Date: Thu, 30 Jan 2003 19:10:47 -0000
Message-ID: <005301c2c893$4ebd1f00$1664a8c0@DEMOLITION> (raw)
Version: PostgreSQL 7.3.1 on i686-pc-linux-gnu, compiled by GCC
I was testing what would happen to a connection on the server when a client disconnects from the database via a lost network / internet connection.
To test this scenario out I connected with a Java application and then simply unplugged my network cable. I then shut down my application before reconnecting the network cable.
I then viewed the postgres processes running on the database server, which revealed the following:
postgres 12304 0.0 1.0 7416 1300 ? S Jan20 0:00 /usr/bin/postmaster -p 5432
postgres 12307 0.0 0.0 8280 52 ? S Jan20 0:00 postgres: stats buffer process
postgres 12309 0.0 0.1 7332 232 ? S Jan20 0:00 postgres: stats collector process
postgres 822 0.0 2.5 8100 3292 ? S 18:31 0:00 postgres: test_user test_data 192.168.100.22 idle
As you can see there still existed the connection to the database that I had established from the Java app (from my computer 192.168.100.22).
My questions are:
1) How as an administrator can I tell which connections are lost and which are not so I can shut down the appropriate processes?
2) Is there a way of connecting to the server with client applications that can avoid this situation. That is can the client software do something extra when connecting such as additional parameters, keep alive socket options... to avoid this scenario?
Thanks in advance
Donald Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: demolish@cwgsy.net
Subject: Re: Lost connections
In-Reply-To: <005301c2c893$4ebd1f00$1664a8c0@DEMOLITION>
References: <005301c2c893$4ebd1f00$1664a8c0@DEMOLITION>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox