Red Hat Training

A Red Hat training course is available for RHEL 8

第 9 章 使用 PCP 对 XFS 的性能分析

XFS PMDA 作为 pcp 软件包的一部分提供,并在安装过程中默认启用。它用于在 Performance Co-Pilot (PCP) 中收集 XFS 文件系统的性能指标数据。

您可以使用 PCP 分析 XFS 文件系统的性能。

9.1. 手动安装 XFS PMDA

如果 pcp 配置输出中没有列出 XFS PMDA,请手动安装 PMDA 代理。

这个步骤描述了如何手动安装 PMDA 代理。

先决条件

步骤

  1. 进入 xfs 目录:

    # cd /var/lib/pcp/pmdas/xfs/
  2. 手动安装 XFS PMDA:

    xfs]# ./Install
    
    You will need to choose an appropriate configuration for install of
    the “xfs” Performance Metrics Domain Agent (PMDA).
    
      collector     collect performance statistics on this system
      monitor       allow this system to monitor local and/or remote systems
      both          collector and monitor configuration for this system
    
    Please enter c(ollector) or m(onitor) or (both) [b]
    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 xfs metrics have appeared ... 149 metrics and 149 values
  3. 通过输入 c 表示 collector 、输入 m 表示 monitor 或输入 b 表示两者,来选择想要的 PMDA 角色。PMDA 安装脚本提示您指定以下一个 PMDA 角色:

    • collector 角色允许在当前系统上收集性能指标
    • monitor 角色允许系统监控本地系统、远程系统或两者

      默认选项是 collectormonitor,它允许 XFS PMDA 在大多数情况下正常工作。

验证步骤

  • 验证 pmcd 进程是否在主机上运行,且在配置中列出 XFS PMDA:

    # pcp
    
    Performance Co-Pilot configuration on workstation:
    
    platform: Linux workstation 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64
    hardware: 12 cpus, 2 disks, 1 node, 36023MB RAM
    timezone: CEST-2
    services: pmcd
    pmcd: Version 4.3.0-1, 8 agents
    pmda: root pmcd proc xfs linux mmv kvm jbd2

其他资源