On Mon, 25 Oct 2004, Rajesh Kumar Mallah wrote:
> We run our webserver using mod_perl and perl/DBI/DBD-Pg .
> I have observed that most of the pg backends that block other queries
> are in '<IDLE> in transaction' state. Usually sending a -INT or -TERM
> to such blocking backends solve the problem.
> My question is
> 1. Are there some precuation to be taken in perl/DBI programming
> in mod_perl environment to avoid backends getting into '<IDLE> in
Yes.Be very carefull with transaction - that is:
 try the backends that are entering transactions to make the updates in
the same order ,so you will not get a deadlock.(read the manual for more
 try to make the transactions as short as you can,if you don't need
transactions - don't use it ,turn the Autocommit on!
 befor your updates /deletes it sometimes VERY usefull to do a select
for update which will lock the rows befor entering the transactions ,that
will avoid two backends updating same rows to enter transaction and ,so
> 2. Is it advisable/safe to run a daemon that TERMs such blocking backend
> at regular interval.
I don't think so - that will not let postgres end the transactions and
so no changes will be applied,more then that - this may kill the all the
postgres processes .
> 3. Most Importantly , If a do not have access to to the host is it
> possible to
> TERMinate such backeds from psql>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
In response to
pgsql-admin by date
|Next:||From: Nikhil Parva||Date: 2004-10-25 08:01:32|
|Previous:||From: amol chandekar||Date: 2004-10-25 07:40:02|