查看进程动态:top

top命令用于查看进程动态,即进程使用系统资源的情况,常见用法如下:

[root@localhost ~]$ top         # 动态查看进程使用资源的情况,每三秒刷新一次
[root@localhost ~]$ top -c      # 动态查看进程使用资源的情况,但会详细地显示进程信息
[root@localhost ~]$ top -bn1    # 静态显示所有进程
[root@localhost ~]$ 

top 输出详解:

top - 10:07:26 up 37 days, 17:47,  2 users,  load average: 0.12, 1.52, 1.81        # 分别表示当前系统时间,系统已运行时间,登录用户数,系统负载
Tasks: 156 total,   1 running, 155 sleeping,   0 stopped,   0 zombie               # 分别表示总进程数,正在运行的进程数,被阻塞的进程数,停止的进程数,僵尸进程数
%Cpu(s):  3.0 us,  2.0 sy,  0.0 ni, 84.8 id,  9.9 wa,  0.0 hi,  0.3 si,  0.0 st    # 分别表示用户正在运行的进程占用CPU的百分比,系统正在运行的进程占用CPU的百分比,......
KiB Mem :  1882892 total,    75236 free,  1643764 used,   163892 buff/cache        # 分别表示总物理内存大小,空闲物理内存大小,已使用物理内存大小,用作缓冲/缓存的物理内存大小
KiB Swap:        0 total,        0 free,        0 used.    44492 avail Mem         # 分别表示交换分区总量,空闲的交换分区总量,已使用的交换分区总量,可用于分配的物理内存总量

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND         # PID:进程ID 
 2489 git       20   0  727084 426532   2288 S  1.3 22.7   0:04.25 bundle          # USER:
   27 root      20   0       0      0      0 S  0.7  0.0   4:54.73 kswapd0         # PR:
17363 git       20   0  788360 432036   1656 S  0.7 22.9   0:23.54 bundle          # NI:
10451 git       20   0  950100  58708      0 S  0.3  3.1   1:48.47 ruby            # VIRT:
10592 gitlab-+  20   0  131432  10228   1816 S  0.3  0.5   0:37.60 redis_exporter  # RES:
18611 root      20   0       0      0      0 S  0.3  0.0   0:00.02 kworker/0:2     # SHR:
18880 root      20   0  159876   1312    600 R  0.3  0.1   0:00.05 top             # S:
    1 root      20   0  125440   1800    412 S  0.0  0.1   8:34.00 systemd         # %CPU:
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.26 kthreadd        # %MEM:
    3 root      20   0       0      0      0 S  0.0  0.0   0:26.92 ksoftirqd/0     # TIME+:
    5 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H    # COMMAND:
    7 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0    
    8 root      20   0       0      0      0 S  0.0  0.0   0:00.00 rcu_bh
    9 root      20   0       0      0      0 S  0.0  0.0   4:19.63 rcu_sched

    

猜你喜欢

转载自www.cnblogs.com/pzk7788/p/10297498.html