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.

Advertisements
Posted in New Features | Tagged , | Leave a comment

Java SE 10 Released

Please see the following blog regarding the announcement of Java SE 10. This release is the first of the 6 month cadence releases.

https://blogs.oracle.com/java-platform-group/introducing-java-se-10

Posted in News, Uncategorized | Tagged , | Leave a comment

Presentation: Building a Serverless State Service for the Cloud using Java 9

Great presentation from one of my colleagues (the legendary Ed Burns) given a few months back. Ed has been talking about this at various tech conferences around the world.

Well worth a listen. See  YouTube link.

Enjoy

Posted in Presentations | Tagged , , | Leave a comment

Oracle releases the open source Oracle WebLogic Server Kubernetes Operator

Very cool.

RedStack

I am very happy to be able to announce that we have just released and open sourced the Oracle WebLogic Server Kubernetes Operator, which I have been working on with a great team of people for the last few months!

You can find the official announcement on the WebLogic Server blog and the code is on GitHub at https://github.com/oracle/weblogic-kubernetes-operator.  This initial release is a “Technology Preview” which we really hope people will be interested in playing with and giving feedback.  We have already had some great feedback from our small group of testers who have been playing with it for the last couple of weeks, and we are very, very appreciative for their input.  We have some great plans for the operator going forward.

View original post

Posted in Uncategorized | Leave a comment

WebLogic Server Certification on Kubernetes

Happy New Year!

While not strictly Coherence related, the below announcement it pretty exciting news for those running WebLogic as well as those running Coherence applications in WebLogic.

https://blogs.oracle.com/weblogicserver/weblogic-server-certification-on-kubernetes

 

 

Posted in News | Tagged , , , , | Leave a comment

Updated Coherence Plug-in with Java 9 Mission Control

Overview

With the official release of JDK 9, Java Mission Control (JMC) was also updated to 6.0.  Something that had bugged me for many years was that the old JMC included an “experimental” Coherence plug-in to view cache and service information (created in Coherence 3.6/3.7 days!).  This plug-in was very “experimental”, in fact unsupported, and didn’t really offer much value/ usability for monitoring Coherence clusters.

Being involved in the development of the JVisualVM plug-in, It was a good opportunity for me to work with the JMC Dev team to update this plug-in so that it was a) more reflective of the current Coherence features, b) was actually useful and c) contained similar features/functionality that is in the JVisualVM plug-in.

The outcome of this was a greatly enhanced (and supported) Coherence plug-in for JMC which meant that if you don’t use, or don’t have access to JVisualVM you can use JMC to monitor your Coherence clusters.

Note: this plug-in, as for the existing JVisualVM one, is for monitoring dev, test environments primarily.

Installation

If you have installed the GA version of JDK 9 installed, then all you need to do is run the jmc command which is the the bin directory of the JDK9 download.  For my environment, which is a Mac, its in:

/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin

Once you have JMC started, go to the Help Menu and choose Install New Software.  (If you are behind a proxy, then you may need to set your proxy in the preferences).

Expand the Console Plug-ins and select the Coherence Tab Pack.

jmc_install

Select Next, Next to continue and install the plug-in. Once you accept the licence agreement JMC will restart to complete the installation.

Monitoring a Cluster

Now startup a Coherence cluster to connect to, or you can use an existing one. I’m using Coherence 12.2.1.3.0 which is the most current version. After installing Coherence, change to the coherence/bin directory and run ./cache-server.sh in a couple of windows.

In the JVM Browser, expand one of the Coherence nodes and double click on the MBean Server link.  This will then open up the main JMC screen, as described below.

jmc_home

You should see a Coherence tab in the bottom right. Click this and the main Coherence Plug-in page is displayed.

jmc_cluster_home_v2

 

There are a number of sub-tabs displayed to show various aspects of a running Coherence Cluster:

  • Cluster Overview – Various metrics regarding overall cluster health
  • Machines – Information about the machines that make up the cluster, including cores, load and memory pressure
  • Members – Member information including individual members and various detail about each one
  • Services – Information regarding running services including StatusHA, partitions, and various other performance metrics
  • Caches – Lists the individual caches and their size, memory footprint and individual node details
  • Proxy Servers – Shows proxy servers and connections
  • Persistence – Information about active or on-demand persistence (Introduced in 12.2.1)

Each of the tables in the tabs have various right-click options which and context sensitive for the type of object you are viewing. E.g. Partition statistics for Services.

The plug-in will connect and display information for Coherence version 12.1.2 and above.

If you don’t have any data in your cluster, run ./coherence.sh from another and insert some data. For my environment i creates 4 caches. A number of the screens are displayed below.

 

Conclusion

As well as all the cool features that Mission Control gives you (See https://docs.oracle.com/javacomponents/index.html for full details), the new Coherence Plug-in provides a quick way of getting insight into your dev/test Coherence cluster.

Enjoy

Note: The JMC Coherence Plug-in contains a subset of the full functionality included Coherence JVisualVM plug-in.

 

Posted in Examples, New Features | Tagged , , , , , | Leave a comment

Java One KeyNote

Hi all.

Been busy watching a few video’s from Oracle Open World and Java One. Especially interesting is the Java One Key note available below:

Watch full-length keynote (1:33:22)

Plenty more coming at On Demand Videos link.

Enjoy

Posted in News | Tagged , , , | Leave a comment