1

We are using hibernate and C3PO for connections. Sometimes, load on the DB increases and we start facing issues.

How can we monitor the number of connections we make without exceeding the pool limit?

What other monitoring can be put to avoid load on the DB? A few examples are as follows:

a. Thread count.

b. CPU usage.

c. Space left.

c. I don't know if huge number of transactions could cause any issue. If they do, how to get their counts. etc.

instanceOfObject
  • 2,936
  • 5
  • 49
  • 85
  • "What other monitoring can be put to avoid load on the DB?" - this is a BIG question. – djechlin Feb 05 '13 at 19:44
  • Possible duplicate of [How to monitor c3p0 connections](http://stackoverflow.com/questions/4104125/how-to-monitor-c3p0-connections) – OhadR Nov 13 '16 at 12:47
  • http://stackoverflow.com/questions/4104125/how-to-monitor-c3p0-connections – OhadR Nov 13 '16 at 12:48

2 Answers2

2

c3p0 datasources can be accessed via a JMX administration. The PooledDataSource has a large number of interesting operations that are exposed through JMX.

More info on Configuring and Managing c3p0 via JMX.

Please not that monitoring does what it does , it monitors the execution of the datasources. Monitoring does not avoid load on the DB. It can be used to analyse the runtime performance and tweak connection pools where appropriate.

ddewaele
  • 22,363
  • 10
  • 69
  • 82
2

Try JavaMelody - http://code.google.com/p/javamelody/

Among many other useful things it can report on number of connections used.