Performance Co-Pilot (PCP) is a robust framework for collecting, monitoring, and analyzing system performance metrics. Available in the repos for Fedora and RHEL, it allows administrators to gather a wide array of data with minimal configuration. This guide walks you through tuning PCPâs pmlogger service to better fit your needsâwhether you’re debugging performance issues or running on constrained hardware.
Is the default setup of PCP right for your use case? Often, itâs not. While PCPâs defaults strike a balance between data granularity and overhead, production workloads vary widely. Later in this article, two scenarios will be used to demonstrate some useful configurations.
â Prerequisites: Getting PCP up and running
First, install the PCP packages:
$ sudo dnf install pcp pcp-system-tools
Then enable and start the core services:
$ sudo systemctl enable --now pmcd.service $ sudo systemctl enable --now pmlogger.service
Verify both services are running:
$ systemctl status pmcd pmlogger
đ Understanding pmlogger and its configuration
PCP consists of two main components:
- pmcd: collects live performance metrics from various agents.
- pmlogger: archives these metrics over time for analysis.
The behavior of pmlogger is controlled by files in /etc/pcp/pmlogger/control.d/. The most relevant is local, which contains command-line options for how logging should behave.
Sample configuration:
$ cat /etc/pcp/pmlogger/control.d/local
Youâll see a line like:
localhost y y /usr/bin/pmlogger -h localhost ... -t 10s -m note
The -t 10s flag defines the logging intervalâevery 10 seconds in this case.
đ§ Scenario 1: High-frequency monitoring for deep analysis
Use case: Debugging a transient issue on a production server.
Goal: Change the logging interval from 10 seconds to 1 second.
Edit the file (nano editor used in the examples, please use your editor of choice):
$ sudo nano /etc/pcp/pmlogger/control.d/local
Change -t 10s to -t 1s.
Restart the logger:
$ sudo systemctl restart pmlogger.service
Verify:
$ ps aux | grep '[p]mlogger -h localhost' $ pminfo -f
Expected output snippet:
records: 10, interval: 0:00:01.000
đȘ¶ Scenario 2: Lightweight monitoring for constrained systems
Use case: Monitoring on a small VM or IoT device.
Goal: Change the logging interval to once every 60 seconds.
Edit the same file:
$ sudo nano /etc/pcp/pmlogger/control.d/local
Change -t 10s to -t 60s.
Restart the logger:
$ sudo systemctl restart pmlogger.service
Confirm:
$ ps aux | grep '[p]mlogger -h localhost' $ pminfo -f
Expected output:
records: 3, interval: 0:01:00.000
đ§č Managing data retention: logs, size, and cleanup
PCP archives are rotated daily by a cron-like service. Configuration lives in:
$ cat /etc/sysconfig/pmlogger
Default values:
PCP_MAX_LOG_SIZE=100 PCP_MAX_LOG_VERSIONS=14
- PCP_MAX_LOG_SIZE: total archive size (in MB).
- PCP_MAX_LOG_VERSIONS: number of daily logs to keep.
Goal: Keep logs for 30 days.
Edit the file:
$ sudo nano /etc/sysconfig/pmlogger
Change:
PCP_MAX_LOG_VERSIONS=30
No service restart is required. Changes apply during the next cleanup cycle.
đ Final thoughts
PCP is a flexible powerhouse. With just a few changes, you can transform it from a general-purpose monitor into a specialized tool tailored to your workload. Whether you need precision diagnostics or long-term resource tracking, tuning pmlogger gives you control and confidence.
So go aheadâopen that config file and start customizing your system’s performance story.
Note: This article is dedicated to my wife, Rupali Suraj Patil, who inspires me every day.
Nilesh
I am looking for reading, analysing and interpret the collected output.
Pete
I have a RHEL 9.6 system and a Fedora 42 system, both with pcp installed. Neither have the line in /etc/pcp/control.d/local that you refer to which means folks can’t continue to follow along with your article after that point.
host: control.d]$ cat /etc/redhat-release && tail -n 1 local
Red Hat Enterprise Linux release 9.6 (Plow)
LOCALHOSTNAME y n PCP_ARCHIVE_DIR/LOCALHOSTNAME -r -T24h10m -c config.default -v 100Mb
[laptop: control.d]$ cat /etc/redhat-release && tail -n 1 local
Fedora release 42 (Adams)
LOCALHOSTNAME y n PCP_ARCHIVE_DIR/LOCALHOSTNAME -r -T24h10m -c config.default -v 100Mb
Oscar
I would like to know why pmlogger should be used instead any current TSDB solution (while using pmcd as data recollector). Thanks!
jason
now im getting warnings everytime i boot up and now there constant