Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 4. Metrics data retention
The storage capacity required by PCP data logging is determined by the following factors:
- The logged metrics
- The logging interval
- The retention policy
The default logging (sampling) interval is 60 seconds. The default retention policy is to compress archives older than one day and to keep archives for the last 14 days.
You can increase the logging interval or shorten the retention policy to save storage space. If you require high-resolution sampling, you can decrease the logging interval. In such case, ensure that you have enough storage space.
PCP archive logs are stored in the /var/log/pcp/pmlogger/satellite.example.com
directory.
4.1. Changing default logging interval
You can change the default logging interval to either increase or decrease the sampling rate, at which the PCP metrics are logged. A larger interval results in a lower sampling rate.
Procedure
-
Open the
/etc/pcp/pmlogger/control.d/local
configuration file. -
Locate the
LOCALHOSTNAME
line. -
Append
-t XXs
, where XX is the required time interval in seconds. - Save the file.
Restart the
pmlogger
service:# systemctl restart pmlogger
4.2. Changing data retention policy
You can change the data retention policy to control after how long the PCP data are archived and deleted.
Procedure
-
Open the
/etc/sysconfig/pmlogger_timers
file. -
Locate the
PMLOGGER_DAILY_PARAMS
line. - If the line is commented, uncomment the line.
Configure the following parameters:
-
Ensure the default
-E
parameter is present. -
Append the
-x
parameter and add a value for the required number of days after which data is archived. -
Append the
-k
parameter and add a value for the number of days after which data is deleted.
For example, the parameters
-x 4 -k 7
specify that data will be compressed after 4 days and deleted after 7 days.-
Ensure the default
- Save the file.
4.3. Viewing data storage statistics
You can list all available metrics, grouped by the frequency at which they are logged. For each group, you can also view the storage required to store the listed metrics, per day.
Example storage statistics:
logged every 60 sec: 61752 bytes or 84.80 Mbytes/day
Procedure
To view data storage statistics, enter the following command on your Satellite Server:
# less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log