微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Understanding top command in unix

All this information is available in thetopman pagewhich you can read by runningman top. Here is a breakdown:

  • The cpu(s) row shows:

    cpu state percentages based on the interval since the last refresh. Where two labels are shown below,those for more recent kernel versions are shown first.
    us,user: time running un-niced user processes
    sy,system: time running kernel processes
    ni,nice: time running niced user processes
    wa,IO-wait: time waiting for I/O completion
    hi: time spent servicing hardware interrupts
    si: time spent servicing software interrupts
    st: time stolen from this vm by the hypervisor

  • TheMemandSwaprows show:

    This portion consists of two lines which may express values in kibibytes (KiB),mebibytes (MiB) or gibibytes (GiB) depending on the amount of currently installed physical memory.

    Line 1 reflects physical memory,classified as: total,used,free,buffers

    Line 2 reflects virtual memory,cached

    Physical memory is your RAM,physical pieces of hardware that provideRandom Access Memory. Swap isvirtual memorywhich can be a file or a partition on your hard drive that is essentially used as extra RAM. It is not a separate RAM chip though,it resides on your hard drive.

  • The last section provides information about the currently running processes. It consists of the following columns:

    1. PID-- Process Id : This is a unique number used to identify the process.
    2. User: The username of whoever launched the process.
    3. PR--Priority: The priority of the process. Processes with higher priority will be favored by the kernel and given more cpu time than processes with lower priority. Oddly enough,the lower this value,the higher the actual priority; the highest priority on *nix is -20 and the lowest is 20.
    4. NI--Nicevalue :niceis a way of setting your process' priority. Seeherefor more details.
    5. VIRT-- Virtual Memory Size (KiB) : The total amount of virtual memory used by the process.
    6. RES-- Resident Memory Size (KiB) : The non-swapped physical memory a task has used.
    7. SHR-- Shared Memory Size (KiB) : The amount of shared memory available to a task,not all of which is typically resident. It simply reflects memory that Could be potentially shared with other processes.
    8. S-- Process Status : The status of the task which can be one of:

      • 'D' = uninterruptible sleep
      • 'R' = running
      • 'S' = sleeping
      • 'T' = traced or stopped
      • 'Z' = zombie
    9. %cpu-- cpu Usage : The percentage of your cpu that is being used by the process.By default,topdisplays this as a percentage of a single cpu.On multi-core systems,you can have percentages that are greater than 100%. For example,if 3 cores are at 60% use,241); white-space:pre-wrap">topwill show a cpu use of 180%. Seeherefor more information.You can toggle this behavior by hittingShiftiwhiletopis running to show the overall percentage of available cpus in use.
    10. %MEM-- Memory Usage (RES) : A task's currently used share of available physical memory (RAM).
    11. TIME+-- cpu Time,hundredths : Total cpu time the task has used since it started.
    12. COMMAND-- Command Name or Command Line : To see the full command line that launched the process,start top with the-cflag :top -c.

原文地址:https://www.jb51.cc/bash/390779.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