Chapter 2. Monitoring Performance

You can monitor JBoss EAP performance using any tool that can examine JVMs running on your machine. Red Hat recommends that you use either JConsole, for which JBoss EAP includes a preconfigured wrapper script, or Java VisualVM. Both these tools provide basic monitoring of JVM processes, including memory usage, thread utilization, loaded classes, and other JVM metrics.

If you will be running one of these tools locally on the same machine that JBoss EAP is running on, then no configuration is necessary. However, if you will be running one of these tools to monitor JBoss EAP running on a remote machine, then some configuration is required for JBoss EAP to accept remote JMX connections.

2.1. Configuring JBoss EAP for Remote Monitoring Connections

For a Standalone Server

  1. Ensure that you have created a management user. You might want to create a separate management user to monitor your JBoss EAP server. See the JBoss EAP Configuration Guide for details.
  2. When starting JBoss EAP, bind the management interface to the IP address that you will use to remotely monitor the server:

    $ EAP_HOME/bin/standalone.sh -bmanagement=IP_ADDRESS
    Warning

    This exposes all the JBoss EAP management interfaces, including the management console and management CLI, to the specified network. Ensure that you only bind the management interface to a private network.

  3. Use the following URI with your management user name and password in your JVM monitoring tool to connect to the JBoss EAP server. The URI below uses the default management port (9990).

    service:jmx:remote+http://IP_ADDRESS:9990

For a Managed Domain Host

Using the above procedure of binding the management interface on a managed domain host will only expose the host controller JVM for remote monitoring, and not the individual JBoss EAP servers running on that host.

To configure JBoss EAP to remotely monitor individual servers on a managed domain host, follow the procedure below.

  1. Create a new user in the ApplicationRealm that you will use to connect to the JBoss EAP servers for remote monitoring. See the JBoss EAP Configuration Guide for details.
  2. To configure the remoting subsystem to use Elytron, execute the following commands:

    /profile=full/subsystem=jmx/remoting-connector=jmx:add(use-management-endpoint=false)
    /socket-binding-group=full-sockets/socket-binding=remoting:add(port=4447)
    /profile=full/subsystem=remoting/connector=remoting-connector:add(socket-binding=remoting,sasl-authentication-factory=application-sasl-authentication)
  3. When starting your JBoss EAP managed domain host, bind one or both of the following interfaces to an IP address that you will use for monitoring.

    • If you want to connect to individual JBoss EAP server JVMs running on your managed domain host, bind the public interface:

      $ EAP_HOME/bin/domain.sh -b=IP_ADDRESS
    • If you want to connect to the JBoss EAP host controller JVM, also bind the management interface:

      $ EAP_HOME/bin/domain.sh -bmanagement=IP_ADDRESS
      Warning

      This exposes all the JBoss EAP management interfaces, including the management console and management CLI, to the specified network. Ensure that you only bind the management interface to a private network.

  4. Use the following details in your JVM monitoring tool:

    • To connect to individual JBoss EAP server JVMs running on your managed domain host, use the following URI with your ApplicationRealm user name and password that was created earlier.

      service:jmx:remote://IP_ADDRESS:4447

      To connect to different JBoss EAP servers on a single host, add the respective server’s port offset value to the above port number.

    • To connect to the JBoss EAP host controller JVM, use the following URI with a management user name and password.

      service:jmx:remote://IP_ADDRESS:9990

2.2. JConsole

A preconfigured JConsole wrapper script is bundled with JBoss EAP. Using this wrapper script ensures that all the required libraries are added to the class path, and also provides access to the JBoss EAP management CLI from within JConsole.

2.2.1. Connecting to a Local JBoss EAP JVM Using JConsole

To connect to a JBoss EAP JVM running on the same machine as JConsole:

  1. Run the jconsole script in EAP_HOME/bin.
  2. Under Local Process, select the JBoss EAP JVM process that to want to monitor.

    • For a standalone JBoss EAP server, there is one JBoss EAP JVM process.

      Figure 2.1. JConsole Local Standalone JBoss EAP Server JVM

      jconsole local standalone
    • A JBoss EAP managed domain host has multiple JVM processes you can connect to: a host controller JVM process, a process controller JVM process, and a JVM process for each JBoss EAP server on the host. You can determine which JVM you have connected to by looking at the JVM arguments.

      Figure 2.2. JConsole Local Managed Domain JBoss EAP JVMs

      jconsole local domain
  3. Click Connect.

2.2.2. Connecting to a Remote JBoss EAP JVM Using JConsole

Prerequisites

  1. Run the jconsole script in EAP_HOME/bin.
  2. Under Remote Process, insert the URI for the remote JBoss EAP JVM process that to want to monitor.

    See the instructions on configuring JBoss EAP for remote monitoring connections for the URI to use.

    Figure 2.3. JConsole Remote JBoss EAP JVM

    jconsole remote
  3. Ensure that you provide the user name and password for the monitoring connection.
  4. Click Connect.

2.3. Java VisualVM

Java VisualVM is included with the Oracle JDK, and is located at JAVA_HOME/bin/jvisualvm. If you are not using the Oracle JDK, VisualVM is also available for download from the VisualVM website. Note that VisualVM does not work with the IBM JDK.

The following sections provide instructions for using VisualVM to connect to a local or remote JBoss EAP JVM. See the VisualVM documentation for other information on using VisualVM.

2.3.1. Connecting to a Local JBoss EAP JVM Using VisualVM

To connect to a JBoss EAP JVM running on the same machine as VisualVM:

  1. Open VisualVM, and find the Applications pane on the left side of the VisualVM window.
  2. Under Local, double-click the JBoss EAP JVM process that you want to monitor.

    • For a standalone JBoss EAP server, there is one JBoss EAP JVM process.

      Figure 2.4. VisualVM Local Standalone JBoss EAP Server JVM

      visualvm local standalone
    • A JBoss EAP managed domain host has multiple JVM processes you can connect to: a host controller JVM process, a process controller JVM process, and a JVM process for each JBoss EAP server on the host. You can determine which JVM you have connected to by looking at the JVM arguments.

      Figure 2.5. VisualVM Local Managed Domain JBoss EAP JVMs

      visualvm local domain

2.3.2. Connecting to a Remote JBoss EAP JVM Using VisualVM

Prerequisites

  1. You must add the required JBoss EAP libraries to your class path to remotely monitor a JBoss EAP JVM. Start VisualVM with the arguments for required libraries on your local machine. For example:

    $ visualvm -cp:a EAP_HOME/bin/client/jboss-cli-client.jar  -J-Dmodule.path=EAP_HOME/modules
  2. In the File menu, select Add JMX Connection.
  3. Complete the details for your remote JBoss EAP JVM:

    • In the Connection field, insert the URI for the remote JBoss EAP JVM process that to want to monitor. See the instructions on configuring JBoss EAP for remote monitoring connections for the URI to use.
    • Select the Use security credentials check box, and enter the user name and password for the monitoring connection.
    • If you are not using an SSL connection, select the Do not require SSL connection check box.

    Figure 2.6. VisualVM Remote JBoss EAP JVM

    visualvm remote
  4. Click OK.
  5. In the Applications pane on the left side of the VisualVM window, double-click on the JMX item under the remote host to open the monitoring connection.