在 CentOS(以及其它 Linux 发行版)中,cpustat 通常是指 sysstat 工具包里的 mpstat/pidstat 之外的一个工具,但更准确地说:
mpstat(来自 sysstat)cpustat 通常来自 pcp(Performance Co-Pilot)或第三方工具(如 cpustat by ickle)下面分情况说明 cpustat 能监控什么。
pcp 提供的 cpustat(CentOS 可安装:yum install pcp)
cpustat 1
每秒输出一次 CPU 统计信息。
cpustat(轻量级工具)(如:cpustat by ickle)
特点:
top 的 CPU 部分mpstat(CentOS 最常见)很多用户说的 “cpustat” 实际是 mpstat
mpstat 能监控:mpstat -P ALL 1
监控内容:
| 工具 | 监控内容 |
|---|---|
| cpustat (pcp) | CPU 使用率、负载、中断、队列 |
| cpustat (轻量) | 核心使用率、实时状态 |
| mpstat | 标准 CPU 统计(最常用) |
如果你愿意,可以告诉我:
which cpustat)我可以给你更精确的使用示例。