在本页阅读全文(共10页)
它的语法为:
top [-s time] [-d count] [-q] [-u] [-h] [-n number]
其中各选项的含义为:
-s time: 屏幕刷新的时间间隔time,缺省为5秒;
-d count: 屏幕刷新count次后,top命令自己也退出;
-q: This option runs the top program at the same priority as if it is executed via a nice -20 command so that it will execute faster (see nice(1)). This can be very useful in discovering any system problem when the system is very sluggish. This option is accessibly only to users who have appropriate privileges.
-u: User ID (uid) numbers are displayed instead of usernames. This improves execution speed by eliminating the additional time required to map uid numbers to user names.
-h: Hides the individual CPU state information for systems having multiple processors. Only the average CPU status will be displayed.
-n number: Show only number processes per screen. Note that this option is ignored if number is greater than the maximum number of processes that can be displayed per screen.
在top命令运行时,我们可用以下几个快捷键来翻屏:
j: 向前翻;
k: 向后翻;
t: 回到第一页;
对结果的分析:
通过top命令,我们可以快速了解到目前系统的CPU资源使用情况,尤其是占用CPU资源最多的进程是我们必须关注的对象。
我们通过RES(the current size of the process resident in memory)列可以知道每个进程占用内存的数量。
我们通过NICE列可以知道系统是否使用NICE值来调节该进程的工作负载平衡。
更多精彩文章推荐:
本文导航