dbTalk Databases Forums  

Recommended DBCP configuration parameters

mailing.database.mysql-java mailing.database.mysql-java


Discuss Recommended DBCP configuration parameters in the mailing.database.mysql-java forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank Burns
 
Posts: n/a

Default Recommended DBCP configuration parameters - 07-23-2004 , 05:19 AM






Hi,

I'm using DBCP for JNDI-accessed connection pooling with mySQL and
Connector/J in a Tomcat 5-based application.

Can anyone tell me where I can find recommendations/guidelines for choosing
values for the DBCP parameters -- such as maxActive, maxIdle, maxWait,
etc. -- in the ResourceParams element of server.xml?

For example, I am about to launch a system that has a user base of approx
7000 users, which I expect will be thrashed hard at launch time and then
settle down to an average of 10 to 100 users at any given time. But what are
the best values to specify for my database pooling parameters?

Thanks,

Frank.


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=my...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Kevin A. Burton
 
Posts: n/a

Default Re: Recommended DBCP configuration parameters - 07-24-2004 , 12:55 AM






Frank Burns wrote:

Quote:
Hi,

I'm using DBCP for JNDI-accessed connection pooling with mySQL and
Connector/J in a Tomcat 5-based application.

Can anyone tell me where I can find recommendations/guidelines for choosing
values for the DBCP parameters -- such as maxActive, maxIdle, maxWait,
etc. -- in the ResourceParams element of server.xml?

For example, I am about to launch a system that has a user base of approx
7000 users, which I expect will be thrashed hard at launch time and then
settle down to an average of 10 to 100 users at any given time. But what are
the best values to specify for my database pooling parameters?


We're using a DBCP snapshot from 2002 that was actually distributed
within Turbine... Believe it or not its a LOT more robust than the
latest release which has a number of bugs. I'd recommend not using DBCP
but thats just me (even though I'm an Apache developer and it hurts me
to say it).

Anyway...

We have a multithreaded app with about 400 concurrent connections
pounding the box with only 20 maxActive connections and it works great.

Another note... DBCP has a bug with multithreaded code. Init your
threadpool in one static thread and then get connection up until
maxActive and then release them all. It has a terrible bug where it
will get confused and isn't able to expand the pool anymore. ...

Anyway

--

Please reply using PGP.

http://peerfear.org/pubkey.asc

NewsMonster - http://www.newsmonster.org/

Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=my...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Kevin A. Burton
 
Posts: n/a

Default Re: Recommended DBCP configuration parameters - 07-24-2004 , 02:02 PM



Frank Burns wrote:

Quote:
Hi Kevin,

Thanks very much for your response. It's really appreciated.

So I'll set maxActive to 200. What are your maxIdle and maxWait values set
to? Or aren't they that important?


Did I say 200? We're using 20 ... which I still think might be too
much. I'd rather use the memory for HEAP tables or index cache.

The problem is that each conn on the server uses about 5M so if you have
a gig to use then go for it but its overkill.

.... anyway..

maxIdle I set to 0 ... I don't want it closing connections.

maxWait I set to 60000.... but that might be too long.

Also look at this:

http://www.mysql.com/documentation/c...r-j/#id2801179

The JDBC driver itself has some important options especially the
PreparedStatement cache stuff.

Quote:
What would you recommend as an alternative to DBCP for pooling? For example,
how could I get a copy of the 2002 snapshot that you refer to? Or is there
is something else you'd recommend?


The 2002 snapshot also has a similar bug but is much more reliable. I
think a workaround is just to create all threads on init in one thread.

Also note that the documentation for DBCP is wrong... maxWait, maxIdle,
and maxActive are really only the pool options you can set. Everything
else is experimental.

The sad thing is that I'm probably going to have to take DBCP and start
from scratch and maybe create a DBCP 2.0.... but I don't have time for
that right now

Peace!

--

Please reply using PGP.

http://peerfear.org/pubkey.asc

NewsMonster - http://www.newsmonster.org/

Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=my...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.