RHEL 10 tuned + PCP:profile 切换与 pmstat/pmval 观测
tuned 负责“把系统调到某个性能/功耗档位”,PCP 负责“把当时的指标留下来”。只切 profile 不留基线,出了问题无法证明改动有效;只采指标不标 profile,数据也解释不了。
在 PVE 390 rhel10-lab(RHEL 10.2)执行:
tuned-adm activetuned-adm recommendsudo tuned-adm profile throughput-performancetuned-adm activesudo tuned-adm profile virtual-guestsudo dnf -y install pcp pcp-system-toolssudo systemctl enable --now pmcdpminfo -f kernel.all.loadpmval -t 2 -s 2 kernel.all.loadpmstat -t 1 -s 3E3 记录:plans/content-expansion/evidence/rhel/rhel-tuned-pcp/run.json(5 步)。
先给结论:tuned 管配置,PCP 管观测
Section titled “先给结论:tuned 管配置,PCP 管观测”| 工具 | 作用 | 本机结果 |
|---|---|---|
tuned-adm | 切换 profile | active/recommend 都是 virtual-guest |
pmcd | PCP 采集守护进程 | active |
pminfo | 看指标定义/当前值 | kernel.all.load 有 1/5/15 三个实例 |
pmval | 按间隔采样 | 1 分钟 load 0.20 → 0.18 |
pmstat | 类 vmstat 的滚动视图 | load/mem/swap/io/cpu |
tuned profile
Section titled “tuned profile”$ tuned-adm activeCurrent active profile: virtual-guest$ tuned-adm recommendvirtual-guestsudo tuned-adm profile throughput-performancetuned-adm active# Current active profile: throughput-performancesudo tuned-adm profile virtual-guestvirtual-guest 是虚拟化客户机的常见推荐;切到 throughput-performance 会改 CPU governor/IO 调度等,测试完要切回。
PCP 安装与 pmcd
Section titled “PCP 安装与 pmcd”sudo dnf -y install pcp pcp-system-toolssudo systemctl enable --now pmcdsystemctl is-active pmcd# activepcp 是采集核心,pcp-system-tools 带 pmstat/pmatop 等前端。
pminfo / pmval
Section titled “pminfo / pmval”$ pminfo -f kernel.all.loadkernel.all.load inst [1 or "1 minute"] value 0.2 inst [5 or "5 minute"] value 0.08 inst [15 or "15 minute"] value 0.03
$ pmval -t 2 -s 2 kernel.all.load 1 minute 5 minute 15 minute 0.2000 8.000E-02 3.000E-02 0.1800 8.000E-02 3.000E-02-t 是采样间隔,-s 是次数;适合快速确认指标名和量级。
pmstat
Section titled “pmstat”$ pmstat -t 1 -s 3 loadavg memory swap io system cpu 1 min swpd free buff cache pi po bi bo in cs us sy id 0.18 0 527536 5308 3705m 0 0 0 23 245 251 0 0 100列和 vmstat 接近,但数据来自 PCP archive/实时 pmcd,后续可接 Grafana/pcp-webapp。
-
tuned-adm active/recommend已记录; - profile 切换有回滚(切回原 profile);
-
pmcdactive、开机自启; -
pminfo确认指标存在; -
pmval/pmstat采样窗口与负载已知; - 基线包含内核/硬件/业务信息。
未实测与边界
Section titled “未实测与边界”- 未测试 PCP archive 长期存储;
- 未测试 Grafana/pcp-webapp;
- 未测试
pmatop/pcp-atop; - 未测试 tuned 自定义 profile。
- RHEL tuned 性能基线 — profile 细节
- RHEL 10 systemd cgroup v2 — 单服务资源限制
- 官方:Monitoring and managing system status and performance