Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AACC01337BF5 for ; Thu, 28 Apr 2011 11:38:11 -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 36761-05; Thu, 28 Apr 2011 14:38:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 7D4811337BEA; Thu, 28 Apr 2011 11:38:02 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 28 Apr 2011 09:38:02 -0500 Message-Id: <4DB93577020000250003CFE6@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 28 Apr 2011 09:37:59 -0500 From: "Kevin Grittner" To: "Suprabhat Mohapatra" Cc: Subject: Re: BUG #5995: connection pooling not working References: <201104271155.p3RBtDwu092291@wwwmaster.postgresql.org> <4DB7D775020000250003CF28@gw.wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/252 X-Sequence-Number: 37433 Please keep the list copied. I'm moving this to the pgsql-admin list (with a blind copy to -bugs), since there is really no hint of a PostgreSQL bug here, except possibly in terms of how we document this issue. Suprabhat Mohapatra wrote: > Should I send you the sample code that we are using. That's unlikely to help much. You either need to really boost max_connections or (much better) properly configure some connection pooler. There are many options for the latter. I'm told that Tomcat comes with a good connection pooler built in. If you're in an environment where the software comes with a connection pooler, that is often the best way to go. Otherwise, pgbouncer and pgpool both have their fans. I've looked over the stand-alone JDBC pooler that Apache has, and it looked pretty good, too. The key is read the documentation carefully, and understand that the pooler can accept 300 client connections to it (or whatever number you need) and service those with a much smaller set of database connections. If you're configuring the pooler to use as many database connections as you have clients, you're missing the point. > I am on a production system and we have reached a stage where we > may lose the business if this is not done in this week. You might want to contact one of the many organizations which provide contract support for PostgreSQL. I'm pretty sure most or all of them will have someone with experience configuring a good connection pooler. http://www.postgresql.org/support/professional_support -Kevin