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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Clearing out old idle connections


  • From: Gavin Hamill <gdh(at)laterooms(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Clearing out old idle connections
  • Date: Wed, 24 May 2006 09:02:35 +0100
  • Message-id: <4474131B(dot)3020809(at)laterooms(dot)com>

Hullo :)


We have pg 8.1.3 and for whatever reason (network blips, poor pooling on behalf of the client, etc.) we sometimes see a large number (dozens) of old connections in the idle state which never get reused.

Is there a function in postgres similar to MySQL's 'wait_timeout' which automatically closes any connections which have been idle for N seconds? Is this functionality possible to to script/cron by examining the pg catalogs and finding a 'last used' timestamp?

I am aware the correct response is 'deal with the cause, not the symptoms', however I assure you that this academic approach wins no friends in the enterprise market that postgres pitches itself at :)

Cheers,
Gavin.




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group