pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig James <cjames@emolecules.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Are many idle connections bad?
Date: Sat, 25 Jul 2015 11:04:51 -0400
Message-ID: <8824.1437836691@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFwQ8rcnqy4F4zDg+UX0A5dLbJ=4ifCDk7WN21y7w5HLtYxo7w@mail.gmail.com>
References: <CAFwQ8rcnqy4F4zDg+UX0A5dLbJ=4ifCDk7WN21y7w5HLtYxo7w@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Craig James <cjames@emolecules.com> writes:
> ... This would result in a thousand
> or so Postgres connections on a machine with 32 CPUs.

> So the question is: do idle connections impact performance?

Yes.  Those connections have to be examined when gathering snapshot
information, since you don't know that they're idle until you look.
So the cost of taking a snapshot is proportional to the total number
of connections, even when most are idle.  This sort of situation
is known to aggravate contention for the ProcArrayLock, which is a
performance bottleneck if you've got lots of CPUs.

You'd be a lot better off with a pooler.

(There has been, and continues to be, interest in getting rid of this
bottleneck ... but it's a problem in all existing Postgres versions.)

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (5+ messages)  latest in thread

Message-ID: <8824.1437836691@sss.pgh.pa.us>
Permalink:  ../8824.1437836691@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8824.1437836691@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cjames@emolecules.com
  Subject: Re: Are many idle connections bad?
  In-Reply-To: <8824.1437836691@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