Re: Why is this system swapping?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Jeff <threshar(at)torgo(dot)978(dot)org>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, "Anjan Dave" <adave(at)vantage(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Why is this system swapping?
Date: 2005-04-27 23:46:10
Message-ID: 87r7gv3hrx.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jeff <threshar(at)torgo(dot)978(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2005-04-28 00:02:49 Re: Why is this system swapping?
Previous Message Jim C. Nasby 2005-04-27 21:01:50 Re: Joel's Performance Issues WAS : Opteron vs Xeon