Application Monitoring with JConsole, VisualVM and AppDynamics Lite

image_pdfimage_print

What happens when mission critical Java applications slow down or keep crashing in production? The vast majority of IT Operations (Ops) today bury their heads in log files. Why? because thats what they’ve been doing since IBM invented the mainframe. Diving into the weeds feels good, everyone feels productive looking at log entries, hoping that one will eventually explain the unexplainable. IT Ops may also look at system and network metrics which tell them how server resource and network bandwidth is being consumed. Again, looking at lots of metrics feels good but what is causing those server and network metrics to change in the first place? Answer: the application.

IT Ops monitor the infrastructure that applications run on, but they lack visibility of how applications actually work and utilize the infrastructure. To get this visibility, Ops must monitor the application run-time. A quick way to get started is to use the free tools that come with the application run-time. In the case of Java applications, both JConsole and VisualVM ship with the standard SDK and have proved popular choices for monitoring Java applications. When we built AppDynamics Lite we felt their was a void of free application monitoring solutions for IT Ops, the market had plenty of tools aimed at developers but many were just too verbose and intrusive for IT Ops to use in production. If we take a look at how JConsole, VisualVM and AppDynamics Lite compare, we’ll see just how different free application monitoring solutions can be.

Monitoring with JConsole:

JConsole provides basic monitoring of the JVM run-time along with key resources such as CPU, memory and threads.  It consists of several tabs that summarize the health of JVM memory, threads, classes, virtual machine and MBeans which are exposed via the standard JMX console. JConsole can dynamically attach to any JVM and will collect data as long as the tool is open and connected to the JVM. It’s fairly good for inspecting the mechanics of a JVM at a high level so you can identify issues such as potential memory leaks, high thread concurrency and deadlock. The MBean viewer also allows the user to report hundreds of KPI metrics in real-time to check which JVM resources are being exhausted by the application. Unfortunately Oracle recommends that JConsole only be deployed in dev and test environments due to the overhead it can introduce on the application. The UI is both simple and easy to navigate but lacks application context with respect to the user requests and transactions that execute within the JVM. For example, if a user complains that their checkout transaction is slow, the JConsole user has no way of correlating or troubleshooting this activity.

Here are a few screenshots of JConsole in action:

Monitor JVM Resource Utilization

Trend memory heap usage over-time:

Monitor thread concurrency

Monitor MBeans in real-time

Monitoring with VisualVM:

VisualVM is also free and ships with the Java SDK. Its a bit like JConsole but with better lipstick and more advanced monitoring features. VisualVM takes application monitoring one level deeper than JConsole by allowing the user to analyze thread execution as well as the ability to profile CPU and memory usage of JVM requests, both of which are triggered manually by the user. VisualVM also has a nice tab showing memory pool and garbage collection activity to spot abnormal trends. From a usability perspective its perfect for a developer although I’m not sure how suitable it would be for IT Ops given the profiling features and data are fairly low level, verbose and provide little context of application requests or user transactions. Users with deep application knowledge could probably piece together which Java components related to user requests otherwise transactions are not immediately obvious to the user. Like JConsole overhead can be an issue in production when features like CPU and memory profiler are triggered by the user. It’s still a great tool for development and test use cases given it costs nothing.

Here are a few screenshots of VisualVM in action:

Monitor JVM Resource Utilization

Trigger CPU and Memory Profiling

View Memory Pools and Garbage Collection

Monitoring with AppDynamics Lite:

AppDynamics Lite is another free tool that takes a slightly different approach to application monitoring. It starts at a more high level and visualizes the monitored JVM, and its infrastructure interactions. Users get to see the top business transactions that flow through the JVM, creating a level of abstraction from just analyzing raw threads and JVM metrics. It’s a top down approach to monitoring as opposed to bottom up which means IT Ops and developers see the real business impact before they drill down and analyze data. From a slow business transaction the user can drill down into the actual code execution to pinpoint the exact class, method and interface which was responsible for the bottleneck. So instead of analyzing metrics holistically from different perspectives the user can troubleshoot using a business transaction as an anchor all the way down to the root cause. Lite also has real-time MBean trending and also comes with alerting capabilities so users can be pro-active to monitor application performance. The best bit of AppDynamics Lite is that it can run in production 24/7 so IT Ops don’t have to worry about overhead and issues can be resolved quickly.

Here are a few screenshots of AppDynamics Lite in action:

Monitor Application Flow and Business Transaction Health

Business Transaction volume, throughput, errors and SLA health

Drill Down on any Business Transaction to see its Code Execution Stack with timing

Monitor MBean & JMX metrics in real-time

Configure Alerts to pro-actively manage application performance

Here is a quick summary of how JConsole, VisualVM and AppDynamics Lite Compare:

Conclusion: 

JConsole, VisualVM and AppDynamics Lite are just a few examples of free application performance monitoring solutions on the market. They have common features but differ in how they monitor, collect and present data. The value of these tools therefore vary depending on the user, use case and environment they are intended for. Developers generally want a bottom up view with lots of data to analyze whilst IT Ops want a more structured top down approach so they can troubleshoot and maintain context without getting lost in the weeds. Overhead can also vary across toolsets so remember to take care when monitoring your application in production.

If you’re looking for a cheap and easy way to get started with application monitoring then you should check out these three solutions. They are completely free, easy to install and may give you the visibility you need to fix your application issues. AppDynamics also has a Pro Edition for organizations that require deeper visibility into their mission critical applications, again its free to trial for 30 days (which is how it should be). We really believe in try before you buy, we also believe that some organizations may not have immediate budget for application monitoring which is why we created AppDynamics Lite!

App Man.

Copyright © 2014 AppDynamics. All rights Reserved.