From Maria.L.Wilson-1@nasa.gov Thu Aug 26 20:29:46 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id EDC4C6329C3 for ; Thu, 26 Aug 2010 17:29:46 -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 66573-08 for ; Thu, 26 Aug 2010 20:29:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ndjsnpf01.ndc.nasa.gov (ndjsnpf01.ndc.nasa.gov [198.117.1.121]) by mail.postgresql.org (Postfix) with ESMTP id 406FE6329B6 for ; Thu, 26 Aug 2010 17:29:39 -0300 (ADT) Received: from ndmsppt05.ndc.nasa.gov (ndmsppt05.ndc.nasa.gov [198.117.0.104]) by ndjsnpf01.ndc.nasa.gov (Postfix) with ESMTP id E66E2328C34 for ; Thu, 26 Aug 2010 15:29:38 -0500 (CDT) Received: from ndmshub02.ndc.nasa.gov (ndmshub02-pub.ndc.nasa.gov [198.117.0.161]) by ndmsppt05.ndc.nasa.gov (8.14.3/8.14.3) with ESMTP id o7QKTWpS024854 for ; Thu, 26 Aug 2010 15:29:32 -0500 Received: from LRC000959195.larc.nasa.gov (198.119.134.170) by smtp02.ndc.nasa.gov (198.117.0.161) with Microsoft SMTP Server (TLS) id 8.2.247.2; Thu, 26 Aug 2010 15:29:37 -0500 Message-ID: <4C76CEAB.1070308@nasa.gov> Date: Thu, 26 Aug 2010 16:29:31 -0400 From: "Maria L. Wilson" Reply-To: Maria.L.Wilson-1@nasa.gov Organization: SSAI User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: [Fwd: postgres 8.4.1 number of connections] Content-Type: multipart/alternative; boundary="------------030604080100020607040402" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.0.10011, 1.0.148, 0.0.0000 definitions=2010-08-26_14:2010-08-26, 2010-08-26, 1970-01-01 signatures=0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.209 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/285 X-Sequence-Number: 40128 --------------030604080100020607040402 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 7bit -------- Original Message -------- Subject: postgres 8.4.1 number of connections Date: Thu, 26 Aug 2010 14:25:47 -0500 From: Maria L. Wilson Reply-To: Wilson, Maria Louise (LARC-E301)[SCIENCE SYSTEMS APPLICATIONS] To: pgsql-performance-owner@postgresql.org we have this application (using jboss/java/hibernate) on linux accessing data on 3 postgres database servers using 8.4.1. One of our many concerns has been the way we handle connections to the database. java/hibernate handle their own pooling so I understand that using anything else is out of the question. Our jboss configuration currently defaults to 5 connections per database. On our main database server, we handle 7 of the databases that this application uses. On this one server, we usually average around 300 - 500 connections to the server. In our postgres conf file on this particular machine we set the max_connection parameter to 1000. If we set it to much lower we end up with connection errors. Any comments or better way to handle this? thanks, Maria Wilson NASA, Langley Research Center Hampton, Virginia 23666 --------------030604080100020607040402 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit

-------- Original Message --------
Subject: postgres 8.4.1 number of connections
Date: Thu, 26 Aug 2010 14:25:47 -0500
From: Maria L. Wilson <Maria.L.Wilson-1@nasa.gov>
Reply-To: Wilson, Maria Louise (LARC-E301)[SCIENCE SYSTEMS APPLICATIONS] <m.l.wilson@nasa.gov>
To: pgsql-performance-owner@postgresql.org <pgsql-performance-owner@postgresql.org>


we have this application (using jboss/java/hibernate) on linux accessing 
data on 3 postgres database servers using 8.4.1. 

One of our many concerns has been the way we handle connections to the 
database.  java/hibernate handle their own pooling so I understand that 
using anything else is out of the question.  Our jboss configuration 
currently defaults to 5 connections per database.  On our main database 
server, we handle 7 of the databases that this application uses.  On 
this one server, we usually average around 300 - 500 connections to the 
server.  In our postgres conf file on this particular machine we set the 
max_connection parameter to 1000.  If we set it to much lower we end up 
with connection errors.  Any comments or better way to handle this?

thanks,  Maria Wilson
NASA, Langley Research Center
Hampton, Virginia 23666

