ConnectionPool monitoring

You can use the ConnectionPool MXBean for connection pool monitoring in Liberty.

Performance data is made available for each connection pool. Connection pools manage connections from data sources and connection factories.

To enable connection pool monitoring, you must enable the monitor-1.0 feature:
The ObjectName for identifying each ConnectionPool MXBean is:
The following example shows a connection pool (for a data source or connection factory) that does not have a JNDI name. The data source [default-x] name is considered as the data source object when JNDI is not specified.

<transaction enableLoggingForHeuristicReporting="true" transactionLogSize="2048">
	<dataSource transactional="false">
		<jdbcDriver libraryRef="DerbyLib"/>
		<properties.derby.embedded databaseName="<DIR Path>/<DatabaseName>" createDatabase="create"/>
Example configurations when a connection manager is provided.
  • When an explicit ID is not specified, an ID is generated based on its parent
    <dataSource id="MyDataSource">
    	<connectionManager maxPoolSize="10"/>
    	<jdbcDriver libraryRef="DB2JCC4LIB"/>
    	<properties.db2.jcc .../>
  • When an ID is specified, that becomes the identifier
    <dataSource id="DataSource2" jdbcDriverRef="DB2JCCDriver" connectionManagerRef="Pool2">
    	<properties.db2.jcc .../>
    <connectionManager id="Pool2" maxPoolSize="20"/> 
  • Obtaining the correct identifier for a type 2 driver connection pool.
    • Ensure that the application that is using the pool makes a call to DB2 so that the pool is initialized.
    • Navigate to the REST interface to determine the proper identifier to use in the configuration. For example:

    Specifying the correct identifier for a connection pool for a type 2 driver


The ConnectionPool MXBean is responsible for reporting ConnectionPool Stats for a single connection manager. The following counter attributes are available for the ConnectionPool MXBean after monitoring is enabled:

The total number of managed connections that have been created since pool creation.
The total number of managed connections that have been destroyed since pool creation.
The total number of managed connections in the free, shared, and unshared pools.
The average waiting time in milliseconds until a connection is granted if a connection is not currently available.
The number of connections that are in use. This number might include multiple connections that are shared from a single managed connection.
The number of managed connections in the free pool.
The average time in milliseconds that a connection is in use.

Wait time details that include the total number of queued requests, minimum wait time, and maximum wait time.


In use time details that include the total number of granted connections (excluding the ones that are currently in use), minimum in use time, and maximum in use time.