|
Today i tried again with common DBCP 1.2.2 but found the same issue.
I had maxIdle=30 minIdle=30 maxActive=30 after doing the loadtest, i found in netstat that there were 120 connections established. I don't see an issue of crossing the maxActive if i set minIdle to 0. The pool code to ensure minIdle should not cause this to happen.
Can you provide some more information on your setup and load test? In particular, How is the DBCP datasource being instantiated? Is DBCP running in a web container? What is the database? Is it remote from the host running the pool? Are all of the TCP connections ESTABLISHED? Are you sure they are all associated with the client connection pool? Are client threads timing out waiting for connections during the test (i.e.., do you see org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object)? What does the DBCP client do with connections obtained during the test? Is the load constant, with threads just repeating the same requests with no delays in between requests? What is the duration of the test? How is the DBCP datasource being instantiated? Is DBCP running in a web container?
In tomcat's server.xml, in ResourceParams, factory param is configured to use org.apache.commons.dbcp.BasicDataSourceFactory. What is the database? Is it remote from the host running the pool? Are all of the TCP connections ESTABLISHED? Are you sure they are all associated with the client connection pool? Are client threads timing out waiting for connections during the test (i.e.., do you see org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object)? Yes, if i have too many concurrent threads then i use to hit this issue. What does the DBCP client do with connections obtained during the test? Is the load constant, with threads just repeating the same requests with no delays in between requests? What is the duration of the test? I can't reproduce or verify this as a pool or dbcp bug. The only way I can understand this happening is if connections or associated sockets are failing to close. I have not been able to reproduce this behavior with Oracle, MySql or postgres, using same or similar settings to above.
Leaving open but changing fix version to 2.0. I can re-create this, but only by forcing a particular execution sequence with a debugger. The issue lies within the for loop in ensureMinIdle(). Consider the case where _numIdle=0, _minIdle>0 and _numActive+1 == _maxActive. If a client thread enters borrowObject() at the point where the evictor thread is about to call addObject() both threads will create objects leaving _numIdle==1 & _numActive==_maxActive. The next client call to borrowObject() will result in _numActive==_maxActive+1
This has been fixed for both GOP and GKOP based on the patch attached
Hi
We were using commons-pool 1.4 in our application and we came across this issue. Unfortunately it is critical for us :/ When I have a setting of: When running test with 20 threads I get: during test: after the test is done: I've updated commons-pool to 1.5.2 and unfortunately same thing happens, I cannot control maximum of active connections! Please provide some sample code that demonstrates the issue.
I'm sorry Mark,
I came back here to remove my comment as after building the app from scratch I have found that by default it used Sorry about that, tiredness. No problem. Good to hear 1.5.2 is working for you.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
In all the above tests, i had 40 concurrent threads that intern caused application code to get a connection from pool.