X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4570A53482 for ; Wed, 13 Apr 2005 22:15:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45324-05 for ; Thu, 14 Apr 2005 01:15:48 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.205]) by svr1.postgresql.org (Postfix) with ESMTP id 6529553771 for ; Wed, 13 Apr 2005 22:15:47 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 40so1783515nzk for ; Wed, 13 Apr 2005 18:15:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JciyACC6/6Zr0Kf0dIvaUd8v+aAJujJouQc1sYDi2RV6YdqJfwFJ8xoTCCpBaD885yxSS21zTLx0T8Grs/FrgsqQ3Z1uC6W7btWvN8ro1AaL/P1hpJ1uzNFzHRLbyHGqtC7SN+4cdWvFc/5JNOJCkphNSXdp//YEzPaPXa6+Euk= Received: by 10.36.113.5 with SMTP id l5mr79535nzc; Wed, 13 Apr 2005 18:15:51 -0700 (PDT) Received: by 10.36.96.6 with HTTP; Wed, 13 Apr 2005 18:15:51 -0700 (PDT) Message-ID: Date: Thu, 14 Apr 2005 11:15:51 +1000 From: Slavisa Garic Reply-To: Slavisa Garic To: Mark Lewis Subject: Re: [PERFORM] Many connections lingering Cc: Greg Stark , Tom Lane , pgsql-performance@postgresql.org, pgsql-novice@postgresql.org In-Reply-To: <1113410549.5589.62.camel@amateljan.mirlogic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2314.1113360715@sss.pgh.pa.us> <87u0mbjr02.fsf@stark.xeocode.com> <1113410549.5589.62.camel@amateljan.mirlogic.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.315 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/191 X-Sequence-Number: 13074 HI Mark, My DBServer module already serves as a broker. At the moment it opens a new connection for every incoming Agent connection. I did it this way because I wanted to leave synchronisation to PGSQL. I might have to modify it a bit and use a shared, single connection for all agents. I guess that is not a bad option I just have to ensure that the code is not below par :), Also thank for the postgresql.conf hint, that limit was pretty low on our server so this might help a bit, Regards, Slavisa On 4/14/05, Mark Lewis wrote: > If there are potentially hundreds of clients at a time, then you may be > running into the maximum connection limit. >=20 > In postgresql.conf, there is a max_connections setting which IIRC > defaults to 100. If you try to open more concurrent connections to the > backend than that, you will get a connection refused. >=20 > If your DB is fairly gnarly and your performance needs are minimal it > should be safe to increase max_connections. An alternative approach > would be to add some kind of database broker program. Instead of each > agent connecting directly to the database, they could pass their data to > a broker, which could then implement connection pooling. >=20 > -- Mark Lewis >=20 > On Tue, 2005-04-12 at 22:09, Slavisa Garic wrote: > > This is a serious problem for me as there are multiple users using our > > software on our server and I would want to avoid having connections > > open for a long time. In the scenario mentioned below I haven't > > explained the magnitute of the communications happening between Agents > > and DBServer. There could possibly be 100 or more Agents per > > experiment, per user running on remote machines at the same time, > > hence we need short transactions/pgsql connections. Agents need a > > reliable connection because failure to connect could mean a loss of > > computation results that were gathered over long periods of time. >=20 >