pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Jeff <threshar@torgo.978.org>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Anjan Dave <adave@vantage.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why is this system swapping?
Date: 27 Apr 2005 19:46:10 -0400
Message-ID: <87r7gv3hrx.fsf@stark.xeocode.com> (raw)
In-Reply-To: <cbe3ad2481e7cf5fcde552427c98f540@torgo.978.org>
References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509899C@vt-pe2550-001.vantage.vantage.com>
	<8764y83wg7.fsf@stark.xeocode.com>
	<cbe3ad2481e7cf5fcde552427c98f540@torgo.978.org>

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




view thread (10+ messages)  latest in thread

Message-ID: <87r7gv3hrx.fsf@stark.xeocode.com>
Permalink:  ../87r7gv3hrx.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87r7gv3hrx.fsf@stark.xeocode.com

 · 

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: gsstark@mit.edu, threshar@torgo.978.org, adave@vantage.com
  Subject: Re: Why is this system swapping?
  In-Reply-To: <87r7gv3hrx.fsf@stark.xeocode.com>

* 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