Chapter 6. Metrics Data Retention
The storage capacity required by PCP data logging is determined by the following factors:
- the metrics being logged,
- the logging interval,
- and the retention policy.
The default logging (sampling) interval is 60 seconds.
The default retention policy is to keep archives for the last 14 days, compressing archives older than one day. PCP archive logs are stored in the /var/log/pcp/pmlogger/hostname directory.
6.1. Changing Default Logging Interval
This procedure describes how to change the default logging interval.
Procedure
-
Edit the
/etc/pcp/pmlogger/control.d/localconfiguration file. -
Edit the LOCALHOSTNAME line and append
-t XXs, where XX is the desired time interval, measured in seconds. -
Restart the
pmloggerservice.
6.2. Changing Data Retention Policy
This procedure describes how to change the data retention policy.
Procedure
-
Edit the
/etc/cron.d/pcp-pmloggerfile. -
Find the line containing
pmlogger_daily. -
Change the value for parameter
-xto the desired number of days after which data is archived. Add parameter
-k, and add a value for the number of days after which data is deleted.For example, the parameters
-x 4 -k 7specify that data will be compressed after 4 days, and deleted after 7 days.
6.3. Confirming Data Storage Usage
To confirm data storage usage, enter the following command:
# less /var/log/pcp/pmlogger/$(hostname)/pmlogger.log
This lists all available metrics, grouped by the frequency at which they are logged. For each group it also lists the storage required to store the listed metrics, per day.
Example storage statistics
logged every 60 sec: 61752 bytes or 84.80 Mbytes/day

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.