关于CPU的User、Nice、System、Wait、Idle各个参数的解释

使用Ganglia监控整个Hadoop集群,看到Ganglia采集的各种指标:CPU各个具体的指标含义解释如下:

①CPU(监测到的master主机上的CPU使用情况)

从图中看出,一共有五个关于CPU的指标。分别如下:

ⓐ User

User表示:CPU一共花了多少比例的时间运行在用户态空间或者说是用户进程(running user space processes)。典型的用户态空间程序有:Shells、数据库、web服务器……

ⓑ Nice

Nice表示:可理解为,用户空间进程的CPU的调度优先级,范围为[-20,19]

You can set the nice value when launching a process with the nice command and then change it with the renice command.
Only the superuser (root) can specify a priority increase of a process.

具体参考:Cpu中的Nice是什么?

ⓒSystem

System的含义与User相似。System表示:CPU花了多少比例的时间在内核空间运行。分配内存、IO操作、创建子进程……都是内核操作。这也表明,当IO操作频繁时,System参数会很高。

When a user space process needs something from the system, for example when it needs to allocate memory, perform some I/O, 
or it needs to create a child process, then the kernel is running

 

ⓓWait

在计算机中,读写磁盘的操作远比CPU运行的速度要慢,CPU负载处理数据,而数据一般在磁盘上需要读到内存中才能处理。当CPU发起读写操作后,需要等着磁盘驱动器将数据读入内存(可参考:JAVA IO 以及 NIO 理解),从而导致CPU 在等待的这一段时间内无事可做。CPU处于这种等待状态的时间由Wait参数来衡量。

cpu is idle while waiting for an I/O operation to complete。The time the CPU spends in this state is shown by the wait statistic.

 

Idle

Idel表示:CPU处于空闲状态时间比例。一般而言,idel + user + nice 约等于100%

 

此外,Linux中的top命令可实时显示系统的CPU使用情况。下图可看出Ganglia的gmond占的cpu还是很多的。

 

参考文献:理解Linux cpu 状态

 

posted @   大熊猫同学  阅读(54672)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示