Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 868021337BA0 for ; Mon, 6 Dec 2010 11:31:35 -0400 (AST) 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 12891-08 for ; Mon, 6 Dec 2010 15:31:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C84BB1337B8C for ; Mon, 6 Dec 2010 11:31:27 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oB6FVRRF026310; Mon, 6 Dec 2010 10:31:28 -0500 (EST) To: Jorge Augusto Meira cc: Kevin Grittner , Euler Taveira de Oliveira , pgsql-bugs@postgresql.org Subject: Re: Problems with max_connections parameter In-reply-to: References: <4CF90198.4000609@timbira.com> <4CF8B02F020000250003821A@gw.wicourts.gov> Comments: In-reply-to Jorge Augusto Meira message dated "Mon, 06 Dec 2010 10:47:53 -0200" Date: Mon, 06 Dec 2010 10:31:27 -0500 Message-ID: <26309.1291649487@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/48 X-Sequence-Number: 28854 Jorge Augusto Meira writes: > The error message was: > "Erro Conexão: A tentativa de conexão falhou." > or > "Erro Conexão: FATAL: connection limit exceeded for non-superusers" Hmm ... I can't find the first of those anywhere in the 8.4 message lists; but the second one definitely says that you *are* hitting the max_connections limit, whether you think you should be or not. I wonder whether you are neglecting to allow for the fact that backends have a nonzero shutdown time? If you disconnect and immediately reconnect, it's possible that your old backend is still around, so that the new connection attempt causes max_connections to be exceeded. This is particularly likely if the test program is on the same machine as the database server, because the test program itself is likely to have a higher scheduling priority than the old backend. regards, tom lane