I would like to know if there is some problem with our configuration. We are using JBoss 4.0.3SP1 and AJP port fronted by apache using mod_jk. Our service.xml file looks like this:
Currently, JMX console shows following stats for ManagedConnectionPool:
What I feel abnormal is the InUseConnectionCount. It's unlikely that an application at no load uses 2252 connections. Also i think the setting connectionTimeout=20000 for AJP port is not functional, even though the server.log shows connection timed out sequences. I wonder about the difference in value of ConnectionDestroyedCount and ConnectionCreatedCount which is greater than 3000 which clearly shows that connections are not being closed properly.
Can anyone give any idea about this?
I am hopeful.
I'm confused. The title for your post mentions datasource connections. The service.xml file entries are for HTTP connections, not for database connections. In which case I am not exactly sure about the "stats for ManagedConnectionPool", were those for HTTP or datasource connections (it would help if you gave the full JMX mbean name.
I wonder about the difference in value of ConnectionDestroyedCount and ConnectionCreatedCount which is greater than 3000
clearly shows that connections are not being closed properly.
If you are talking about HTTP connections, the only sane way to close them is to force your users to log out when they are done with accessing your app. The other thing you can do is lower the timeout threshold which would cause "stale" connections to be closed sooner. Of course this might also inconvenience users in one way or another, so you have to balance the user's desires with your desire to keep connections to a minimum.
Thank you so much for the reply and sorry for the confusion. Actually I was depicting the value connectionTimeout="20000" for the AJP port. The http port is not in use and has been commented.
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
We have set the max-pool-size to 4000. I was eager to know why our ConnectionCount is always rising and not resetting even when the application is idle. Since the timeout is set to 10 seconds i was thinking that the connection count should decrease as the connections are timed out. Please help me if i have misunderstood. Also the InUseConnectionCount has a value in thousands even when the application is idle. Do they increase until the AvailableConnectionCount reaches the MinSize? Shouldn't they reset after the connections are terminated?
Any help will be greatly appreciated.
The InUseConnectionCount indicates that your code (or actually, all code using that datasource - is that datasource used by messaging or any other services or apps?) currently has that many active connections to the database. The database might be able to tell you which queries were done on each connection - that might help you understand who still is holding on to the connection.
Joined: Apr 22, 2011
I used CachedConnectionManager to detect connection leaks and JBoss successfully closed open connections for me resulting very few InUseConnectionCount. However, it also closed the result sets in our application. Could you please help me set some fixed time interval after which the connections could be closed by Jboss? I could not figure out how JBoss determines which connections are totally inactive. Result Sets do need to exist for some time but i feel JBoss tries to close them immediately.
Any support on this issue would be greatly appreciated.