Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 481381337CE9 for ; Tue, 14 Sep 2010 13:59:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 21667-01 for ; Tue, 14 Sep 2010 16:59:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 997611337C71 for ; Tue, 14 Sep 2010 13:59:10 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id D46B8348015; Tue, 14 Sep 2010 09:59:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SXzL7VYtKWxL; Tue, 14 Sep 2010 09:59:02 -0700 (PDT) Received: from [192.168.1.132] (unknown [75.142.155.118]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id D977B348011; Tue, 14 Sep 2010 09:59:01 -0700 (PDT) Subject: Re: Held idle connections vs use of a Pooler From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: mark Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Tue, 14 Sep 2010 09:58:45 -0700 Message-ID: <1284483525.28610.2729.camel@jd-desktop.unknown.charter.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201009/77 X-Sequence-Number: 40280 On Tue, 2010-09-14 at 10:10 -0600, mark wrote: > Hello, > > I am relatively new to postgres (just a few months) so apologies if > any of you are bearing with me. > > I am trying to get a rough idea of the amount of bang for the buck I > might see if I put in a connection pooling service into the enviroment > vs our current methodology of using persistent open connections. Well what a pooler does is provide persisten open connections that can be reused. What tech are you using for these persisten open connections? > Most of the connections from the various apps hold idle connections > until they need to execute a query once done go back to holding an > open idle connection. (there are ~600 open connections at any given > time, and most of the time most are idle) Sounds like each app is holding its own pool? > I think from reading this list for a few weeks the answer is move to > using connection pooling package elsewhere to better manage incoming > connections, with a lower number to the db. Correct, because each connection is overhead. If you have 600 connections, of which really only 20 are currently executing, that is highly inefficient. A pooler would have say, 40 connections open, with 20 currently executing and a max pool of 600. > > I am told this will require some re-working of some app code as I > understand pg-pool was tried a while back in our QA environment and > server parts of various in-house apps/scripts/..etc started to > experience show stopping problems. Use pgbouncer. It is what Skype uses. Sincerely, Joshua D. Drake -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt