Is it possible to use pcp in order to collect nfs client related load statistics?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 6 and later
  • Performance Co-Pilot (PCP)
  • Network File System (NFS)

Issue

Performance Co-Pilot (PCP) by default collects some rpc and nfs load statistics, but these are not as detailed as what programs like nfsiostat collect. Is there a way to get similar information from PCP?

Resolution

It is possible to collect additional information related to nfs load using pcp, using the "pmdanfsclient" Performance Metrics Domain Agent (PMDA). This PMDA collects values from the /proc/self/mountstats interface. In versions before pcp-3.11.8-4.el7 the pmdanfsclient is not enabled by default and needs to be manually updated. In bugzilla 1371950 there is ongoing effort in order to have this PMDA enabled by default - this has now been resolved with the pcp-zeroconf package, see below.

If enabling the pmdanfsclient manually is required, the following steps can be followed:

  • Before anything else, pcp needs to be installed. If it is not installed, the steps in the following article: How do I install Performance Co-Pilot (PCP) on my RHEL server to capture performance logs

  • Note for RHEL7.4 or later, just install the pcp-zeroconf package with yum, see Installing and using the pcp-zeroconf package for Performance Co-Pilot. The pcp-zeroconf package also automatically installs and configures the nfsclient agent, and other relevant metrics and so no further steps are required.

  • When pcp is installed, the pmdanfsclient PMDA needs to be installed (if it is not already installed). It is provided by the pcp-pmda-nfsclient package. On a registered system this can be installed with:

      yum install pcp-pmda-nfsclient
    

    Note: In Red Hat Enterprise Linux 6 the pcp-pmda-nfsclient package is available in the repository rhel-6-server-optional-rpms. This repository will need to be enabled. In Red Hat Enterprise Linux 7 it can be found in the rhel-7-server-rpms repository

  • Once the pmdanfsclient is available, it is necessary to notify pmcd to use it. The PMDA provides an install script for this purpose:

      cd /var/lib/pcp/pmdas/nfsclient; ./Install
    

    Once pmcd starts using pmdanfsclient, the new metrics will appear in the output of pminfo. The names of the new metrics start with the string nfsclient.

  • In order to get pmlogger recording these metrics, editing the metrics configuration file of pmlogger (by default /var/lib/pcp/config/pmlogger/config.default) and adding the additional metrics to be recorded is necessary.

    Note: The file /var/lib/pcp/config/pmlogger/config.default may not exist if pmlogger has been just installed and never started before. In this case, the file can be auto-created by starting pmcd and then pmlogger (and stopping or restarting them in order to make and re-apply the changes)

    A list of all the metrics added by the nfsclient PMDA can be obtained with:

      pminfo | grep nfsclient
    

    In the metrics configuration file of pmlogger the new metrics can be added after the lines:

      # DO NOT UPDATE THE FILE ABOVE THIS LINE
      # Otherwise any changes may be lost the next time pmlogconf is
      # used on this file.
      #
      # It is safe to make additions from here on ...
      #
    

    The new metrics can be added in a section similar to the following:

      log advisory on default {
          ...
          nfslient.<metric_name>
          ...
      }
    

    Once the metrics configuration file of pmlogger is changed, pmlogger will need to be restarted to apply the changes.  For RHEL 7:

      systemctl restart pmlogger.service 
    

    For RHEL 6:

      service pmlogger restart
    
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.