X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3470B5E46D5 for ; Sun, 8 Aug 2004 10:52:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55546-05 for ; Sun, 8 Aug 2004 13:52:15 +0000 (GMT) Received: from smtp105.mail.sc5.yahoo.com (smtp105.mail.sc5.yahoo.com [66.163.169.225]) by svr1.postgresql.org (Postfix) with SMTP id 128D85E46CB for ; Sun, 8 Aug 2004 10:52:08 -0300 (ADT) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp105.mail.sc5.yahoo.com with SMTP; 8 Aug 2004 13:52:13 -0000 Received: from [172.21.8.18] ([192.168.192.101]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id i78Dq53v064577; Sun, 8 Aug 2004 09:52:05 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <41163001.8040500@Yahoo.com> Date: Sun, 08 Aug 2004 09:52:01 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Cc: Martin Foster , PostgreSQL Performance Subject: Re: Performance Bottleneck References: <4114E54C.7040200@Yahoo.com> <4115BA2C.3000900@ethereal-realms.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200408/102 X-Sequence-Number: 7738 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 #