Monitor JDBC Adapter Connection Pool Size

Hello,

I am wondering how we can monitor the current pool size of a JDBC adapter connection that uses connection pooling.

We are seeing some errors like the following. This sounds like the maximum pool size is reached. To avoid such errors we not just want to increase the maximum pool size but also include the current pool size in our monitoring.


[ART.118.5053] Adapter Runtime (Connection): Unable to get a connection to resource knconfig.connection:bpaDbOracleConnection. A connection was not available for request in pool knconfig.connection:bpaDbOracleConnection 

Thanks for your ideas.

Regards,
Mathias

Try this service: pub.art.connection:getConnectionStatistics

HTH

The problem you are having is because of bad sessions on JDBC Pools

Setting the min connection value to 0 permits the pool to close all connections in the pool after the idle/expiration time has passed. This is the recommended setting for production environments. This avoids keeping unused connections too long and helps avoid stale connections (Stale connection : connections that the adapter thinks are still good but the resource has closed.)

This setting does not control the number of simultaneous connections allowed. That is controlled by the max connections setting.

I would like to keep a connection pool to 1 in terms of realtime services like webServices. When a webService tries to connect to a db it should have data readily available.

Hope this helps.

1 Like

Thanks for the information.

I had a look at pub.art.connection:getConnectionStatistics - unfortunately this service is not returning the maximum pool size. It there a way to monitor the connection pools using JMX?

Also I am wondering if I can also monitor the connection pools defined under “Settings > JDBC Pools”. Any ideas on that?

Hi,

I am not sure about the JMX part but i am sure the if you check the services which are listed under WmART/wm.art.admin.connection.XXXXX they have what you are looking for.

Also you can use the pub.art.connection:getConnectionStatistics services to do a math and check.

Here the actual problem what you have is the size of the maximum pool. You might want to consider looking at the values and calculating a more accurate one.

Hi mathiasd,

You can use the following to get the properties for IS JDBC pool connections.

IJDBCConnPool poolXYZ = JDBCConnectionManager.getConnPool(JDBCPoolName);

and then you can use the functions poolXYZ.getMinConnections(), etc to get the connection pool details at runtime.

Import the following 2 in java service:

com.wm.jdbc.*
com.wm.app.b2b.server.*

You have to set the ‘max connection pool’ setting with few factors in mind…

  1. Peak transactions per second
  2. Maximum time db takes to respond
  3. If peak transactions flows when db responds with max time, can the other transaction wait to get a thread, or is there any SLA?

Say, peak transaction in a second is 10, and database can take upto 5 seconds to respond. In those 5 second, your total number of request can go upto 5*10 when db responds by taking max time. You can set 50 as max connections limit in this case. Gather some statistics, and set the ‘max conn’.

HTH
Senthil

“You can set 50 as max connections limit in this case. Gather some statistics, and set the ‘max conn’.”

I agree with Senthil above: