From: Tino Schwarze <postgresql@tisc.de>
To: pgsql-admin@postgresql.org
Subject: Re: SIGKILL and force disconnecting user sessions
Date: Mon, 22 Sep 2008 17:06:34 +0200
Message-ID: <20080922150634.GE10876@easy2.in-chemnitz.de> (raw)
In-Reply-To: <1222091009.3153.84.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com>
References: <1222091009.3153.84.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com>
On Mon, Sep 22, 2008 at 09:43:29AM -0400, Brian A. Seklecki wrote:
BTW: What version of PG are you using?
> 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?
As far, as you do not really use SIGKILL (9), but SIGTERM (15),
everything should be fine.
> 2) There are no pgsql/admin level CLI builtin commands to do this in a
> more graceful manor?
You might want to try pg_cancel_backend(pid) to cancel backends,
but I suppose, the connection will stay alive.
- see http://www.postgresql.org/docs/8.2/static/functions-admin.html
HTH,
Tino.
--
"What we nourish flourishes." - "Was wir nähren erblüht."
www.craniosacralzentrum.de
www.forteego.de
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: postgresql@tisc.de
Subject: Re: SIGKILL and force disconnecting user sessions
In-Reply-To: <20080922150634.GE10876@easy2.in-chemnitz.de>
* 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