Re: Very long time to commit or close connections

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Smith" <cdsmith(at)twu(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Very long time to commit or close connections
Date: 2004-01-19 06:28:01
Message-ID: 21359.1074493681@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Chris Smith" <cdsmith(at)twu(dot)net> writes:
> We've got about a connection every 4 seconds being created to the database.
> Most of the time, this causes no problems at all. Occasionally, though, with
> no apparent reason, the database will act up for some time (as little as 10
> minutes, or as long as 45 minutes). During that time, it accepts connections
> and runs queries and statements with no problems, but hangs when closing the
> connections. After the time period expires, the database will wake up and all
> connections that have been waiting will simultaneously return from the JDBC
> Connection.close() method.

There are not that many things happening during connection close. Does
your app use temp tables? LISTEN/NOTIFY?

> So right now, my question is this: does this sound familiar to anyone, and
> what information would you look for in troubleshooting this?

Nope ... how about looking at the contents of the pg_locks system view
when this happens? What external conditions correspond to the instant
when the hangs are released? (I do not believe that it just happens by
magic --- look for background cron jobs starting or finishing at that
time, eg a cron job that issues VACUUMs.)

What PG version is this, anyway?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dieter Fischer 2004-01-19 08:48:38 Re: Pass data of database Oracle to PostgreSQL
Previous Message Pavel Stehule 2004-01-19 05:58:55 Re: Tool to ease development of plpgsql