Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 712EC2E007A for ; Tue, 22 Apr 2008 13:25:48 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 83165-07 for ; Tue, 22 Apr 2008 13:25:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 2DBFE2E0072 for ; Tue, 22 Apr 2008 13:25:41 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3MGPatE022617; Tue, 22 Apr 2008 12:25:36 -0400 (EDT) To: Bryan Buecking cc: Erik Jones , pgsql-performance@postgresql.org Subject: Re: CPU bound at 99% In-reply-to: <20080422161020.GE5961@starling-software.com> References: <20080422153045.GB5961@starling-software.com> <20080422161020.GE5961@starling-software.com> Comments: In-reply-to Bryan Buecking message dated "Wed, 23 Apr 2008 01:10:26 +0900" Date: Tue, 22 Apr 2008 12:25:36 -0400 Message-ID: <22616.1208881536@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/328 X-Sequence-Number: 29821 Bryan Buecking writes: > On Tue, Apr 22, 2008 at 10:55:19AM -0500, Erik Jones wrote: >> That is WAY too high. Get a real pooler, such as pgpool, and drop >> that down to 1000 and test from there. > I agree, but the number of idle connections dont' seem to affect > performace only memory usage. I doubt that's true (and your CPU load suggests the contrary as well). There are common operations that have to scan the whole PGPROC array, which has one entry per open connection. What's worse, some of them require exclusive lock on the array. 8.3 has some improvements in this area that will probably let it scale to more connections than previous releases, but in any case connection pooling is a good thing. > I'm trying to lessen the load of > connection setup. But sounds like this tax is minimal? Not really. You're better off reusing a connection over a large number of queries. regards, tom lane