Tips and Tricks using Coherence JVisualVM Plug-in

Happy new year to all.

Thought I’d start off this year with a post about some tips and tricks in using the Coherence JVisualVM plug-in, which has been available with Coherence installations since 12.1.3.

There are a number of properties you can pass to the JVisualVM plugin to tweak the behaviour (Most are undocumented) and so I will discuss each of these below as well as including some nice features you may not be aware of as well.

Setting the Refresh Time

By default, when you start JVisualVM and connect to a Coherence cluster, the information in the plugin is only refreshed every 30 seconds. (This is separate from the polling interval which is set in JVisualVM preferences, which controls how often the UI is updated.)

This default is set reasonably high so that you are limiting the number JMX Management requests to the cluster which can adversely affect performance in large clusters.  If you want to change this to 5 seconds for your development work, you do this by setting the following:

visualvm -J-Dcoherence.jvisualvm.refreshtime=5

Note: The -J option passes the System property following it to JVisualVM.

Enabling the Experimental Cache Heat Map

By setting the following System property, you will be able to right-click on the caches in the Cache Tab and you will see a menu from which you can choose to display a Size or Memory heat map. These are both shown below.

-J-Dcoherence.jvisualvm.heatmap.enabled=true
Size Heat Map
Cache Size Heat Map
Memory Heat Map
Memory Heat Map

Enabling Zooming For Graphs

By default, JVisualVM displays graphs without the ability to zoom on the time scale, as per the following:

By setting the following System property, JVisualVM will enable zooming on every graph that is displayed.

-J-Dcoherence.jvisualvm.zoom.enabled=true

When this is enabled, each graph has three buttons on the right. The top toggles between zoom and no-zoom mode and the other two zoom in and out. This can be useful when you have the plug-in open for a while and want to zoom into a target time.

Changing Snapshot List View

When you are using the Persistence tab and want to remove or archive snapshots, the list of snapshots are displayed in a dropdown when you right-click and choose the operation.

Snapshot List

This can be unwieldy when there are a large number of snapshots present. Using the following System property you can disable the drop-down feature and enter the snapshot manually.

-J-Dcoherence.jvisualvm.persistence.list=false

Saving Table Data

For every table that displays data, you can export this as CSV via right-clicking on the table and choosing Save data as…

Show Table Detail

Many tables also support showing table detail via right-clicking and choosing Show Details. For example in the Members Tab you can do this to show the full JMX details of the node, as is shown below:

Show Table Detail

Getting a Thread Dump of Any Node

In the above screen shot of the Members Tab, you can see there is a Report node state operation. This allows you to select any node in the cluster and get a Thread Dump directly from the plug-in.

Report Node State

Viewing Snapshot Operation Times

When running any Persistence operation from the Persistence Tab, there is a sub-tab called Notifications which allows you to monitor the status and duration of requests.

For example, if i right-click on a Service and choose Create Snapshot, then after the operation has completed, the details are showing in the Notifications Tab.

The following screen shot shows the notifications after creating and recovering a snapshot.

Logging JMX Query Times

If you are concerned about the potential impact of running the Coherence Plug-in you can set the following System property to log the time it takes the plug-in to assemble the JMX data in the JVisualVM log.

-J-Dcoherence.jvisualvm.log.query.times=true

To view the log file use About VisualVM menu option and click on Logfile button. You should see output similar to the following which outlines each type of query.

INFO [VisualVMModel]: Time to query statistics for CACHE was 5 ms

INFO [VisualVMModel]: Time to query statistics for CACHE_DETAIL was 6 ms

INFO [VisualVMModel]: Time to query statistics for CACHE_FRONT_DETAIL was 7 ms

INFO [VisualVMModel]: Time to query statistics for CACHE_STORAGE_MANAGER was 5 ms

INFO [VisualVMModel]: Time to query statistics for MEMBER was 9 ms

INFO [VisualVMModel]: Time to query statistics for MACHINE was 3 ms

INFO [VisualVMModel]: Time to query statistics for PROXY was 9 ms

INFO [VisualVMModel]: Time to query statistics for PERSISTENCE was 9 ms

Conclusion

Hope this overview gives you a few tips and tricks when using the Coherence JVisualVM plug-in.

This entry was posted in New Features and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s