Hello All,
I just spent the past two weeks playing around with tomcat's connection pool, and I'm not very impressed. I'm in the process of porting a webapp to WebSphere and using tomcat to test with. Apparently Tomcat and websphere use the same mechanism for connection pooling (DataSource with jndi lookup, perhaps weblogic does this as well). After following the (poor) documentation and finally setting up a few beans which do the jndi lookup/SQL and referring to those beans inside jsp's, I got the implementation working. Using one browser, the implementation worked fine, however when I tried to benchmark the solution using httperf, I quickly realized how poor this implementation truly is. The problem seemed to occur in the jndi lookup. Apparently tomcat would start a new background thread for every call that came in, if all other threads serving jsp in question were busy. I can only assume that it was taking entirely too long to do the jndi lookup, acquire a connection and execute the corresponding sql statement. Tomcat was running on a p4 2ghz with 1.5 gig of ram. Overall the benchmark did not allow more than 10 get requests per second to be executed without more background threads being started up. This meant in effect that if we had a buildup of more than 10 req/sec for more than a few minutes, tomcat would lock. Prior to using the jndi solution, our team was using a modified version of DDConnectionBroker at opensource.devdaily.com. The main problem with this connection broker was that it did not allow the extra unused connections to be returned to the sql server. We took a day and fixed this and now after experiencing both solutions, I'm very glad we can still fall back. Our database machine isn't a behemoth (ultra 5 w/128mb running postgresql), but with 35 processes opened, we were able to serve about 32 connections a second with no errors whatsoever. Given this drastic increase in performance, I can only assume that the db server is not the bottleneck in the jndi solution. I won't say that I'm 100% sure we didn't have an error in our use of the jndi solution, but over a week and a half with more than one programmer working the issue, we couldn't find an adequate solution. Any comments?