An option is available to speed up retrieval of Coherence MBean information (over JMX) by providing the aggregated MBean data in tabular form by using custom MBeans. By using custom MBeans the data is aggregated within the cluster and transmitted in the form of tabular data, rather than as individual attributes. This reduces the time taken to query the data.
This option is useful when monitoring large clusters (clusters with a large number of nodes, caches and/or services) using JMX, where the volume of data retrieved can affect the time taken to retrieve all the data, and thus limit the sampling rate for monitoring data.
Enabling this requires (unlike default JMX monitoring) that the custom MBeans (contained in a jar) are deployed and registered on all nodes in the cluster, and the monitoring is configured to query the custom MBeans.
The Oracle Coherence Documentation describes registering custom MBeans in a declarative manner in detail: https://docs.oracle.com/cd/E18686_01/coh.37/e18682/custom_mbeans.htm#COHMG4712.
To use this option:
Configure the monitored Coherence cluster to use JMX Tables custom MBeans. Add the ocjmxtables.jar to the classpath of the cluster members. And set -Dtangosol.coherence.mbeans=/sl-custom-mbeans.xml for the cluster members JVM's.
Configure your Monitoring system to use JMX Tables. Configure your monitoring system to use JMX as normal. And edit the rtview.properties file to use the maincollector.sl.rtview.cmd_line=-ocjmxtables property for the monitoring system.
Requirements:
The Custom MBeans must be found at run time. You must place the library that contains the MBeans in the classpath of the Coherence nodes/members, including the JMX management-enabled member.
The custom MBeans (contained in a jar) must be deployed and registered on all nodes in the cluster, and the monitoring configured to query the custom MBeans.
The Custom MBeans must be specified using a MBean Configuration Override File.
The Custom MBeans (CacheTable, ServiceTable, StorageManagerTable) are contained in the jar ocjmxtables.jar, located in the rtvapm/ocmon/lib directory of the Monitor installation. This jar file must added to the classpath of the Coherence members to be monitored. This may require that the jar be copied to a location that is visible to all the Coherence members. This may vary based on your deployment. It may prove convenient to copy it to where the Coherence jars are deployed, so they can use the same classpath root.
The tangosol.coherence.mbeans system property specifies an MBean configuration override file to be used instead of the default custom-mbeans.xml override file. The MBean configuration file to use is sl-custom-mbeans.xml, contained at the root of the ocjmxtables.jar. Thus when the ocjmxtables.jar is added to the Coherence members classpath, it can be specified by setting the tangosol.coherence.mbeans system property for the Coherence cluster members to reference it thus: -Dtangosol.coherence.mbeans=/sl-custom-mbeans.xml.
The above should be applied to all Coherence cluster members so that the tangosol.coherence.mbeans system property is set to /sl-custom-mbeans.xml.
If you have configured your Coherence cluster correctly, you should be able to connect to the cluster using JConsole, and see in addition to the previous Cache, Service, and StorageManager MBeans the new custom CacheTable, ServiceTable, and StorageManagerTable MBeans.
After you configure your Monitor system to use the Custom MBeans and configure your monitoring system to use JMX as normal, uncomment the following line in the rtview.properties file:
# JMX TABLES
#
# Uncomment the line below to use the JMX tables custom mbeans
#maincollector.sl.rtview.cmd_line=-ocjmxtables
This sets the -ocjmxtables command line argument to be passed to the maincollector program (typically this is the Data Server), and the log file will then contain the following text at startup:
... using OC JMX Tabular Data
And at runtime, the previous JMX queries (as seen in the JMX Metrics Administration display in the MBean Query Key column of the RTView JMX Query Statistics table):
* Coherence:type=Cache,* 0 * -1 *-
* Coherence:type=Cluster 0 * -1 *-
* Coherence:type=Service,* 0 * -1 *-
become the following:
* Coherence:type=CacheTable,* 0 CacheTable -1 *-
* Coherence:type=ServiceTable,* 0 ServiceTable -1 *-
* Coherence:type=StorageManagerTable,* 0 StorageManagerTable -1 *-
The JMX queries should also have a reduced execution time leading to a reduced total (JMX Query) Execution time.