Skip site navigation (1) Skip section navigation (2)

SIGKILL and force disconnecting user sessions

From: "Brian A(dot) Seklecki" <lavalamp(at)spiritual-machines(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: SIGKILL and force disconnecting user sessions
Date: 2008-09-22 13:43:29
Message-ID: 1222091009.3153.84.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com (view raw or flat)
Thread:
Lists: pgsql-admin
This one really isn't in the docs, so we'll add it to the Wiki
afterwords, but:

We've got some shared PG instances with more than one production
application (yes, I know this is a bad practice, but virtualization
options are hit and miss).

We need to kill apache P-conn pools from a an application/web server
cluster for a specific database.  We use a load-balancer, so we shut
down the HA L4 Service VIP that the web servers pconnect() to, to
prevent new incoming connections.

The problem is then net.inet.tcp.* timeouts.  We need to cane existing
connections with a quickness, and pg_stat_activity is a read-only view.

We need to kill the stale pcons, so just:
 $ pkill -a [database string]

 The connection goes away as "Disconnected per admin command"

 I just want to confirm:

 1) There are no data consistency threats to SIGKIL a child thread
    process?  Transactions and locks will be handled gracefully?

 2) There are no pgsql/admin level CLI builtin commands to do this in a
    more graceful manor?




Responses

pgsql-admin by date

Next:From: Vladimir RusinovDate: 2008-09-22 14:09:13
Subject: Error while trying to back up database: out of memroy
Previous:From: Jan-Peter SeifertDate: 2008-09-22 13:42:58
Subject: Windows terminal session setup / initdb failure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group