Connection Pool Monitoring

I need to understand how to control the connection pool in my web application.
The following are the technical specifications of the application:

  • Application Server - JBoss Application Server
  • Database - Oracle 10g
  • Back-end - Hibernate

I need to know what are the different ways to monitor the connection pool and how we can do this. Using Hibernate or through JBoss or any other way? Please suggest me the right way to do this.

+8
java hibernate connection-pooling monitoring jboss
source share
4 answers

Perhaps this is not what you want. But what do you use for the pool? If you haven’t decided yet, check out C3PO , it will provide JMX with public attributes for monitoring

+3
source share

For a typical server-side Java application, one of the most preferred monitoring methods is JMX . Most applications (including connection pools) offer a default JMX bean (called MBeans or managed beans) that can be used for monitoring. The connection pool (for example, C3P0) creates an MBean that associates it with the underlying available JMX server (which is present on almost the entire application server, including tomcat, JBoss)

This MBean will contain all the connection pool information. You mentioned that you are using the JBoss server. The Jboss-provided web admin console should provide a view of all MBeans (including the MBean of the deployed connection pool).

Another monitoring method is the JConsole utility, which comes with Java. The same JConsole can be used to monitor JBoss .

+9
source share

FlexyPool is a data source proxy that provides better monitoring and crash recovery for almost all known connection pools:

  • DBCP Apache
  • Apache DBCP2
  • C3p0
  • BoneCP
  • HikariCP
  • Tomcat cp
  • Vibur DBCP
  • Bitronix Transaction Manager
  • Atomicos TransactionsEssentials

It allows you to track the following indicators:

  • histogram of parallel connections
  • parallel connection request histogram
  • data source connection time histogram
  • bar graph of rental time
  • maximum histogram of pool size
  • general histogram of connection reception time
  • overflow pool size histogram
  • retries the histogram

This way you can adjust the size of the pool so that it can accommodate as many application nodes as possible, protecting you from some unexpected bursts of traffic .

+3
source share

I found that when using JConsole , as suggested in other answers to connecting to JBoss (5.2) through JMX, MBeans for the connection pool were not visible.

Instead, I used the built-in JMXConsole , usually available at: http: // localhost: 8080 / jmx-console - you may need to change the host name and port for deployment.

If this is done, you will see a username and password prompt.
Default username / password: admin / admin
I first discovered that nothing happened, I had to update the file: server / default / conf / props / jmx-console-users.properties and uncomment the second line:

# A sample users.properties file for use with the UsersRolesLoginModule admin=admin 

Once this was done, I was able to log in. At this point, I entered in the Object Name Filter : jboss.jca: * Then I selected the appropriate connection pool link, for example: name = DefaultDS, service = ManagedConnectionPool , which shows all the information about the connection pool, for example AvailableConnectionCount, InUseConnectionCount, etc.

0
source share

All Articles