4 Working With Performance Co-Pilot
WARNING:
Oracle Linux 7 is now in Extended Support. See Oracle Linux Extended Support and Oracle Open Source Support Policies for more information.
Migrate applications and data to Oracle Linux 8 or Oracle Linux 9 as soon as possible.
This chapter describes how to install and configure Performance Co-Pilot (PCP) so that you can analyze system performance across one or more Oracle Linux installations.
About PCP
PCP collects operating system and network metrics that you can use to diagnose performance issues. PCP provides a monitor host that you can use to send requests for metrics and logs to a pair of collector host services that are installed on each Oracle Linux system that you monitor.
Installing PCP
-
Enable the
ol7_latest
andol7_addons
yum repositories on your system.For more information, see Oracle Linux 7: Managing Software.
-
Install the
pcp-oracle-conf
,pcp-system-tools
andpcp-gui
packages by using the yum command:sudo yum install pcp-oracle-conf pcp-system-tools pcp-gui
-
Enable and start the Performance Metrics Collector Daemon (
pmcd
) and Performance Metrics Logger (pmlogger
) collector host services:sudo systemctl enable --now pmcd pmlogger
Stopping PCP
To temporarily halt data collection, stop the Performance Metrics Collector Daemon
(pmcd
) and Performance Metrics Logger
(pmlogger
) collector host services:
sudo systemctl stop pmcd pmlogger
To halt data collection for an indefinite period and ensure that that they don't start again automatically when the system boots, fully disable them:
sudo systemctl disable --now pmcd pmlogger
For more information about masking and unmasking services to prevent scripts from restarting disabled system services, see Oracle Linux 7: Managing Core System Configuration.
Reviewing Information Gathered by PCP
If the pcp-oracle-conf
package is installed then the only metrics collected
by the pmlogger
service are those listed in the
/var/lib/pcp/config/pmlogger/config.ora
configuration file.
If PCP has been installed without the pcp-oracle-conf
package, review the
/var/lib/pcp/config/pmlogger/config.default
configuration file instead.
You can modify the frequency with which those metrics are collected in the same configuration file. For example, to increase the frequency from once every minute to once every 5 seconds:
... # It is safe to make additions from here on ... # log mandatory on every 5 seconds { filesys.free filesys.used ... }
All of the archives that the pmlogger
service
generates are stored in the
/var/log/pcp/pmlogger/hostname
directory. For more information, see the
pmlogconf(1)
manual page.
To verify the PCP configuration at the time that
pmlogger
collected specific performance
metrics, use the pcp
command:
sudo pcp -a 20220321.0.xz
Using PCP Monitor Host to Analyze Performance Metrics
All of the archives that the pmlogger
service
generates are stored in the
/var/log/pcp/pmlogger/hostname
directory. If you navigate to that directory in a terminal, you
can run a number of commands to review the performance metrics
that have been collected.
For more information about those commands and their parameters, see their respective manual pages.
Review Live Performance Metrics in Real Time
To monitor all the outgoing metrics from the eth0
network interface in real
time, use the pmrep
command:
sudo pmrep -i eth0 -v network.interface.out
To monitor live hard drive operations for each partition with a two second interval, use the
pmval
command:
sudo pmval -t 2sec -f 3 disk.partitions.write
Review Recorded Performance Metrics
To review the data for specific performance metrics within a specified timespan, use the
pmdumptext
command. For example, to review resource usage metrics for CPU
load, memory utilisation and disk write operations between 13:00 and 14:00 on a specific date:
sudo pmdumptext -Xlimu -t 10m -S @13:00 -T @14:00 \ 'kernel.all.load[1]' 'mem.util.used' 'disk.partitions.write' -a 20220321.0.xz
You can also use the pmstat
to review system performance metrics in a
format similar to that produced by the sar
command. For example, to review
performance metrics averaged over 10 minute interval between 09:00 and 10:00 on a specific
date:
sudo pmstat -t 10m -S @09:00 -T @10:00 -a 20220321.0.xz
You can also compare the metrics between two time periods by using the
pmdiff
command. For example, to compare the metrics between 02:00 and 03:00
on one day to the metrics between 09:00 and 10:00 on a different day:
sudo pmdiff -S @02:00 -T @03:00 -B @09:00 -E @10:00 20220321.0.xz 20220320.0.xz
Review Details About Recorded Performance Metrics
To review detailed information about a specific metric, use the pminfo
command. For example, to review details about free memory:
sudo pminfo -df mem.freemem -a 20220321.0.xz
Validate System Status When Performance Metrics Were Captured
To verify the host, timezone and time period that an archive containing performance metrics
contains, use the pmdumplog
command:
sudo pmdumplog -L 20220321.0.xz
To review a list of every enabled performance metric, use the pminfo
command:
sudo pminfo -a 20220321.0.xz