IBM Sterling products unofficial blog

IBM Sterling B2B Integrator, IBM Sterling Filegateway, Performance, troubleshooting

How to enable JMX on IBM Sterling B2B Integrator and Monitor using VisualVM

Java Management Extensions (JMX) is a powerful Java technology that supplies tools for managing and monitoring Java applications. In this blog, I will explain how to enable JMX monitoring in IBM Sterling B2B Integrator and how to use Java VisualVM to monitor the application performance.

With VisualVM you can monitor the application memory consumption, the application threads and most importantly, profile the application performance and gather detailed data on method-level execution time and number of invocation.

Enable JMX monitoring in Sterling B2B Integrator:

  1. Stop the IBM Sterling B2B Integrator application server.
  2. Add JMX_PORT=anyfreeport e.g JMX_PORT=5555 to sandbox.cfg
  3. Run setupfiles.sh and start the application server.

The Jave arguments to enable JMX monitoring will be added to startNoAppNode.sh and startNoApp.sh used to start the application server.

Extract from the starting scripts:

startNoAppNode.sh:
JAVA_SERVER_ASI="${JAVA_SERVER_ASI} 
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=5555 
-Dcom.sun.management.jmxremote.authenticate=false"

startNoApp.sh:
JAVA_SERVER_ASI="${JAVA_SERVER_ASI} 
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.port=5555 
-Dcom.sun.management.jmxremote.authenticate=false"

You can verify the arguments are added to the application server process argument with ps -ef | grep -i noapp

You can check the JMX port is active with netstat.

Monitor your application with VisualVM:

VisualVM comes with the Oracle Java JDK or can be downloaded separately here.

First, you need to configure your application hostname or IP and port in visualVM:

VisualVM configuration

Once your connection is established, you will be able to monitor your JVM memory and threads, trigger garbage collection and take thread dumps. By default the profiling tool will not be running until you are ready to profile the application.

When you are ready to profile, for example start your load testing or investigate an application slowness, you need to go to the sampler tab to start the CPU profiling:

CPU profiling in the Sampler tab. Idle application.

Each system or implementation is different, I recommend to always keep a baseline profiling snapshot to compare with later. The profile is very intuitive so you will figure this out very quickly.

I share some profiler outputs from Sterling B2B Integrator to look at so you can have an idea about different scenarios or performance situations. I also share some comments and interpretation:

High Database, SSL handshakes and Connect:Direct activity.
WTX maps consuming CPU.
Excessive verbose log4j logging.

JMX monitoring is a very powerful tool that helps a lot in uncovering non obvious and hidden bottlenecks, benchmarking, comparing implementation and also improving performance throughput. When the logs, thread dumps, OS tools, DB tools cannot help you detect where your application time is spent over time, think about using JMX profiling.

2 Comments

  1. Sumanth

    Hi,

    Is there an open source tool to view and monitor B2B Integrator errors, description (map name, error detail) and fetch the file for the same.

  2. Lindsay McCurdy

    It is strongly recommended to secure the JMX console by implementing user authentication and to check the JDK version in order to mitigate threats

    https://mogwailabs.de/en/blog/2019/04/attacking-rmi-based-jmx-services/

    https://www.ibm.com/support/pages/apar/IV84027

Leave a Reply

We’ve detected that you’re using an ad blocker. Please disable it to support our website.