Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do you monitor with JMX in your production Java application?

This question is not about how JMX works or what JMX does. This question is about applications of JMX in a standard application server environment in production. It is not for specific server either.

What do you monitor with JMX in production environment that runs standard stack of Java EE services: database access (JDBC and JPA), session EJBs, JMS, web server, web services, AJAX-enabled services?

like image 833
topchef Avatar asked Nov 05 '09 15:11

topchef


People also ask

What is JMX monitoring Java?

 The Java Management Extensions (JMX) framework is a well-known tool for any experienced Java developer. The purpose of the JMX framework is to simplify the management of local and remote Java applications while providing a user-friendly interface.

What is Java JMX used for?

Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (such as printers) and service-oriented networks. Those resources are represented by objects called MBeans (for Managed Bean).

Why you would want to use a JMX monitoring tool?

JMX Monitoring to Improve the Performance of Java Applications. Easily monitor JVMs and Java web application servers with the eG Enterprise JMX monitoring solution. Improve the performance of your applications by identifying bottlenecks at the code-level and in the infrastructure.


2 Answers

At the JVM level, I monitor the garbage collection duration per minute,

At the Servlet Container level, I monitor the number of requests, number of exceptions (4xx & 5xx codes) , sum of request duration per minute,

At the SOAP level, I monitor the number of invocations, number of exceptions & sum of invocations per operation and per minute,

At the Web MVC Framework level, I monitor the number of invocations, number of exceptions & sum of invocations per action and per minute,

For the pools (datasource,thread pool / executor service), I monitor the active count,

For the JMS connections, I monitor the number of sent & received messages per minute, and the number of active receivers,

For EhCache, I monitor the number of entries in the cache, the number of hits & miss per minute,

At the business application level, I developped an @Profiled annotation to monitor the number of invocations, number of exceptions and total duration per minute.

If you are interested in such kind of metrics, we developed many JMX extras (dbcp, util.concurrent, jms, @profiled annotation) and packaged all this with Spring XML namespace based configuration, Hyperic HQ plugins, monitoring jsp pages, etc

The details are here : http://code.google.com/p/xebia-france/wiki/XebiaManagementExtras .

All this code is licensed under the business friendly Open Source Apache Software License 2, deployed on Maven Central Repository, downloadable as a jar and available on a Google Code Subversion server to be integrated the way you want.

Hope this helps,

Cyrille (Xebia)

like image 153
Cyrille Le Clerc Avatar answered Sep 19 '22 20:09

Cyrille Le Clerc


I've used JMX to expose an MBean that will allow the adjusting of the Log4J Logger levels dynamically. This proved to be very useful for a clustered application where we did not want to have to modify the log4j configuration file on all nodes to change the log level for a specified logger.

like image 39
Rob Smith Avatar answered Sep 20 '22 20:09

Rob Smith