日期:2014-05-16  浏览次数:20780 次

linux top命令含义整理

?在linux使用 ps命令的输出只是系统执行命令那一刻的快照信息,为了能够连续地观察进程的实时状态信息以及其他系统信息,可以使用更top命令,如下是一个top命令的截图:

?top命令输出的前面5行是系统运行状态的汇总信息:

1)其中第一行包括系统的当前时间(13:13:04),自linux操作系统启动运行以来累计运行时间(48分钟),目前登录到linux操作系统的用户数(1个),以及系统运行在最近1分钟,5分钟和15分钟内系统运行队列的平均长度。

2)第二行是关于进程的统计信息,包括系统中现有进程的总数(127),当前正在运行的进程数量(1),处于休眠状态的进程数量(126),处于暂停状态的进程数量(0),处于僵尸状态的进程数量(0)。

3)第三行是关于CPU的统计信息,CPU处于用户模式(0.3),CPU处于系统模式(0.3),CPU处理其优先级经nice值调整过的用户进程的时间量所占百分比(0),CPU处于空闲状态(99.3),CPU处于等待I/O状态(0),CPU处理硬件中断状态(0),CPU处理软件中断状态(0),CPU处理st(Steal Time)状态(0)。

4)第四行是关于内存的统计信息,系统配置的物理内存总量(102468KB),已用内存数量(422744KB),空闲内存数量(597724KB),用作缓冲区的内存数量(11524KB)。

5)第五行是关于交换区的统计信息,系统配置的交换区总量(102920KB),已用交换区数量(1000KB),空闲交换区数量(1019920KB),用作缓冲区的交换区数量(178912KB)。

?关于CPU处理st(Steal Time)状态的说明:

IBM’s?definition?of steal time is actually pretty good:

Steal time is the percentage of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor.

So, relatively speaking, what does this mean?


A high steal percentage may mean that you may be outgrowing your virtual machine with your hosting?company. Other virtual machines may have a larger slice of the CPU’s time and you may need to ask for an upgrade in order to compete. Also, a high steal percentage may mean that your hosting company is overselling virtual machines on your particular server. If you upgrade your virtual machine and your steal percentage doesn’t drop, you may want to seek another provider.


A low steal percentage can mean that your applications are working well with your current virtual machine. Since your VM is not wrestling with other VM’s constantly for CPU time, your VM will be more responsive. This may also suggest that your hosting provider is underselling their servers, which is definitely a good thing.

?