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 A16AB54630 for ; Wed, 27 Apr 2005 20:46:27 -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 03543-10 for ; Wed, 27 Apr 2005 23:46:20 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id 65B2E5464B for ; Wed, 27 Apr 2005 20:46:17 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1DQwEM-0003Lw-00; Wed, 27 Apr 2005 19:46:10 -0400 To: Jeff Cc: Greg Stark , "Anjan Dave" , Subject: Re: Why is this system swapping? References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509899C@vt-pe2550-001.vantage.vantage.com> <8764y83wg7.fsf@stark.xeocode.com> In-Reply-To: From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 27 Apr 2005 19:46:10 -0400 Message-ID: <87r7gv3hrx.fsf@stark.xeocode.com> Lines: 30 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/750 X-Sequence-Number: 12147 Jeff 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