--------------030604080100020607040402-- From scott.marlowe@gmail.com Thu Aug 26 21:13:54 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D1A276328EF for ; Thu, 26 Aug 2010 18:13:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 28581-09 for ; Thu, 26 Aug 2010 21:13:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id 1F6BD632788 for ; Thu, 26 Aug 2010 18:13:46 -0300 (ADT) Received: by wwb34 with SMTP id 34so470041wwb.19 for ; Thu, 26 Aug 2010 14:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=YU9ZwlzH1pprkYbm+0XB99l6AHMUgP02Nu/LkpRY7WU=; b=H94CC9OeciTlp7IBnGj+MjYdS1Zmnmcqun/m7ez27u94RaRcjzCup+OEx/CwNKiHyS Mfxo240/EQy6yWOaR8WsoMbK4HElpGRQDTAUHyakom0898VqaQwEA2hBs1qsKJrDcV8S Qt4tIDwbym2eMGLVc/tSNEsvqibex3WyZAHf4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xSCzaDS7HCXdWuAqc5/DoU1TMeV71qi8S45LbKUk30FM7TWISIJf5It5zg70C7iurb wrBvpUDl3CFIsEcRkuzJgAArJYFP1tAPYRlvFu9BVfFpha6dFC6rMLJIZwmkV0M1J6o/ Psx3HISjY1wla0Ra6gKQFZTB8bmea53ElG9gU= MIME-Version: 1.0 Received: by 10.227.138.84 with SMTP id z20mr3933458wbt.214.1282857224852; Thu, 26 Aug 2010 14:13:44 -0700 (PDT) Received: by 10.227.148.75 with HTTP; Thu, 26 Aug 2010 14:13:44 -0700 (PDT) In-Reply-To: <4C76CEAB.1070308@nasa.gov> References: <4C76CEAB.1070308@nasa.gov> Date: Thu, 26 Aug 2010 15:13:44 -0600 Message-ID: Subject: Re: [Fwd: postgres 8.4.1 number of connections] From: Scott Marlowe To: Maria.L.Wilson-1@nasa.gov Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201008/286 X-Sequence-Number: 40129 On Thu, Aug 26, 2010 at 2:29 PM, Maria L. Wilson wrote: > > > we have this application (using jboss/java/hibernate) on linux accessing > data on 3 postgres database servers using 8.4.1. > > One of our many concerns has been the way we handle connections to the > database. java/hibernate handle their own pooling so I understand that > using anything else is out of the question. It's not impossible to put another connection pooler between hibernate and your database server. May not be useful or better, but it's possible. > Our jboss configuration > currently defaults to 5 connections per database. I assume this is for each app server. How many app servers do you have? > On our main database > server, we handle 7 of the databases that this application uses. On > this one server, we usually average around 300 - 500 connections to the > server. In our postgres conf file on this particular machine we set the > max_connection parameter to 1000. If we set it to much lower we end up > with connection errors. Any comments or better way to handle this? Other than breaking out the databases onto their own server, or trying to pool to fewer connections, not really. OTOH, a db server with enough memory can handle having that many connections as long as you don't run into any thundering herd issues. Oh, and you should really update your pgsql to 8.4.4. 8.4.1 had some issues with heavy load I ran into last year about this time. Which is why I'm still on 8.3.11 -- To understand recursion, one must first understand recursion. From josh@agliodbs.com Fri Aug 27 01:06:14 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5E2BB632BC9 for ; Thu, 26 Aug 2010 22:06:14 -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 67440-05 for ; Fri, 27 Aug 2010 01:06:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glacier.frostconsultingllc.com (glacier.frostconsultingllc.com [69.36.227.170]) by mail.postgresql.org (Postfix) with ESMTP id 1ECE6632AF3 for ; Thu, 26 Aug 2010 22:06:07 -0300 (ADT) Received: from dsl081-245-111.sfo1.dsl.speakeasy.net ([64.81.245.111] helo=Sidney-Stratton.local) by glacier.frostconsultingllc.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1OonOI-0007yH-DI; Thu, 26 Aug 2010 18:06:03 -0700 Message-ID: <4C770F75.20702@agliodbs.com> Date: Thu, 26 Aug 2010 18:05:57 -0700 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: "Maria L. Wilson" CC: pgsql-performance@postgresql.org Subject: Re: [Fwd: postgres 8.4.1 number of connections] References: <4C76CEAB.1070308@nasa.gov> In-Reply-To: <4C76CEAB.1070308@nasa.gov> Content-Type: text/plain; charset=UTF-8 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: 201008/290 X-Sequence-Number: 40133 > One of our many concerns has been the way we handle connections to the > database. java/hibernate handle their own pooling so I understand that > using anything else is out of the question. It's not out of the question, but it's probably not necessary. > Our jboss configuration > currently defaults to 5 connections per database. On our main database > server, we handle 7 of the databases that this application uses. On > this one server, we usually average around 300 - 500 connections to the > server. Do you have 10 to 20 application servers? Otherwise I don't understand how you're getting 300 to 500 connections. Do you have any stats about how many connections for each database each JBOSS server actually needs? It seems unusual that it would need more than one or two. Also, why does the application use 7 different databases? -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com From magnus@hagander.net Fri Aug 27 07:54:56 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B7F466334DF for ; Fri, 27 Aug 2010 04:54:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 49563-02 for ; Fri, 27 Aug 2010 07:54:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id 73A736334C5 for ; Fri, 27 Aug 2010 04:54:48 -0300 (ADT) Received: by wwb34 with SMTP id 34so1116631wwb.19 for ; Fri, 27 Aug 2010 00:54:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.22.70 with SMTP id s48mr407459wes.27.1282895686500; Fri, 27 Aug 2010 00:54:46 -0700 (PDT) Received: by 10.216.44.130 with HTTP; Fri, 27 Aug 2010 00:54:46 -0700 (PDT) In-Reply-To: References: <4C76CEAB.1070308@nasa.gov> Date: Fri, 27 Aug 2010 09:54:46 +0200 Message-ID: Subject: Re: [Fwd: postgres 8.4.1 number of connections] From: Magnus Hagander To: Scott Marlowe Cc: "Maria.L.Wilson-1" , "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201008/292 X-Sequence-Number: 40135 On Thu, Aug 26, 2010 at 23:13, Scott Marlowe wrot= e: > On Thu, Aug 26, 2010 at 2:29 PM, Maria L. Wilson > wrote: >> >> >> we have this application (using jboss/java/hibernate) on linux accessing >> data on 3 postgres database servers using 8.4.1. >> >> One of our many concerns has been the way we handle connections to the >> database. =A0java/hibernate handle their own pooling so I understand tha= t >> using anything else is out of the question. > > It's not impossible to put another connection pooler between hibernate > and your database server. =A0May not be useful or better, but it's > possible. I've been using pgbouncer in combination with the jboss connection pooler several times, mainly for the reason that reconfiguring the jboss connection poolers (particularly if you have lots of them) can cause quite a bit of downtime. Just sticking a 1-1 mapping pgbouncer in between with support for SUSPEND makes a lot of difference if you switch master/slave on your replication /ha. It'll still break the connections for jboss, but it'll recover from that a *lot* faster than a reconfig. --=20 =A0Magnus Hagander =A0Me: http://www.hagander.net/ =A0Work: http://www.redpill-linpro.com/ From Maria.L.Wilson-1@nasa.gov Mon Aug 30 14:22:43 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E1963632AA3 for ; Mon, 30 Aug 2010 11:22:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 24603-08 for ; Mon, 30 Aug 2010 14:22:33 +0000 (UTC) X-Greylist: delayed 00:29:06.481627 by SQLgrey-1.7.6 Received: from ndmsnpf01.ndc.nasa.gov (ndmsnpf01.ndc.nasa.gov [198.117.0.121]) by mail.postgresql.org (Postfix) with ESMTP id 4DB54633DA8 for ; Mon, 30 Aug 2010 11:22:35 -0300 (ADT) Received: from ndmsppt05.ndc.nasa.gov (ndmsppt05.ndc.nasa.gov [198.117.0.104]) by ndmsnpf01.ndc.nasa.gov (Postfix) with ESMTP id 8C06726144A; Mon, 30 Aug 2010 08:53:26 -0500 (CDT) Received: from ndmshub02.ndc.nasa.gov (ndmshub02-pub.ndc.nasa.gov [198.117.0.161]) by ndmsppt05.ndc.nasa.gov (8.14.3/8.14.3) with ESMTP id o7UDrK33025132; Mon, 30 Aug 2010 08:53:20 -0500 Received: from LRC000959195.larc.nasa.gov (198.119.134.170) by smtp02.ndc.nasa.gov (198.117.0.161) with Microsoft SMTP Server (TLS) id 8.2.247.2; Mon, 30 Aug 2010 08:53:26 -0500 Message-ID: <4C7BB7D0.3010201@nasa.gov> Date: Mon, 30 Aug 2010 09:53:20 -0400 From: "Maria L. Wilson" Reply-To: Organization: SSAI User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Scott Marlowe CC: "Wilson, Maria Louise (LARC-E301)[SCIENCE SYSTEMS APPLICATIONS]" , "pgsql-performance@postgresql.org" Subject: Re: [Fwd: postgres 8.4.1 number of connections] References: <4C76CEAB.1070308@nasa.gov> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050001080805020306070300" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.0.10011, 1.0.148, 0.0.0000 definitions=2010-08-30_05:2010-08-30, 2010-08-30, 1970-01-01 signatures=0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.209 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/328 X-Sequence-Number: 40171 --------------050001080805020306070300 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit thanks for your response.... we have 3 app servers that attach to this one particular database server. What kind of load issues did you find on 8.4.1? I'd be interested in anything documented on it - this might make an upgrade a higher priority! thanks, Maria Scott Marlowe wrote: > On Thu, Aug 26, 2010 at 2:29 PM, Maria L. Wilson > wrote: > >> we have this application (using jboss/java/hibernate) on linux accessing >> data on 3 postgres database servers using 8.4.1. >> >> One of our many concerns has been the way we handle connections to the >> database. java/hibernate handle their own pooling so I understand that >> using anything else is out of the question. >> > > It's not impossible to put another connection pooler between hibernate > and your database server. May not be useful or better, but it's > possible. > > >> Our jboss configuration >> currently defaults to 5 connections per database. >> > > I assume this is for each app server. How many app servers do you have? > > >> On our main database >> server, we handle 7 of the databases that this application uses. On >> this one server, we usually average around 300 - 500 connections to the >> server. In our postgres conf file on this particular machine we set the >> max_connection parameter to 1000. If we set it to much lower we end up >> with connection errors. Any comments or better way to handle this? >> > > Other than breaking out the databases onto their own server, or trying > to pool to fewer connections, not really. OTOH, a db server with > enough memory can handle having that many connections as long as you > don't run into any thundering herd issues. > > Oh, and you should really update your pgsql to 8.4.4. 8.4.1 had some > issues with heavy load I ran into last year about this time. Which is > why I'm still on 8.3.11 > > -- > To understand recursion, one must first understand recursion. > --------------050001080805020306070300 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit thanks for your response....
we have 3 app servers that attach to this one particular database server.
What kind of load issues did you find on 8.4.1?  I'd be interested in anything documented on it - this might make an upgrade a higher priority!

