pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert John Shepherd <robert@reviewer.co.uk>
Cc: pgsql-odbc@postgresql.org
Subject: Re: FATAL 1: Sorry, too many clients already
Date: Mon, 18 Nov 2002 11:49:25 -0500
Message-ID: <29938.1037638165@sss.pgh.pa.us> (raw)
In-Reply-To: <005101c28f1b$fdec83a0$f3b0313e@LAIKA>
References: <005101c28f1b$fdec83a0$f3b0313e@LAIKA>

"Robert John Shepherd" <robert@reviewer.co.uk> writes:
> Nothing really. But I have noticed some very odd behaviour, the website
> seems very happy for long periods, with no more than 8-10 postgresql
> processes running. Then for no apparent reason, the number of processes
> increases dramatically to the maximum and they seem to all be either
> idle or sleeping, none are consuming any cpu at all.

Two plausible theories:

1. Something wacko in client-side connection pooling logic, causing
new connections to be opened when not really necessary.

2. Client transactions are all waiting on a lock held by some
transaction that's not doing anything but not releasing the lock either.

It's rather difficult to debug case #2 in current releases, because
there's no easy way to look at the locking status.  (In 7.3 there's
a new pg_locks system view that allows you to determine exactly who's
waiting for whom and why.  Dunno if you'd like to try your site on
7.3rc1, but the option is there.)  One thing you can look at is "ps"
status: if there is one guy who's "idle in transaction" and the others
are all "SELECT waiting" (or any-operation waiting), then it's a good
bet that the first one has got the lock the others are waiting for.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <29938.1037638165@sss.pgh.pa.us>
Permalink:  ../29938.1037638165@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29938.1037638165@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robert@reviewer.co.uk
  Subject: Re: FATAL 1: Sorry, too many clients already
  In-Reply-To: <29938.1037638165@sss.pgh.pa.us>
  References: <005101c28f1b$fdec83a0$f3b0313e@LAIKA> <29938.1037638165@sss.pgh.pa.us>

* 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