instanceOfObject
instanceOfObject

Reputation: 2994

Monitor number of connections a DB has

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.

Upvotes: 1

Views: 1094

Answers (2)

Andrey Svirsky
Andrey Svirsky

Reputation: 116

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

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

Upvotes: 2

ddewaele
ddewaele

Reputation: 22603

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.

Upvotes: 2

Related Questions