From: Mark Lewis <mark.lewis@mir3.com>
To: Hina Chauhan <hina.chauhan@codecindia.com>
Cc: postgres - jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: max connection
Date: Tue, 30 Aug 2005 09:26:08 -0700
Message-ID: <1125419168.15018.61.camel@archimedes> (raw)
In-Reply-To: <000a01c5ad2b$51ab58b0$c20aa8c0@codecindia.com>
References: <000a01c5ad2b$51ab58b0$c20aa8c0@codecindia.com>
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.
>
> <Context reloadable="true">
>
> <!-- Default set of monitored resources -->
> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> <WatchedResource>META-INF/context.xml</WatchedResource>
>
> <!-- Uncomment this to disable session persistence across Tomcat
> restarts -->
> <!--
> <Manager pathname="" />
> -->
> <Resource name="jdbc/mypostgre" auth="Container"
> type="javax.sql.DataSource"
> driverClassName="org.postgresql.Driver"
> url="jdbc:postgresql://localhost:5432/collectioninfo"
> username="bacsindia" password="bacsindia" maxActive="5"
> maxIdle="2"
> maxWait="10"/>
>
> </Context>
>
>
> Regards,
>
> Hina Chauhan
> Codec Communications pvt. Ltd.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mark.lewis@mir3.com, hina.chauhan@codecindia.com
Subject: Re: max connection
In-Reply-To: <1125419168.15018.61.camel@archimedes>
References: <000a01c5ad2b$51ab58b0$c20aa8c0@codecindia.com> <1125419168.15018.61.camel@archimedes>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox