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

Re: Are many idle connections bad?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig James <cjames(at)emolecules(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Are many idle connections bad?
Date: 2015-07-25 15:04:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Craig James <cjames(at)emolecules(dot)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

In response to


pgsql-performance by date

Next:From: Craig JamesDate: 2015-07-25 16:06:53
Subject: Re: Are many idle connections bad?
Previous:From: Craig JamesDate: 2015-07-25 14:50:35
Subject: Are many idle connections bad?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group