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
The Health Center agent libraries are included with the WebSphere Application Server Java SDK. However, Health Center 3.0 or later is required for WebSphere Commerce.
Procedure
WAS_installdir/java/bin/java -Xhealthcenter -version
The version is also displayed in the Health Center client.
To update the libraries, choose one of the following options:
- Option 1: Update the SDK component of WebSphere Application Server to Fix Pack 37 (7.0.0.37) or later. To check the 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.
- Option 2: Download the latest libraries that are included with the Health Center client. 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 on 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
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