ps和top命令的%CPU含义
2010-06-09 10:13
393 查看
一直以为ps命令中的"%CPU"也是指实时的CPU使用率,所以一直都用它来做cacti监控process的cpu使用率。但是上周发现有点不对,ps的"%CPU"与top或者vmstat 的"%CPU"不一样。
ps命令的man里面的解释:
CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%.
top命令的man的解释:
k: %CPU -- CPU usage
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU
time. In a true SMP environment, if 'Irix mode' is Off, top will operate in number of CPUs. You toggle
'Irix/Solaris' modes with the 'I' interactive command.
我的理解是,top中的进程cpu使用率,是实时的CPU使用率,也就是
单位时间内进程使用的CPU时间/单位时间
而ps命令中的cpu使用率,反映的是该进程启动以来使用系统资源的情况:
进程启动以来使用的CPU时间/进程启动以来的实际时间
两者有很大的区别。
(上述所说的ps和top命令所在的操作系统是debian)。
ps命令的man里面的解释:
CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%.
top命令的man的解释:
k: %CPU -- CPU usage
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU
time. In a true SMP environment, if 'Irix mode' is Off, top will operate in number of CPUs. You toggle
'Irix/Solaris' modes with the 'I' interactive command.
我的理解是,top中的进程cpu使用率,是实时的CPU使用率,也就是
单位时间内进程使用的CPU时间/单位时间
而ps命令中的cpu使用率,反映的是该进程启动以来使用系统资源的情况:
进程启动以来使用的CPU时间/进程启动以来的实际时间
两者有很大的区别。
(上述所说的ps和top命令所在的操作系统是debian)。
相关文章推荐
- ps和top命令的%CPU含义
- linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义
- linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义
- ps命令中的%CPU字段和top命令中的%CPU字段
- linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义【转】
- linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义
- linux ps top 命令 VSZ,RSS,TTY,STAT, VIRT,RES,SHR,DATA的含义
- Linux Shell中PS命令中的%CPU的含义介绍
- linux 命令: ps 和 top
- 解析ANDROID ps命令执行后各项参数的含义
- Liunx中共ps 和pstree和top命令行
- htop,dstat,top,ps命令的使用
- linux top命令VIRT,RES,SHR,DATA的含义
- Linux 进程管理命令 ps 、top、htop、dstat
- 精通top,ps命令
- Linux 进程管理命令ps、top、kill、nice、fg、bg、vmstat、uptime
- Top命令VIRT,RES,SHR,DATA的含义
- Linux系统内存监控全面讲解:free命令、top、ps
- linux性能分析命令ps,top,vmstat 使用
- Linux的进程查看命令ps与top详解