pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: Jeff <threshar@torgo.978.org>
Cc: Martin Foster <martin@ethereal-realms.org>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Performance Bottleneck
Date: Sun, 08 Aug 2004 09:52:01 -0400
Message-ID: <41163001.8040500@Yahoo.com> (raw)
In-Reply-To: <ED5E071A-E933-11D8-A672-000D9366F0C4@torgo.978.org>
References: <ktQPc.23297$yT2.16983@clgrps13>
	<4114E54C.7040200@Yahoo.com>
	<4115BA2C.3000900@ethereal-realms.org>
	<ED5E071A-E933-11D8-A672-000D9366F0C4@torgo.978.org>

On 8/8/2004 8:10 AM, Jeff wrote:

> On Aug 8, 2004, at 1:29 AM, Martin Foster wrote:
> 
>> I am currently making use of Apache::DBI which overrides the 
>> DBI::disconnect call and keeps a pool of active connections for use 
>> when need be.   Since it offloads the pooling to the webserver, it 
>> seems more advantageous then pgpool which while being able to run on a 
>> external system is not adding another layer of complexity.
>>
> 
> Apache::DBI is not the same sort of a pool as pgpool.  DB connections 
> are not shared among all your apache children (A common misconception). 
>   So if you have 300 apache kids you can have have 300 db connections.  
> With pgpool connections are  shared among all of them so even though 
> you have 300 kids you only have say 32 db connections.

And this is exactly where the pgpool advantage lies. Especially with the 
TPC-W, the Apache is serving a mix of PHP (or whatever CGI technique is 
used) and static content like images. Since the 200+ Apache kids serve 
any of that content by random and the emulated browsers very much 
encourage it to ramp up MaxClients children by using up to 4 concurrent 
image connections, one does end up with MaxClients DB connections that 
are all relatively low frequently used. In contrast to that the real 
pgpool causes lesser, more active DB connections, which is better for 
performance.


> 
>> Anyone had any experience with both Apache::DBI and pgpool?   For my 
>> needs they seem to do essentially the same thing, simply that one is 
>> invisible to the code while the other requires adding the complexity 
>> of a proxy.
>>
> 
> Both are invisible to the app.  (With pgpool it thinks it is connecting 
> to a regular old PG server)
> 
> And I've been running pgpool in production for months.  It just sits 
> there.  Doesn't take much to set it up or configure it.  Works like a 
> champ

And it buys you some extra admin feature people like to forget about it. 
One can shut down one pool for one web application only. That gives you 
instant single user access to one database without shutting down the 
whole webserver or tempering with the pg_hba.conf file.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



view thread (38+ messages)  latest in thread

Message-ID: <41163001.8040500@Yahoo.com>
Permalink:  ../41163001.8040500@Yahoo.com/
Also on:    postgresql.org/message-id/41163001.8040500@Yahoo.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: JanWieck@Yahoo.com, threshar@torgo.978.org, martin@ethereal-realms.org
  Subject: Re: Performance Bottleneck
  In-Reply-To: <41163001.8040500@Yahoo.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