Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id C7F199FB319 for ; Fri, 20 Jul 2007 20:27:11 -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 32310-04 for ; Fri, 20 Jul 2007 20:27:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by postgresql.org (Postfix) with ESMTP id 406899FB300 for ; Fri, 20 Jul 2007 20:27:08 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO [192.168.1.27]) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 12708405; Fri, 20 Jul 2007 16:31:18 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: large number of connected connections to postgres database (v8.0) Date: Fri, 20 Jul 2007 16:28:27 -0700 User-Agent: KMail/1.8 Cc: Fei Liu References: <469D0F99.1030002@aepnetworks.com> In-Reply-To: <469D0F99.1030002@aepnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707201628.28266.josh@agliodbs.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/279 X-Sequence-Number: 25963 Fei Liu, > It appears my multi-thread application (100 connections every 5 seconds) > is stalled when working with postgresql database server. I have limited > number of connections in my connection pool to postgresql to 20. At the > begining, connection is allocated and released from connection pool as > postgres serves data request. The pool can recover from exhaustion. But > very quickly (after about 400 client requests), it seems postgres server > stops serving and connection to postgres server is not released any more > resulting a resource exhausting for clients. This sounds more like a problem with your connection pool. Unless PostgreSQL is slowing down due to CPU/RAM/I/O saturation? In any case, I doubt the problem is too many connections, or you'd just get an error message ... -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco