Re: CPU bound at 99% - Mailing list pgsql-performance

From Tom Lane
Subject Re: CPU bound at 99%
Date
Msg-id 22616.1208881536@sss.pgh.pa.us
Whole thread Raw
In response to Re: CPU bound at 99%  (Bryan Buecking <buecking@gmail.com>)
List pgsql-performance
Bryan Buecking <buecking@gmail.com> 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

pgsql-performance by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: CPU bound at 99%
Next
From: Craig Ringer
Date:
Subject: Re: CPU bound at 99%