5608057 / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Tomcat JDBC Monitoring don't show Active Connection or Used jdbc Connection #410

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Deploy the sample.war attached 
2.Put the next url http:/XXXX/sample/test2.jsp, the jsp launch a select * from 
dual and return de date. Try some times
3.Check the charts in the monitoring, 

What is the expected output? What do you see instead?
The sqlhits per minute show all my request, but the Active Connection or Used 
jdbc connection show always 0

What version of the product are you using?
1.50.0 
On what application server, JDK,
operating system?
Tomcat 7.0.33 with the next Java version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Please provide any additional information below.
Only the last 50 messages are displayed
Mon May 26 12:00:21 CEST 2014     DEBUG     OS: Linux unknown, amd64/64
Mon May 26 12:00:21 CEST 2014     DEBUG     Java: Java(TM) SE Runtime 
Environment, 1.7.0_55-b13
Mon May 26 12:00:21 CEST 2014     DEBUG     Server: Apache Tomcat/7.0.33
Mon May 26 12:00:21 CEST 2014     DEBUG     Webapp context: 
Mon May 26 12:00:21 CEST 2014     DEBUG     JavaMelody version: 1.50.0
Mon May 26 12:00:21 CEST 2014     DEBUG     JavaMelody classes loaded from: 
file:/opt/tomcat/7.0/tomcat-pruebapool/lib/jira-javamelody.jar
Mon May 26 12:00:21 CEST 2014     DEBUG     Host: vilst420@10.0.9.84
Mon May 26 12:00:21 CEST 2014     DEBUG     log listeners initialized
Mon May 26 12:00:21 CEST 2014     DEBUG     datasources found in JNDI: []
Mon May 26 12:00:21 CEST 2014     DEBUG     counters initialized
Mon May 26 12:00:21 CEST 2014     DEBUG     counters data read from files in 
/opt/tomcat/7.0/tomcat-pruebapool/temp/javamelody/_vilst420
Mon May 26 12:00:21 CEST 2014     DEBUG     collect task scheduled every 60s
Mon May 26 12:00:22 CEST 2014     DEBUG     first collect of data done
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody filter init done in 464 
ms
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody listener init started
Mon May 26 12:00:22 CEST 2014     DEBUG     datasources found in JNDI: []
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody listener init done in 5 
ms
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody filter init started
Mon May 26 12:00:22 CEST 2014     DEBUG     OS: Linux unknown, amd64/64
Mon May 26 12:00:22 CEST 2014     DEBUG     Java: Java(TM) SE Runtime 
Environment, 1.7.0_55-b13
Mon May 26 12:00:22 CEST 2014     DEBUG     Server: Apache Tomcat/7.0.33
Mon May 26 12:00:22 CEST 2014     DEBUG     Webapp context: /manager
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody version: 1.50.0
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody classes loaded from: 
file:/opt/tomcat/7.0/tomcat-pruebapool/lib/jira-javamelody.jar
Mon May 26 12:00:22 CEST 2014     DEBUG     Host: vilst420@10.0.9.84
Mon May 26 12:00:22 CEST 2014     DEBUG     log listeners initialized
Mon May 26 12:00:22 CEST 2014     DEBUG     datasources found in JNDI: []
Mon May 26 12:00:22 CEST 2014     DEBUG     counters initialized
Mon May 26 12:00:22 CEST 2014     DEBUG     counters data read from files in 
/opt/tomcat/7.0/tomcat-pruebapool/temp/javamelody/manager_vilst420
Mon May 26 12:00:22 CEST 2014     DEBUG     collect task scheduled every 60s
Mon May 26 12:00:22 CEST 2014     DEBUG     first collect of data done
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody filter init done in 448 
ms
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody listener init started
Mon May 26 12:00:22 CEST 2014     DEBUG     datasources found in JNDI: []
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody listener init done in 1 
ms
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody filter init started
Mon May 26 12:00:22 CEST 2014     DEBUG     OS: Linux unknown, amd64/64
Mon May 26 12:00:22 CEST 2014     DEBUG     Java: Java(TM) SE Runtime 
Environment, 1.7.0_55-b13
Mon May 26 12:00:22 CEST 2014     DEBUG     Server: Apache Tomcat/7.0.33
Mon May 26 12:00:22 CEST 2014     DEBUG     Webapp context: /host-manager
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody version: 1.50.0
Mon May 26 12:00:22 CEST 2014     DEBUG     JavaMelody classes loaded from: 
file:/opt/tomcat/7.0/tomcat-pruebapool/lib/jira-javamelody.jar
Mon May 26 12:00:22 CEST 2014     DEBUG     Host: vilst420@10.0.9.84
Mon May 26 12:00:22 CEST 2014     DEBUG     log listeners initialized
Mon May 26 12:00:22 CEST 2014     DEBUG     datasources found in JNDI: []
Mon May 26 12:00:22 CEST 2014     DEBUG     counters initialized
Mon May 26 12:00:22 CEST 2014     DEBUG     counters data read from files in 
/opt/tomcat/7.0/tomcat-pruebapool/temp/javamelody/host-manager_vilst420
Mon May 26 12:00:22 CEST 2014     DEBUG     collect task scheduled every 60s
Mon May 26 12:00:23 CEST 2014     DEBUG     first collect of data done
Mon May 26 12:00:23 CEST 2014     DEBUG     JavaMelody filter init done in 472 
ms

DataBase:  java:comp/env/jdbc/MyAppDS:
jdbc:oracle:thin:@XXXX:YYY:ZZZZ
Oracle, Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit 
Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Driver JDBC:
Oracle JDBC driver, 11.2.0.3.0 
Jdbc DataSource:  java:comp/env/jdbc/MyAppDS:
maxActive = 20
poolPreparedStatements = false
defaultCatalog = null
defaultAutoCommit = true
defaultReadOnly = false
defaultTransactionIsolation = -1
driverClassName = oracle.jdbc.OracleDriver
initialSize = 1
maxIdle = 30
maxOpenPreparedStatements = -1
maxWait = -1
minEvictableIdleTimeMillis = 1800000
minIdle = 0
numTestsPerEvictionRun = 3
testOnBorrow = false
testOnReturn = false
testWhileIdle = false
timeBetweenEvictionRunsMillis = -1
validationQuery = null

Original issue reported on code.google.com by sigbert on 26 May 2014 at 10:17

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It seems normal to me.
Because, executing a "select * from dual" is very fast. So, even with many 
executions, active and used jdbc connections can be considered to be always 0.

If you want to test and find active/used jdbc connections, you need some sql 
which duration is much longer. Something like sql sleep (but note that sleep is 
not a standard sql function in Oracle).

Let me know if we can close this issue.

Original comment by evernat@free.fr on 26 May 2014 at 3:50

GoogleCodeExporter commented 8 years ago
Hi Evernat

I change the  query for a execute a procedure that simulate a sleep 15 for 
seconds

Now the System information shows

Nb of active jdbc connections:  6  
Nb of used jdbc connections
(opened if no datasource):  6 / 20    

And the charts draws the use. One question about the display. Number Threads 
and Jdbc Sessions are allways an int value without units, but the graph shows 
like a float value with ms units

You can close this issue.

Original comment by sigbert on 27 May 2014 at 8:15

GoogleCodeExporter commented 8 years ago
Thanks.

> but the graph shows like a float value with ms units
This is an effect of RRD (round robin database) which stores values in the 
graphs. What you describe is probably a mean between several int values.

Original comment by evernat@free.fr on 29 May 2014 at 12:47