thanks,  Maria

Scott Marlowe wrote:
On Thu, Aug 26, 2010 at 2:29 PM, Maria L. Wilson
<Maria.L.Wilson-1@nasa.gov> wrote:
  
we have this application (using jboss/java/hibernate) on linux accessing
data on 3 postgres database servers using 8.4.1.

One of our many concerns has been the way we handle connections to the
database.  java/hibernate handle their own pooling so I understand that
using anything else is out of the question.
    

It's not impossible to put another connection pooler between hibernate
and your database server.  May not be useful or better, but it's
possible.

  
 Our jboss configuration
currently defaults to 5 connections per database.
    

I assume this is for each app server.  How many app servers do you have?

  
 On our main database
server, we handle 7 of the databases that this application uses.  On
this one server, we usually average around 300 - 500 connections to the
server.  In our postgres conf file on this particular machine we set the
max_connection parameter to 1000.  If we set it to much lower we end up
with connection errors.  Any comments or better way to handle this?
    

Other than breaking out the databases onto their own server, or trying
to pool to fewer connections, not really.  OTOH, a db server with
enough memory can handle having that many connections as long as you
don't run into any thundering herd issues.

Oh, and you should really update your pgsql to 8.4.4.  8.4.1 had some
issues with heavy load I ran into last year about this time.  Which is
why I'm still on 8.3.11

--
To understand recursion, one must first understand recursion.
  
--------------050001080805020306070300--