Re: CPU bound at 99%

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryan Buecking <buecking(at)gmail(dot)com>
Cc: Erik Jones <erik(at)myemma(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: CPU bound at 99%
Date: 2008-04-22 16:25:36
Message-ID: 22616.1208881536@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Bryan Buecking <buecking(at)gmail(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Craig Ringer 2008-04-22 16:36:35 Re: CPU bound at 99%
Previous Message Scott Marlowe 2008-04-22 16:23:55 Re: CPU bound at 99%