Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E511B9FBC89 for ; Tue, 1 May 2007 19:40:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 77893-02-3 for ; Tue, 1 May 2007 19:40:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by postgresql.org (Postfix) with ESMTP id A9C229FBC5C for ; Tue, 1 May 2007 19:34:38 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c24so1833141ana for ; Tue, 01 May 2007 15:34:37 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=VpOFcuFIMCrtnY6APfff7BLsxHBpfKwKDJjJo3d3+8a+huChgExmnrk1/7X4QjZhbUOP0IqqhZtj6t8PjeTIMmP0EL36u4zJh1KcYEEpRcy5oqdvwcWFZbdZ2UtGk4hwgD8WREXmJmM5HMigEtKNUK67Wa/t/f6r/ggXHf9Cu9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=Pe1+8mjsMBfj9Ry4Sn+EIw5atq/KmTdhmF+ICKwpgSBtgN9XJGnsHTrRO985wirzupwqO0476zItIg1l8xPrMWHSmCRbqgjg1cayYUcD4uWQQIHh7dQFhDs0V/KEU8gTvqnNHIrOOHmjP9mJytj/4UhPE/v8uZkjZXvN9sFWicc= Received: by 10.100.59.20 with SMTP id h20mr6021ana.1178058877330; Tue, 01 May 2007 15:34:37 -0700 (PDT) Received: by 10.100.144.18 with HTTP; Tue, 1 May 2007 15:34:37 -0700 (PDT) Message-ID: Date: Tue, 1 May 2007 17:34:37 -0500 From: "Aaron Bono" To: ksrinivas@coriendo.com Subject: Re: Intermittent Postgres Connection refused Errors (JDBC) Cc: pgsql-admin@postgresql.org In-Reply-To: <01aa01c78c3d$7a71cac0$800101df@srinilaptop> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_335716_31576431.1178058877254" References: <01a101c78c37$6da02450$800101df@srinilaptop> <01aa01c78c3d$7a71cac0$800101df@srinilaptop> X-Google-Sender-Auth: db9e2eb0ebbdf797 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/7 X-Sequence-Number: 25327 ------=_Part_335716_31576431.1178058877254 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 5/1/07, Srinivas Kotapally wrote: > > Thanks for the response. No, I am not exceeding the max limit. I tried > a test which would exceed the max connections (which is 100 - set in > postgresql.conf). The error at that point is > org.postgresql.util.PSQLException: FATAL: sorry, too many clients already > Are any errors showing up in the PostgreSQL logs? Also, are do you have any of your already established connections in your pool being that are begin disconnected? If so, you may be having intermittent network problems. The error you are getting implies that you are having connectivity problems between servers. I am tomcat and PostgreSQL are running on separate machines. Have you tried replicating this problem by running tomcat and PostgreSQL on the same machine and connecting to localhost? ------------------------------ > *From:* aaron.bono@gmail.com [mailto:aaron.bono@gmail.com] *On Behalf Of *Aaron > Bono > *Sent:* Tuesday, May 01, 2007 5:59 PM > *To:* ksrinivas@coriendo.com > *Cc:* pgsql-admin@postgresql.org > *Subject:* Re: [ADMIN] Intermittent Postgres Connection refused Errors > (JDBC) > > On 5/1/07, Srinivas Kotapally wrote: > > > > Hi > > > > I am managing an application that uses the Postgres backend. Of late we > > have started getting connection refused errors every now and then. We have > > not been able to identify the cause of this. Any hints or known bugs that I > > should be aware of? Thanks for any help extended! > > > > Regards > > > > Srinivas > > > > Here is the environment I work in: > > Application is a Java app residing on a web server and is running on > > Tomcat. > > Versions: > > jdk: 1.5.0_02 > > Tomcat 5.5.23 > > Web server: httpd-2.0.52-28.ent.centos4 > > Kernel: Linux version 2.6.9-42.0.10.ELsmp (mockbuild@builder5.centos.org > > ) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Tue Feb 27 > > 09:40:21 EST 2007 > > Postgres: 8.1.8 (64 bit version) - > > postgresql-libs-8.1.8-1PGDG > > postgresql-8.1.8-1PGDG > > postgresql-server-8.1.8-1PGDG > > postgresql-contrib-8.1.8-1PGDG > > > > We use the JDBC2 driver that comes with Postgres. > > > > The specific error we get is: > > > > CDBConnectionPool.newConnection() : SQLException= > > org.postgresql.util.PSQLException: Connection refused. Check that the > > hostname and port are correct and that the postmaster is accepting TCP/IP > > connections. > > > > Are you exceeding the maximum allowed connections in PostgreSQL? I would > start by checking the PostgreSQL logs. If nothing shows up, it may be a > network or application configuration issue. > > -Aaron > -- ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com ================================================================== ------=_Part_335716_31576431.1178058877254 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 5/1/07, Srinivas Kotapally <ksrinivas@coriendo.com> wrote:
Thanks for the response.  No, I am not exceeding the max limit.  I tried a test which would exceed the max connections (which is 100 - set in postgresql.conf).  The error at that point is
org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

Are any errors showing up in the PostgreSQL logs?

Also, are do you have any of your already established connections in your pool being that are begin disconnected?  If so, you may be having intermittent network problems.

The error you are getting implies that you are having connectivity problems between servers.  I am tomcat and PostgreSQL are running on separate machines.  Have you tried replicating this problem by running tomcat and PostgreSQL on the same machine and connecting to localhost?


From: aaron.bono@gmail.com [mailto:aaron.bono@gmail.com] On Behalf Of Aaron Bono
Sent: Tuesday, May 01, 2007 5:59 PM
To: ksrinivas@coriendo.com
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Intermittent Postgres Connection refused Errors (JDBC)

On 5/1/07, Srinivas Kotapally <ksrinivas@bisil.com> wrote:
Hi
 
I am managing an application that uses the Postgres backend.  Of late we have started getting connection refused errors every now and then.  We have not been able to identify the cause of this.  Any hints or known bugs that I should be aware of?  Thanks for any help extended!
 
Regards

Srinivas
 
Here is the environment I work in:
Application is a Java app residing on a web server and is running on Tomcat. 
Versions:
jdk: 1.5.0_02
Tomcat 5.5.23
Web server: httpd-2.0.52-28.ent.centos4
Kernel: Linux version 2.6.9-42.0.10.ELsmp (mockbuild@builder5.centos.org ) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Tue Feb 27 09:40:21 EST 2007
Postgres: 8.1.8 (64 bit version) -
postgresql-libs-8.1.8-1PGDG
postgresql-8.1.8-1PGDG
postgresql-server-8.1.8-1PGDG
postgresql-contrib-8.1.8-1PGDG
 
We use the JDBC2 driver that comes with Postgres.
 
The specific error we get is:
 
CDBConnectionPool.newConnection() : SQLException= org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Are you exceeding the maximum allowed connections in PostgreSQL?  I would start by checking the PostgreSQL logs.  If nothing shows up, it may be a network or application configuration issue.

-Aaron



--
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
================================================================== ------=_Part_335716_31576431.1178058877254--