温馨提示×

cpustat在debian咋开

小樊
35
2026-10-22 03:49:29
栏目: 智能运维

在 Debian 上**“cpustat”**通常指两种东西之一,我分别说清楚,你对着用:


一、如果你说的是 cpustat 命令(来自 cpustat 包)

1. 安装

sudo apt update
sudo apt install cpustat

2. 使用(需要 root)

sudo cpustat

默认每 5 秒刷新一次,显示每个 CPU 的使用情况。

常用参数:

sudo cpustat 1      # 每 1 秒刷新
sudo cpustat -x     # 显示扩展信息

注意:cpustat 依赖 /proc/stat,普通用户可能没权限,建议加 sudo。


二、如果你说的是 systemd 的 CPU 统计 / CPU 压力监控

查看 CPU 使用情况(内置)

top
htop        # 需安装:sudo apt install htop

查看 systemd 服务的 CPU 使用

systemd-cgtop

三、如果你其实是想“开启 CPU 性能监控 / 调速”

1. 查看 CPU 频率

lscpu
cat /proc/cpuinfo | grep MHz

2. 安装性能工具

sudo apt install linux-cpupower
sudo cpupower frequency-info

3. 设置为性能模式

sudo cpupower frequency-set -g performance

四、如果你指的是 vmstat / mpstat

sudo apt install sysstat
mpstat 1

如果你能说一下:

  • 你是想 装命令
  • 还是 看 CPU 使用率
  • 还是 开 CPU 性能模式

我可以直接给你最精确的命令。

0 踩