Setting up IBM Health Center to collect performance data
IBM Health Center for Java is a low-overhead agent that collects Java configuration and performance data. The data that is collected includes CPU usage, native memory usage, method profiling, garbage collection, locks, threads, and more.
When the agent is configured in headless mode, it continuously collects performance data into
Health Center (.hcd) files. This data is valuable not only for performance
tuning, but it also serves as a performance flight recorder
for root cause analysis of
production incidents.
To set up Health Center in headless mode, complete these steps:
- Step 1. Updating the Health Center agent
- Step 2. Enabling the Health Center agent in headless mode
- Step 3: Implementing a script to archive Health Center files
You can analyze the Health Center data that is collected in headless mode by using the Health Center client (see Installing Health Center).
Step 1. Updating the Health Center agent
WebSphere Application Server V8.5 includes Health Center V3.0. You can optionally upgrade the Health Center libraries to obtain the latest fixes and improvements.
Procedure
-
Ensure that you have the Health Center agent version 3.0 or later installed. Use the following
command to verify the version of Health Center that is currently installed.
The version is also displayed in the Health Center client.WAS_installdir/java/bin/java -Xhealthcenter -version
- Optional:
Update Health Center to a more recent version by completing one of the following options:
Option Description Update fix pack Update the WebSphere Application Server fix pack, or the SDK fix pack component to the latest available version. To check your current fix pack and SDK levels, run the versionInfo command. To see only the SDK information, use the -maintenancePackages | grep SDK parameter. For more information, see versionInfo command for WebSphere Application Server. Update libraries only Update the Health Center libraries only. The Health Center client has more frequent release cycles than WebSphere Application Server. Therefore, the libraries that are provided with the Health Center client are typically more recent than the libraries that are provided with WebSphere Application Server. For more information about downloading the libraries from the client, see Installing Health Center.
Step 2. Enabling the Health Center agent in headless mode
Use the WebSphere Integrated Solutions console to update the server's generic JVM arguments that enable the agent in headless mode.
Procedure
- Open the WebSphere Integrated Solutions Console.
- Select Servers.
- Expand Server Type and then click WebSphere application servers.
- Click the name of your server.
- Expand Java and Process Management and then click Process Definition.
- Under the Additional Properties section, click Java Virtual Machine.
- Scroll down and locate the Generic JVM arguments field.
-
Add the following arguments in a single line:
-Xhealthcenter:level=headless -Dcom.ibm.java.diagnostics.healthcenter.headless.output.directory=${SERVER_LOG_ROOT}/healthcenter -Dcom.ibm.java.diagnostics.healthcenter.headless.run.duration=15 -Dcom.ibm.diagnostics.healthcenter.data.profiling=off -Dcom.ibm.java.diagnostics.healthcenter.allocation.threshold.low=10000000 -Dcom.ibm.java.diagnostics.healthcenter.stack.trace.depth=20 -Dcom.ibm.java.diagnostics.healthcenter.headless.files.to.keep=0
For more information, see Health Center Configuration Properties.
Step 3: Implementing a script to archive Health Center files
Health Center continuously creates healthcenter*.hcd files in the directory that is specified by the output.directory property at the interval that is set by the run.duration property. The default interval is 15 minutes. You must implement a script to archive older files.
With the recommended configuration, files are typically from 500 KB to 2 MB. A week's worth of data might use from 0.5 GB to 1.5 GB of disk space.
Procedure
The following Linux sample script archives .hcd files from yesterday and keeps the files for up to a week. Schedule the script to run daily, for example, as a Cron job.
#!/bin/sh
# Working directory
cd /opt/WebSphere/AppServer/profiles/demo/logs/server1/healthcenter/
# Back up files from yesterday
find healthcenter*.hcd -daystart -mtime +0 -exec zip -m healthcenter_`date -d yesterday +"m%d"`.zip {} +
# Delete backups older than a week
find healthcenter_*.zip -daystart -mtime +6 -delete