pcp 基本使用
pcp 是一款强大的metrics 分析工具,包含了比较完整的指标分析工具链,同时也已经包含了好多pmdas
核心组件
参考架构
安装
- centos
yum install -y pcp
- 启动
systemctl enable pmcd pmlogger pmie
systemctl start pmcd pmlogger pmie
- 查看信息
pcp
Performance Co-Pilot configuration on iZ2zecw7m6bmthkpmft9d8Z:
platform: Linux iZ2zecw7m6bmthkpmft9d8Z 3.10.0-1062.4.3.el7.x86_64 #1 SMP Wed Nov 13 23:58:53 UTC 2019 x86_64
hardware: 2 cpus, 1 disk, 1 node, 3789MB RAM
timezone: CST-8
services: pmcd pmwebd
pmcd: Version 4.3.2-1, 13 agents, 4 clients
pmda: root pmcd proc pmproxy trace xfs linux mmv kvm jbd2 docker
prometheus bcc
pmlogger: primary logger: /var/log/pcp/pmlogger/iZ2zecw7m6bmthkpmft9d8Z/20191216.09.30
pmie: primary engine: /var/log/pcp/pmie/iZ2zecw7m6bmthkpmft9d8Z/pmie.log
- 查询metrics
pminfo 查看系统的metrics
查询某个metrcis 信息
pminfo -f proc.psinfo.age
效果
pminfo -f proc.psinfo.age
proc.psinfo.age
inst [720 or "000720 /sbin/auditd"] value 280821.65
inst [1 or "000001 /usr/lib/systemd/systemd"] value 280824.97
inst [2 or "000002 (kthreadd)"] value 280824.97
inst [1262 or "001262 /usr/sbin/sshd"] value 280817.05
inst [783 or "000783 /usr/lib/polkit-1/polkitd"] value 280821.35
inst [4 or "000004 (kworker/0:0H)"] value 280824.97
inst [65 or "000065 (deferwq)"] value 280824.49
inst [6 or "000006 (ksoftirqd/0)"] value 280824.97
inst [247 or "000247 (ata_sff)"] value 280824.22
inst [7 or "000007 (migration/0)"] value 280824.97
inst [8 or "000008 (rcu_bh)"] value 280824.97
inst [20228 or "020228 (kworker/u4:1)"] value 262
具体
- web 界面
yum install pcp-webapi pcp-webapp-vector pcp-webapp-grafana
systemctl enable pmwebd
访问地址:
http://ip:44323/vector
http://ip:44323/grafana/
web 效果
grafana:
netflix vector:
说明
pcp 功能强大,同时也包含了exporter,可以将metrics 输出到后端存储(es,zabbix,influxdb,graphite。。。。),同时支持bpf 分析(bcc),火焰图
。。。。