pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryan Buecking <buecking@gmail.com>
Cc: Erik Jones <erik@myemma.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: CPU bound at 99%
Date: Tue, 22 Apr 2008 12:25:36 -0400
Message-ID: <22616.1208881536@sss.pgh.pa.us> (raw)
In-Reply-To: <20080422161020.GE5961@starling-software.com>
References: <20080422153045.GB5961@starling-software.com>
	<DCD21583-38AA-4E01-BA29-39A7078259FE@myemma.com>
	<20080422161020.GE5961@starling-software.com>

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



view thread (14+ messages)  latest in thread

Message-ID: <22616.1208881536@sss.pgh.pa.us>
Permalink:  ../22616.1208881536@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22616.1208881536@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, buecking@gmail.com, erik@myemma.com
  Subject: Re: CPU bound at 99%
  In-Reply-To: <22616.1208881536@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox