Use JProfiler to monitor JBoss running status

Source: Internet
Author: User
Tags jprofiler

JProfiler is a well-known software used for monitoring and analysis of java systems. It has powerful functions and can monitor common java applications, applets, java web start, and application server. In addition to monitoring local programs, you can also monitor applications running on remote servers. This article takes JBoss as an example to briefly introduce the installation, configuration and use of JProfiler.

Let's talk about the environment:

Server: RedHat Linux 3.4.3-9. EL4 (kernel version 2.6.9-5. ELsmp), JBoss 4.0.3, Sun JDK 1.5.0 _ 08, JProfiler 4.3.2 for linux (installation package: jprofiler_linux_4_3_2.sh)
Client: Windows XP, JProfiler 4.3.2 for windows (installation package: jprofiler_windows_4_3_2.exe)
Install JProfiler on the client: simply run the installer. One thing is that during the installation process, norton once reported an alarm and ignored him. After the installation, no problems were found.
Install JProfiler on the server: Upload jprofiler_linux_4.3.2.sh to the server, assuming the path is/opt/jprofiler4 (later referred to as $ JPROFILER_HOME ). Run the following command:
# Cd/opt/jprofiler4 # chmod + x *. sh #./jprofiler_linux_4.3.2.sh-c
Follow the prompts to install the tool. The prompts are very simple. Select $ JPROFILER_HOME as the installation path. Note: Here-c means to install it in character mode. If there is no X on the machine, this parameter is added.

Server Configuration:

1. modify the system configuration, add the JProfiler library file in LD_LIBRARY_PATH to the path $ JPROFILER_HOME/bin/linux-x86, if it is a 64-bit server, select $ JPROFILER_HOME/bin/linux-x64.
2. Modify the JBoss STARTUP script and add the following parameters:
-Agentlib: jprofilerti = port = 8849-Xbootclasspath/a: $ JPROFILER_HOME/bin/agent. jar

For example:
$ JAVA_HOME/bin/java $ JAVA_OPTS-agentlib: jprofilerti = port = 8849-Xbootclasspath/a:/opt/jprofiler-4.3.2/bin/agent. jar-Djava. endorsed. dirs = "$ JBOSS_ENDORSED_DIRS"-Djava. library. path = $ JBOSS_HOME/server/default/lib-classpath "$ JBOSS_CLASSPATH" org. jboss. main-c default 1> $ JBOSS_CONSOLE 2> & 1 </dev/null &
8849 is the default port number.

3. Restart login linux and start jboss. Check $ JBOSS_HOME/server/default/log/server. log, we can see that JBoss is not started because the Startup Mode selected in the preceding configuration is only sent when a JProfiler GUI (jprofiler installed in Windows XP) Listening request is sent, JProfiler can really start the monitored application, that is, JBoss. In addition, there is a different startup mode, which can directly start the monitored application without waiting. This kind of configuration is a little troublesome. I will talk about it later.

Client configuration and use:

1. Run JProfiler. A wizard will be displayed when you open it for the first time and ignore it.
2. Select Session> Integration Wizard> New Remote Integratation.
3. Select On a remote computer; Platform of remote computer select Linux x86/AMD 64; Next
4. Enter the Server IP address; Next
5. Enter the installation path of jprofiler on the server, such as/opt/jprofiler4; next
6. Select the JDK environment of the server. Here is: Sun, 1.5.0, hotspot; next
7. Input Port: The default value is 8849. next
8. Select Start mode: select the first wait for a connection from the jprofiler GUI; next
9. The configurations to be configured on the server are listed here. We have done the previous step "server configuration. If you select the second Startup Mode Don't wiat and start immediately in step 1, the corresponding server configuration method will also be listed here. For more information, see. Next
10. Finish

The session is started. In the profiling settings dialog box, do not make any changes. OK. The session is started. Check the server and check that JBoss is started. Then we can see the running status of jboss on the client, such as memory usage.

I use jprofiler to monitor memory usage and check whether there is a member leak. Click "VM Telemetry Views" on the left to view the memory occupied by jboss.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.