Chapter 6. Monitoring performance with Performance Co-Pilot


Performance Co-Pilot (PCP) is a suite of tools, services, and libraries for monitoring, visualizing, storing, and analyzing system-level performance measurements. As a system administrator, you can monitor the system’s performance by using PCP in Red Hat Enterprise Linux.

6.1. Monitoring postfix with pmda-postfix

You can monitor performance metrics of the postfix mail server with pmda-postfix. It helps to check how many emails are received per second.

Prerequisites

Procedure

  1. Install the following packages:

    1. Install the pcp-system-tools:

      # dnf install pcp-system-tools
      Copy to Clipboard
    2. Install the pmda-postfix package to monitor postfix:

      # dnf install pcp-pmda-postfix postfix
      Copy to Clipboard
    3. Install the logging daemon:

      # dnf install rsyslog
      Copy to Clipboard
    4. Install the mail client for testing:

      # dnf install mutt
      Copy to Clipboard
  2. Enable the postfix and rsyslog services:

    # systemctl enable postfix rsyslog
    # systemctl restart postfix rsyslog
    Copy to Clipboard
  3. Enable the SELinux boolean, so that pmda-postfix can access the required log files:

    # setsebool -P pcp_read_generic_logs=on
    Copy to Clipboard
  4. Install the PMDA:

    # cd /var/lib/pcp/pmdas/postfix/
    # ./Install
    Updating the Performance Metrics Name Space (PMNS) ...
    Terminate PMDA if already installed ...
    Updating the PMCD control file, and notifying PMCD ...
    Waiting for pmcd to terminate ...
    Starting pmcd ...
    Check postfix metrics have appeared ... 7 metrics and 58 values
    Copy to Clipboard

Verification

  • Verify the pmda-postfix operation:

    echo testmail | mutt root
    Verify the available metrics:
    # pminfo postfix
    postfix.received
    postfix.sent
    postfix.queues.incoming
    postfix.queues.maildrop
    postfix.queues.hold
    postfix.queues.deferred
    postfix.queues.active
    Copy to Clipboard

6.2. Visually tracing PCP log archives with the PCP Charts application

After recording metric data, you can replay the PCP log archives as graphs. The metrics are sourced from one or more live hosts with alternative options to use metric data from PCP log archives as a source of historical data. To customize the PCP Charts application interface to display the data from the performance metrics, you can use line plot, bar graphs, or utilization graphs.

By using the PCP Charts application, you can:

  • Replay the data in the PCP Charts application application and use graphs to visualize the retrospective data alongside live data of the system.
  • Plot performance metric values into graphs.
  • Display multiple charts simultaneously.

Prerequisites

Procedure

  1. Launch the PCP Charts application from the command line:

    # pmchart
    Copy to Clipboard

    The pmtime server settings are located at the bottom. With start and pause buttons you can control:

    • The interval in which PCP polls the metric data
    • The date and time for the metrics of historical data
  2. Click File and then New Chart to select metric from both the local machine and remote machines by specifying their host name or address. Advanced configuration options include the ability to manually set the axis values for the chart, and to manually choose the color of the plots.
  3. Record the views created in the PCP Charts application:

    Following are the options to take images or record the views created in the PCP Charts application:

    • Click File and then Export to save an image of the current view.
    • Click Record and then Start to start a recording.
    • Click Record and then Stop to stop the recording. After stopping the recording, the recorded metrics are archived to be viewed later.
  4. Optional: In the PCP Charts application, the main configuration file, known as the view, allows the metadata associated with one or more charts to be saved. This metadata describes all chart aspects, including the metrics used and the chart columns.
  5. Optional: Save the custom view configuration by clicking File and then Save View, and load the view configuration later.

    The following example of the PCP Charts application view configuration file describes a stacking chart graph showing the total number of bytes read and written to the given XFS file system loop1:

    # pmchart
    version 1
    chart title "Filesystem Throughput /loop1" style stacking antialiasing off
        plot legend Read rate   metric xfs.read_bytes   instance  loop1
        plot legend Write rate  metric xfs.write_bytes  instance  loop1
    Copy to Clipboard

6.3. Collecting data from SQL server by using PCP

The SQL Server agent in PCP helps you monitor and analyze database performance issues. You can collect data for Microsoft SQL Server via PCP on your system.

Prerequisites

  • You have installed Microsoft SQL Server for Red Hat Enterprise Linux and established a trusted connection to an SQL server.
  • You have installed the Microsoft ODBC driver for SQL Server for Red Hat Enterprise Linux.

Procedure

  1. Install PCP:

    # dnf install pcp-zeroconf
    Copy to Clipboard
  2. Install packages required for the pyodbc driver:

    # dnf install gcc-c++ python3-devel unixODBC-devel
    # dnf install python3-pyodbc
    Copy to Clipboard
  3. Install the mssql agent:

    1. Install the Microsoft SQL Server domain agent for PCP:

      # dnf install pcp-pmda-mssql
      Copy to Clipboard
    2. Edit the /etc/pcp/mssql/mssql.conf file to configure the SQL server account’s username and password for the mssql agent. Ensure that the account you configure has access rights to performance data.

      username: user_name
      password: user_password
      Copy to Clipboard

      Replace user_name with the SQL Server account username and user_password with the SQL Server user password for this account.

  4. Install the agent:

    # cd /var/lib/pcp/pmdas/mssql
    # ./Install
    Updating the Performance Metrics Name Space (PMNS) ...
    Terminate PMDA if already installed ...
    Updating the PMCD control file, and notifying PMCD ...
    Check mssql metrics have appeared ... 168 metrics and 598 values
    [...]
    Copy to Clipboard

    Verification

    • Using the pcp command, verify if the SQL Server PMDA (mssql) is loaded and running:

      $ pcp
      Performance Co-Pilot configuration on rhel.local:
      platform: Linux rhel.local 4.18.0-167.el8.x86_64 #1 SMP Sun Dec 15 01:24:23 UTC 2019 x86_64
       hardware: 2 cpus, 1 disk, 1 node, 2770MB RAM
       timezone: PDT+7
       services: pmcd pmproxy
           pmcd: Version 5.0.2-1, 12 agents, 4 clients
           pmda: root pmcd proc pmproxy xfs linux nfsclient mmv kvm mssql
                 jbd2 dm
       pmlogger: primary logger: /var/log/pcp/pmlogger/rhel.local/20200326.16.31
          pmie: primary engine: /var/log/pcp/pmie/rhel.local/pmie.log
      Copy to Clipboard
    • View the complete list of metrics that PCP can collect from the SQL Server:

      # pminfo mssql
      Copy to Clipboard
    • After viewing the list of metrics, you can report the rate of transactions. For example, to report on the overall transaction count per second, over a five second time window:

      # pmval -t 1 -T 5 mssql.databases.transactions
      Copy to Clipboard
    • View the graphical chart of these metrics on your system by using the pmchart command. For more information, see Visually tracing PCP log archives with the PCP Charts application.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat