Re: Why is this system swapping? - Mailing list pgsql-performance

From Greg Stark
Subject Re: Why is this system swapping?
Date
Msg-id 87r7gv3hrx.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Why is this system swapping?  (Jeff <threshar@torgo.978.org>)
Responses Re: Why is this system swapping?  (Josh Berkus <josh@agliodbs.com>)
Re: Why is this system swapping?  (Jeff <threshar@torgo.978.org>)
List pgsql-performance
Jeff <threshar@torgo.978.org> writes:

> Are you (Anjan) using real or fake connection pooling - ie pgpool versus php's
> persistent connections ?  I'd strongly recommend looking at pgpool. it does
> connection pooling correctly (A set of X connections shared among the entire
> box rather than 1 per web server)

Having one connection per web process isn't "fake connection pooling", it's a
completely different arrangement. And there's nothing "incorrect" about it.

In fact I think it's generally superior to having a layer like pgpool having
to hand off all your database communication. Having to do an extra context
switch to handle every database communication is crazy.

For typical web sites where the database is the only slow component there's
not much point in having more web server processes than connections anyways,
All your doing is transferring the wait time from waiting for a web server
process to waiting for a database process.

Most applications that find they need connection pooling are using it to work
around a poorly architected system that is mixing static requests (like
images) and database driven requests in the same web server.

However, your application sounds like it's more involved than a typical web
server. If it's handling many slow resources, such as connections to multiple
databases, SOAP services, mail, or other network services then you may well
need that many processes. In which case you'll need something like pgpool.

--
greg

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Joel's Performance Issues WAS : Opteron vs Xeon
Next
From: Josh Berkus
Date:
Subject: Re: Why is this system swapping?