As the creation of JDBC connections are expensive and frequently cause performance bottlenecks in applications, it is crucial to monitor how a JDBC connection pool is releasing and creating new connections, and how many threads are waiting to retrieve a connection from a particular pool. Statistics-gathering is enabled by default for JDBC Connection Pools. The following attributes are monitored:
averageConnWaitTime (count): Average wait time of connections for successful connection request attempts to the connector connection pool.
connectionRequestWaitTime (range): The longest and shortest wait times of connection requests.
numConnAcquired (count): Number of logical connections acquired from the pool.
numConnCreated (count): Number of physical connections created since the last reset.
numConnDestroyed (count): Number of physical connections destroyed since the last reset.
numConnFailedValidation (count): Number of connections that failed validation.
numConnFree (count): Number of free connections in the pool.
numConnReleased (count): Number of logical connections released to the pool.
numConnTimedOut (bounded range): Number of connections in the pool that have timed out.
numConnUsed (range): Number of connections that have been used.
waitQueueLength (count): Number of connection requests in the queue waiting to be serviced.
To get the statistics, use these commands:
asadmin get --monitor=true serverInstance.resources.jdbc-connection-pool.*asadmin get --monitor=true serverInstance.resources.jdbc-connection-pool. poolName.* *