Over the years, a lot of tools have been created to troubleshoot performance issues on your systems, such as top
, sar
, iotop
, iostat
, iftop
, vmstat
, dstat
, and others. However, none of these integrate with each other, some are extensions to others, and so on.
PCP seems to have a couple of things right: it monitors just about every aspect of your system, it allows the centralized storage of (important) performance data, and it allows you to use not only live data, but also saved data among others.
In this recipe, we'll look at both the "default" setup and "collector" configuration, which allows you to pull in all the performance data you want.
This is the basic setup of PCP:
~]# yum install -y pcp
~]# systemctl enable pmcd ~]# systemctl enable pmlogger ~]# systemctl start pmcd ~]# systemctl start pmlogger
~]# firewall-cmd --add-service pmcd --permanent
Each host that is to act as a collector requires additional configuration. Here's how you can do this:
/etc/pcp/pmlogger/control
, as follows:<hostname> n n PCP_LOG_DIR/pmlogger/<hostname> -r -T24h10m -c config.<hostname>
Here, <hostname>
is the FDQN to this host. Take a look at the following example:
guest.example.com n n PCP_LOG_DIR/pmlogger/guest.example.com -r -T24h10m -c config.guest.example.com
pmlogger
daemon. Execute the following command line:~]# systemctl restart pmlogger
By default, PCP logs information every 60 seconds. If you want to increase this and want to gather performance statistics every 30 seconds, you need to change the line starting with LOCALHOSTNAME
and add -t 30s
at the end.
Modifying the statistics you gather is a bit more difficult. You can find the configuration for pmlogger
in /var/lib/pcp/config/pmlogconf/
. Every file in this directory contains information about which pointers to gather. The syntax is not very hard to understand, but it is complex to explain. The pmlogconf (1) man page contains everything you need to know.
If you want to visualize the data on a host, you need to install pcp-gui
, as follows:
~]# yum install -y pcp-gui dejavu-sans-fonts
This package comes with a tool called pmchart
, which allows you to create graphics with the data collected by PCP. The fonts are needed to properly display the characters.
For more information about PCP and its components, refer to their online manuals, which you can find at http://www.pcp.io/documentation.html.