• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC Monitoring

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

A jar file is running in an Unix server and there are many DB connections being opened.

I would like to know whether it closed all the connections by monitoring it externally.

I used below arguments to set the JMX Port and was able to connect with JConsole and VisualVM. How to get stats on how many connections are being opened, closed and still active.

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9080 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false

Thanks,
Hafiez.

 
Marshal
Posts: 28263
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the code use a connection pool to control those database connections? From your description it sounds like that's how it is. In that case, does the connection pool support JMX monitoring? If so, then hopefully it tells you what JMX objects you should be looking at, and also how to cause it to create those objects. I assume that when you looked at the server you didn't see anything which looked like data from a connection pool? That would mean either that it doesn't support JMX monitoring or that it does, but it isn't configured.
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can monitor the file descriptors of a process on Linux (and maybe on other Unices) making use of the pseudo file-system /proc like this:

ig@obuweb:~/test/igdaemon$ ls -l /proc/53833/fd
total 0
lr-x------ 1 ig ig 64 Feb 20 18:09 0 -> /dev/null
l-wx------ 1 ig ig 64 Feb 20 18:09 1 -> /home/ig/test/igdaemon/nohup.out
lr-x------ 1 ig ig 64 Feb 20 18:09 10 -> /home/ig/test/igdaemon/lib/commons-logging-1.2.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 11 -> /home/ig/test/igdaemon/lib/commons-pool2-2.2.jar
l-wx------ 1 ig ig 64 Feb 20 18:09 12 -> /home/ig/test/igdaemon/log/igserver.log
lr-x------ 1 ig ig 64 Feb 20 18:09 13 -> /opt/jre1.7.0_75/lib/resources.jar
lrwx------ 1 ig ig 64 Feb 20 18:09 14 -> socket:[3252618300]
lrwx------ 1 ig ig 64 Feb 20 18:09 15 -> socket:[3252618302]
l-wx------ 1 ig ig 64 Feb 20 18:09 2 -> /home/ig/test/igdaemon/nohup.out
lr-x------ 1 ig ig 64 Feb 20 18:09 3 -> /opt/jre1.7.0_75/lib/rt.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 4 -> /home/ig/test/igdaemon/lib/log4j-1.2.17.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 5 -> /home/ig/test/igdaemon/lib/commons-dbcp2-2.0.1.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 6 -> /home/ig/test/igdaemon/lib/intelliguard-host-0.0.1-SNAPSHOT.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 7 -> /home/ig/test/igdaemon/lib/postgresql-9.3-1102-jdbc41.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 8 -> /home/ig/test/igdaemon/lib/slf4j-log4j12-1.7.5.jar
lr-x------ 1 ig ig 64 Feb 20 18:09 9 -> /home/ig/test/igdaemon/lib/slf4j-api-1.7.5.jar
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic