Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (e. g. printers) and service oriented networks. Those resources are represented by objects called MBeans (for Managed Bean). In the API, classes can be dynamically loaded and instantiated. Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit. (CC Wikipedia)
Many application servers activate JMX by default. Below are the parameters that need to be set for manual activation of JMX:
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
// if local only JMX access is allowed set this to true
-Dcom.sun.management.jmxremote.local.only=false
This activates JMX remote port 9010.
The Appway server property nm.jmx.enabled=true activates Appway's internal JMX MBeans. Changes to that property require a restart of the application.
There are many JVM and Appway MBeans available. The following is a list of values which are commonly used for monitoring.
JVM
- Heap Memory Usage — Constant high-load garbage collection hints at performance problems.
- CPU Usage — A long period of 100% CPU usage hints at performance problems.
java.lang.Threading#findDeadlockedThreads() — If this is not equal to null, then there are deadlocked threads in the system.
Appway
Monitoring Tools:
- JConsole, a part of the Java JDK, is a desktop application which allows the user to monitor JMX beans
- IBM Tivoli, Nagios professional monitoring tools
- Open Source JMX Tools
- VisualVM, JProfiler (non-free), YourKit (non-free): These tools allow you to inspect the virtual machine state, which is great for debugging.