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 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. When starting JBoss EAP, bind the management interface to the IP address that you will use to remotely monitor the server: 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. 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 ). 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. 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. To configure the remoting subsystem to use Elytron, execute the following commands: 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: If you want to connect to the JBoss EAP host controller JVM, also bind the management interface: 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. 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. 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. 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: Run the jconsole script in EAP_HOME /bin . 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 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 Click Connect . 2.2.2. Connecting to a Remote JBoss EAP JVM Using JConsole Prerequisites Configure JBoss EAP for remote monitoring connections . Download and extract a ZIP installation of JBoss EAP to your local machine. See the JBoss EAP Installation Guide for details. Run the jconsole script in EAP_HOME /bin . 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 Ensure that you provide the user name and password for the monitoring connection. 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: Open VisualVM, and find the Applications pane on the left side of the VisualVM window. 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 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 2.3.2. Connecting to a Remote JBoss EAP JVM Using VisualVM Prerequisites Configure JBoss EAP for remote monitoring connections . Download and extract a ZIP installation of JBoss EAP to your local machine. See the JBoss EAP Installation Guide for details. 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: In the File menu, select Add JMX Connection . 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 Click OK . 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.

Commands:
EAP_HOME /bin/standalone.sh -bmanagement= IP_ADDRESS
service:jmx:remote+http:// IP_ADDRESS :9990
/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)
EAP_HOME /bin/domain.sh -b= IP_ADDRESS
EAP_HOME /bin/domain.sh -bmanagement= IP_ADDRESS
service:jmx:remote:// IP_ADDRESS :4447
service:jmx:remote:// IP_ADDRESS :9990
visualvm -cp:a EAP_HOME /bin/client/jboss-cli-client.jar -J-Dmodule.path= EAP_HOME /modules