[c3p0-users] C3P0 thread blocking GooGooStatementCache.acquireStatement
Status: Beta
Brought to you by:
swaldman
From: Ruel L. <rue...@gm...> - 2010-02-03 02:20:44
|
I'm hoping someone can point me in the right direction. I'm performance testing my web application which uses hibernate and c3p0 v 0.9.1.1. When the simulated userload is increased to 200 concurrent users I can see using the YourKit profiler the majority of my threads in a blocked state. The prepared statement setting is currently set to 1000. The stack trace for these threads is as follows: java.lang.Object.wait() com.mchange.v2.c3p0.stmt.GooGooStatementCache.acquireStatement com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkoutStatement com.mchange.v2.c3p0.impl.NewPooledConnection.checkoutStatement com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement ... So i spent some time googling, grabbed the source code and looked through it. In GooGooStatementCache.aquireStatement we create a new instance of StmtAcquireTask and post it to the blockingTaskAsyncRunner. Runnable r = new StmtAcquireTask(); blockingTaskAsyncRunner.postRunnable(r); while ( outHolder[0] == null && exceptionHolder[0] == null ) this.wait(); //give up our lock while the Statement gets prepared What I am seeing is that this is waiting 5-10 seconds. before the wait is released. There is some type of starvation going on here....but I'm not yet sure what. Any ideas on what I should be looking for or any tips and tricks to debug this? Thanks! R |