On Thu, Oct 22, 2009 at 1:06 PM, Darryl Pentz <djpe...@yahoo.com> wrote: >>> The number of thread you need to setup is impossible to define without any >>> knowledge about your code. > >>> For instance, if you access a database in the handler, it's pretty obvious >>> that the thread might be stuck for a few ms, and with 800 concurrent >>> requests running, you will get awfull performances. >> That is exactly what happens. Virtually all calls that come in via a MINA >> connection are hitting our DB. So this being the case, do you recommend the >> approach documented here: >> http://mina.apache.org/configuring-thread-model.html > > Ironically, after running numerous tests, the best configuration is in fact > the default configuration of 1.1.7. - the one that results in the 16 > AnonymousIoService threads. Switching to manual with the CachedThreadPool was > horrible in that it created a mountain of worker threads, but there was still > high contention on the connection pool, despite the fact that I raised the > number of connections in the pool substantially. > > This is slightly OT, but if I may ask, what would be an ideal approach using > MINA when you have e.g. 1000 concurrent connections all wanting to make DB > calls? I'm using DBCP which by my understanding is single threaded, hence the > bottleneck around getting and returning connections. Is there a better > connection pool I could use that would still allow the manual threading and > cached thread pool to be efficient? >
Would recommend having a look at c3p0 library(http://sourceforge.net/projects/c3p0/), if you feel DBCP has an issue. I still doubt, DBCP has the threading problem, but let me reserve my opinion. Good Luck! -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal