Setting up PCP – Performance Co-Pilot

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.

How to do it…

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.

The default installation

This is the basic setup of PCP:

  1. Let's install the necessary packages; run the following command:
    ~]# yum install -y pcp
    
  2. Now, enable and start the necessary daemons, as follows:
    ~]# systemctl enable pmcd
    ~]# systemctl enable pmlogger
    ~]# systemctl start pmcd
    ~]# systemctl start pmlogger
    
  3. If you want to have the system monitored by a central collector, execute the following:
    ~]# firewall-cmd --add-service pmcd --permanent
    

The central collector

Each host that is to act as a collector requires additional configuration. Here's how you can do this:

  1. Add a line per system to collect data from /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
  2. After adding a host in this way, you need to restart the pmlogger daemon. Execute the following command line:
    ~]# systemctl restart pmlogger
    

There's more…

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.

See also

For more information about PCP and its components, refer to their online manuals, which you can find at http://www.pcp.io/documentation.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset