X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DC9E7D7337 for ; Tue, 30 Aug 2005 13:26:15 -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 00576-06 for ; Tue, 30 Aug 2005 16:26:11 +0000 (GMT) Received: from mir3-fs.mir3.com (unknown [65.208.188.100]) by svr1.postgresql.org (Postfix) with ESMTP id 17F0ED6E6B for ; Tue, 30 Aug 2005 13:26:09 -0300 (ADT) Received: from archimedes ([172.16.2.68]) by mir3-fs.mir3.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 30 Aug 2005 09:29:12 -0700 Subject: Re: max connection From: Mark Lewis To: Hina Chauhan Cc: postgres - jdbc In-Reply-To: <000a01c5ad2b$51ab58b0$c20aa8c0@codecindia.com> References: <000a01c5ad2b$51ab58b0$c20aa8c0@codecindia.com> Content-Type: text/plain Organization: MIR3, Inc. Date: Tue, 30 Aug 2005 09:26:08 -0700 Message-Id: <1125419168.15018.61.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-16) Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Aug 2005 16:29:12.0304 (UTC) FILETIME=[F46B1F00:01C5AD7F] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.402 required=5 tests=[AWL=-0.402, DEAR_SOMETHING=0.803] X-Spam-Level: X-Archive-Number: 200508/204 X-Sequence-Number: 13773 Depends on your workload and your code. If your code does not hog connections for long periods of time and the queries are fairly light- weight, then you might only need a small handful. On the other hand, if your code ties up connections while presenting the user interface (not a recommended mode of operation), then you would probably need one per user. To tune the max connections, you might want to guess low on the number of connections, but log how long your code waits to acquire a connection from the pool. If it's too long, then either fix your code or increase the connections. -- Mark On Tue, 2005-08-30 at 11:52 +0530, Hina Chauhan wrote: > Dear Sir/Madam, > > > I am facing a problem, if u can help me. > > I am uging postgres 7.4 database. In java application I am using > connection pooling (jakarta-web server, using datasource), wherein I > have to decide how many max connection I should use. > > Do we have any concept wherein we can say number of connection > propotional to number of user OR how many users per connection can > work. > > My project would be used by 100 users at a time, which may increase to > 400 users latter. > > > I am having file context.xml with following settings, Can I add some > thing more to it. > > > > > WEB-INF/web.xml > META-INF/context.xml > > > > type="javax.sql.DataSource" > driverClassName="org.postgresql.Driver" > url="jdbc:postgresql://localhost:5432/collectioninfo" > username="bacsindia" password="bacsindia" maxActive="5" > maxIdle="2" > maxWait="10"/> > > > > > Regards, > > Hina Chauhan > Codec Communications pvt. Ltd.