[Building Sakai] Cannot get a connection, pool error Timeout waiting for idle object

Martin B. Smith smithmb at ufl.edu
Mon May 10 09:55:16 PDT 2010


On 05/07/2010 06:55 PM, Joshua Swink wrote:
> Sometimes under heavy usage, we get this error:
> 
> org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
> pool error Timeout waiting for idle object
>         at
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
>         at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>         at
> org.sakaiproject.db.impl.BasicSqlService.borrowConnection(BasicSqlService.java:254)
> ...
> 
> Tomcat crashes then and has to be restarted.
> 
> Is there some way we can configure the pool to work better under load?
> Are there any alternate connection pools that might work better?
> 
> Thanks for any replies.

Hi Joshua,

Upon various community recommendations, we've set some of our DBCP
parameters connecting to Oracle as below, and it does seem to have
minimized the exception you mention:

# idle must equal active
maxIdle at javax.sql.BaseDataSource=50
initialSize at javax.sql.BaseDataSource=50
maxActive at javax.sql.BaseDataSource=50

# never evict connections
timeBetweenEvictionRunsMillis at javax.sql.BaseDataSource=-1

# abandoned data sources
removeAbandoned at javax.sql.BaseDataSource=true
removeAbandonedTimeout at javax.sql.BaseDataSource=300
logAbandoned at javax.sql.BaseDataSource=false

As I said, these were for Oracle, though, so your mileage may vary if
you are using another database.

Keep us posted on your results,
-- 
Martin B. Smith
smithmb at ufl.edu - (352) 273-1374
CNS/Open Systems Group
University of Florida

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5497 bytes
Desc: S/MIME Cryptographic Signature
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100510/3a89dcb8/attachment.bin 


More information about the sakai-dev mailing list