Hi, Hmm, with minIdle set to 20 and assuming your test gets one connection at a time (or less than 20 at a time), I'm a bit confused.
One next step would be to really verify that the pool has available connections before the get connection call. You obviously wouldn't do this in a production application, but this is just for debugging a performance test. Cast the DataSource to the concrete implementation type, probably org.apache.commons.dbcp.BasicDataSource, and call getNumIdle on it to verify it's a positive number before calling getConnection. If it's zero or negative your pool is misconfigured and you're creating a new connection, hence the slow performance. Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Henrik Rathje [mailto:[EMAIL PROTECTED] >Sent: Friday, September 10, 2004 11:46 AM >To: Tomcat Users List >Subject: Re: DBCP Performance? > >Hi, >The minIdle value during this test was: ><parameter> > <name>minIdle</name> > <value>20</value> ></parameter> >any other suggestions? >Thanks in advance, Henrik > > > >On Fri, 10 Sep 2004 11:21:08 -0400 >"Shapira, Yoav" <[EMAIL PROTECTED]> wrote: > >> >> Hi, >> The initial connections can be closed if idle, depending on your pool >> configuration, so you might be creating new connections each time even >> with the pool. Check your minIdle setting. >> >> If you're creating a new connection each time, a tiny bit of overhead >> can be expected for a pool over a direct DriverManager call. But that >> defeats the purpose of pooling. If your pool is properly configured and >> has a connection waiting, it should be a little bit more than a hash >> lookup to return the connection, which would be significantly faster >> than creating a new one. >> >> Yoav Shapira >> Millennium Research Informatics >> >> >> >-----Original Message----- >> >From: Henrik Rathje [mailto:[EMAIL PROTECTED] >> >Sent: Friday, September 10, 2004 11:16 AM >> >To: [EMAIL PROTECTED] >> >Subject: DBCP Performance? >> > >> >Hi, >> >has enyone of you recently measured the performance of the DBCP >> >Connection Pool? I compared >> > >> ><snip> >> >long start = System.currentTimeMillis(); >> >Class.forName("ca.edbc.jdbc.EdbcDriver"); >> >Connection dbcon = DriverManager.getConnection(loginUrl, loginUser, >> >loginPa$ >> >long diff = System.currentTimeMillis() - start; >> >System.out.println("creating connection without pool took: " + diff + " >> >mil$ >> ></snip> >> > >> >with >> > >> ><snip> >> >long start = System.currentTimeMillis(); >> >Connection dbcon = ds.getConnection( ); >> >long diff = System.currentTimeMillis() - start; >> >System.out.println("creating connection with pool took: " + diff + " >> >milise$ >> ></snip> >> > >> >And got surprisingly results like this: >> > >> >creating connection without pool took: 465 miliseconds >> >creating connection with pool took: 585 miliseconds >> > >> >In my tests the connection pool is always slower, so what did I do >> wrong? >> >I guess this Parameter is responsible for holding active Connections in >> >the Pool: >> ><parameter> >> > <name>initialSize</name> >> > <value>20</value> >> ></parameter> >> >So there shold be active Connections before the getConnection( ) is >> >called .. Any ideas? >> >Regards, Henrik >> > >> >--------------------------------------------------------------------- >> >To unsubscribe, e-mail: [EMAIL PROTECTED] >> >For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> This e-mail, including any attachments, is a confidential business >communication, and may contain information that is confidential, >proprietary and/or privileged. This e-mail is intended only for the >individual(s) to whom it is addressed, and may not be saved, copied, >printed, disclosed or used by anyone else. If you are not the(an) intended >recipient, please immediately delete this e-mail from your computer system >and notify the sender. Thank you. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
