How do I install Performance Co-Pilot (PCP) on my RHEL server to capture performance logs
Environment
- Red Hat Enterprise Linux (RHEL) 6, 7, 8, 9 and 10.
- Performance Co-Pilot (PCP)
Issue
- How do I install PCP on RHEL?
- How do I enable PCP logging to capture performance data
- How do I gather PCP performance logs to send to Red Hat for analysis
Resolution
A minimal base install is required in order to capture performance data using PCP. The GUI tools are not required, though they can also be installed if desired. For full details of the various PCP RPM packages, see What are all the Performance Co-Pilot (PCP) RPM packages in RHEL?
RHEL 7.4 and later (including RHEL 8, RHEL 9, RHEL 10):
Starting with RHEL 7.4, a new meta package named pcp-zeroconf is available, specifically targeting enterprise environments. Installing this package will pull in all required dependencies to set up, enable and start PCP services for capturing performance data (including per-process data). It also enables some optional PMDA agents, such as nfsclient, xfs-perdev and others. This is designed to be install and forget, i.e. zero configuration after installation. Just install it and capture your performance data (over whatever time period is needed) and then upload for off-site (or local) analysis. Note that because per-process data collection will be enabled, at least 10GB of free space on the /var filesystem on an on-going basis will be needed due to the additional data logging.
# yum install pcp-zeroconf
(pcp-zeroconf-4.3.2-3 or higher)
For further details on pcp-zeroconf, see Installing and using the pcp-zeroconf package
For RHEL 7.4 and above(including RHEL 8, RHEL 9, RHEL 10):
- Post installation of
pcp-zeroconf, check whetherpmloggerandpmcdservices are running or not.
# systemctl status pmcd
# systemctl status pmlogger
- If
pmloggerandpmcdservices are not running post installation ofpcp-zeroconf, these services should be started and enabled manually:
# systemctl enable pmcd
# systemctl enable pmlogger
# systemctl start pmcd
# systemctl start pmlogger
-
Once
pmloggerandpmcdservices are enabled and started, check whether pcp performance data is getting collected under/var/log/pcp/pmlogger/hostname/directory or not. -
This content is not included.Open a case with Red Hat support if any assistance is needed in pcp data collection.
RHEL 7 (prior to RHEL 7.4)
PCP is included in the base RHEL and Fedora distributions. A minimal installation requires just the pcp package (and its dependencies) to enable performance data logs to be collected for later analysis:
# yum install pcp
# systemctl enable pmcd
# systemctl enable pmlogger
# systemctl start pmcd
# systemctl start pmlogger
RHEL 6.6 or later
The core of PCP is included in the base RHEL6 distribution. (The rhel-6-server-rpms repository.) A minimal pcp installation is the pcp package (and dependencies); this enables performance data logging. More PCP tools (like pcp-gui) and domain tests can be found in the "Red Hat Enterprise Linux 6 Server - Optional" (rhel-6-server-optional-rpms) repository.
# yum install pcp
# /sbin/chkconfig pmcd on
# /sbin/chkconfig pmlogger on
# /sbin/service pmcd start
# /sbin/service pmlogger start
RHEL 6 (prior to RHEL 6.6)
The PCP packages from RHEL 6.6 or later (in the main RHEL Server channel) can be used on all versions of RHEL6, including all versions prior to RHEL 6.6. This is the preferred and supported method to install PCP on RHEL 6.
Alternatively, the PCP upstream project provide third-party packages which are not supported by Red Hat. Please refer to Content from pcp.io is not included.this link for details.
Change the default logging interval
The default logging (sampling) interval is 60 seconds. This interval was chosen as a balance between logging volume and the level of detail needed for long term monitoring. For storage related performance monitoring (in particular), you may want to increase the resolution of the data by sampling more frequently, for example every 10 seconds. To do that, edit /etc/pcp/pmlogger/control.d/local and append -t 10s to the line for LOCALHOSTNAME, and restart the pmlogger service (systemctl restart pmlogger or the equivalent service pmlogger restart command for RHEL 5/6). Note that on older versions of PCP, the file to edit is /etc/pcp/pmlogger/control. For further details see How can I change the default logging interval used by Performance Co-Pilot (PCP)?.
Firewall configuration
For local performance data collection, the firewall configuration does NOT need to be changed. However, to allow monitoring of the server by remote PCP clients, the firewall configuration needs to be changed as follows below. Note that there may be security implications of allowing remote access - PCP has authentication and access control features that should also be configured if necessary.
# firewall-cmd --permanent --zone=public --add-service=pmcd
# firewall-cmd --reload
To gather the performance data logs to attach to a Red Hat support case:
# tar czf /tmp/pcp-logs.tgz /var/log/pcp
Then upload /tmp/pcp-logs.tgz to the support case as an attachment. Recent versions of RHEL6 and RHEL7 have PCP archive log collection integrated with the SOS tool - this is available with sos-3.2-3 and later. On systems with this or later version of sos, just capturing a sosreport will include the PCP archives located below /var/log/pcp.
See Also
- Index of Performance Co-Pilot (PCP) articles, solutions, tutorials and white papers
- Content from pcp.io is not included.PCP Quick Reference Guide
- Introduction to storage performance analysis with PCP
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.