tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: DBCP: optimum settings
Date Fri, 30 Aug 2002 16:53:51 GMT


On Thu, 29 Aug 2002, neal wrote:

> Date: Thu, 29 Aug 2002 21:40:24 -0700
> From: neal <nealcabage@yahoo.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: DBCP: optimum settings
>
> Im wondering what the maximum active conn objects is in a DBCP pool.  On my
> production server I'm running Tomcat 4.0.4 on Linux, using Connector/J 2 and
> MySQL 3.23.  I'm running a 733 PII, with 256 MB RAM.  I've got
> resourceParams maxWait set to 100 and maxIdle set to 3000.
>
> Does anyone know what would be optimum with this config, off hand?   Just
> trying to get a basic idea.
>

There's no general purpose answer to this, because it is *totally*
application dependent.

The max active connections determines the maximum number of simultaneous
requests your database will be hit with from the webapp that is using the
pool.  How many can it support?  How many TCP connections can your OS and
JVM support?

Tuning parameters like this is an exercise in tradeoffs -- increasing the
limit (and actually running into it) generally causes response times to
worsen for everyone -- your job is to achieve an appropriate balance.  The
interesting part is that the relationship between more users and slower
response is usually not linear -- in fact, it often has a very sharp
kneebend where supporting "n" users is ok, but supporting "n + 5" users
starts to go through the roof.

But you need to start by asking yourself how many simultaneous users you
expect to have executing your app.  Start with maxActive set to that
number and back it down if response times are too long.  Along the way, be
prepared to start tuning the database operations that go too long (this is
usually *much* more important than the size of the connection pool) or
buying some more hardware.

>Thanks.
> Neal

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message