killing idle postgres instances - Mailing list pgsql-jdbc

From Marcus Andree S. Magalhaes
Subject killing idle postgres instances
Date
Msg-id 28140.200.161.200.85.1076010775.squirrel@webmail.webnow.com.br
Whole thread Raw
Responses Re: killing idle postgres instances  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Hi, everyone,


I've noticed a somewhat annoying problem while using a java
program to do some periodic work on some postgresql tables.

We have a java program scheduled to run a few times in an hour and
the server backend keeps running when the java program exits.

This leads to a leak behaviour: each backend instance eats some
resources (mainly memory, since the connection is idle) and, in
a few hours, our server starts swapping and begins to spiral down.

Is there any way to prevent this behaviour? I guess there's a postgres
option to limit the time that a statement can run, but we rather prefer
another, less traumatic solution like automagically killing idle connections.

Can this be configured on the server side or should we start doing some
hack shell scripts to do it?

Thanks a lot.



pgsql-jdbc by date:

Previous
From: Nadeem Bitar
Date:
Subject: unpredictable behavior
Next
From: Tom Lane
Date:
Subject: Re: killing idle postgres instances