Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJ12B-0005d6-Tm for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jul 2015 15:06:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJ12B-00036m-E7 for pgsql-performance@arkaria.postgresql.org; Sat, 25 Jul 2015 15:06:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJ10Z-0001BZ-59 for pgsql-performance@postgresql.org; Sat, 25 Jul 2015 15:05:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJ10R-0007qL-TK for pgsql-performance@postgresql.org; Sat, 25 Jul 2015 15:05:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t6PF4pOU008825; Sat, 25 Jul 2015 11:04:51 -0400 From: Tom Lane To: Craig James cc: "pgsql-performance@postgresql.org" Subject: Re: Are many idle connections bad? In-reply-to: References: Comments: In-reply-to Craig James message dated "Sat, 25 Jul 2015 07:50:35 -0700" Date: Sat, 25 Jul 2015 11:04:51 -0400 Message-ID: <8824.1437836691@sss.pgh.pa.us> X-Pg-Spam-Score: -3.1 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Craig James 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