linux系统实时监控top命令
linux系统中,top命令提供了实时监控的各类数据
top - 03:36:01 up 11:47, 5 users, load average: 0.25, 0.27, 0.24
Tasks: 140 total, 1 running, 139 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.4 us, 0.8 sy, 0.0 ni, 97.6 id, 0.0 wa, 0.4 hi, 0.8 si, 0.0 st
MiB Mem : 791.5 total, 119.4 free, 218.1 used, 453.9 buff/cache
MiB Swap: 2048.0 total, 1975.2 free, 72.8 used. 423.9 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 932635 root 20 0 153232 6476 4932 S 0.7 0.8 0:29.41 sshd
1078745 root 20 0 153296 6768 5168 S 0.7 0.8 0:04.22 sshd 9 root 20 0 0 0 0 S 0.3 0.0 0:15.87 ksoftirqd/0 751 root 16 -4 75632 136 0 S 0.3 0.0 0:19.09 auditd
1078931 root 20 0 275088 5560 3960 S 0.3 0.7 0:01.19 top
1117557 root 20 0 0 0 0 I 0.3 0.0 0:00.01 kworker/0:1-eve+
1119442 root 20 0 274276 4468 3832 R 0.3 0.6 0:00.02 top 1 root 20 0 179524 7776 4520 S 0.0 1.0 0:03.28 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp 6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-kb+ 7 root 20 0 0 0 0 I 0.0 0.0 0:00.29 kworker/u256:0-+
......
系统概览:
top - 03:36:01 up 11:47, 5 users, load average: 0.25, 0.27, 0.24
系统概览
当前时间:03:36:01
运行时间:11小时47分钟
登录用户数:5
系统负载:
1分钟:0.25
5分钟:0.27
15分钟:0.24
进程状态:
Tasks: 140 total, 1 running, 139 sleeping, 0 stopped, 0 zombie
进程状态
总进程数:140
运行中:1
休眠中:139
停止/僵尸:0
cpu使用情况:
%Cpu(s): 0.4 us, 0.8 sy, 0.0 ni, 97.6 id, 0.0 wa, 0.4 hi, 0.8 si, 0.0 st
CPU使用情况
用户空间:0.4%
系统空间:0.8%
优先级调整:0.0%
空闲:97.6%
I/O等待:0.0%
硬件中断:0.4%
软件中断:0.8%
虚拟化占用:0.0%
内存使用情况:
MiB Mem : 791.5 total, 119.4 free, 218.1 used, 453.9 buff/cache
内存总量:2048M
空闲:119.4M
已用:218.1M
缓存/缓冲:453.9M
交换分区使用情况:
MiB Swap: 2048.0 total, 1975.2 free, 72.8 used. 423.9 avail Mem
交换区总量:2048M
交换区空闲:1975.2M
交换区已用:72.8M
交换区缓存/缓冲:423.9M
进程资源占用情况
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 932635 root 20 0 153232 6476 4932 S 0.7 0.8 0:29.41 sshd
1078745 root 20 0 153296 6768 5168 S 0.7 0.8 0:04.22 sshd 9 root 20 0 0 0 0 S 0.3 0.0 0:15.87 ksoftirqd/0 751 root 16 -4 75632 136 0 S 0.3 0.0 0:19.09 auditd
1078931 root 20 0 275088 5560 3960 S 0.3 0.7 0:01.19 top
1117557 root 20 0 0 0 0 I 0.3 0.0 0:00.01 kworker/0:1-eve+
1119442 root 20 0 274276 4468 3832 R 0.3 0.6 0:00.02 top 1 root 20 0 179524 7776 4520 S 0.0 1.0 0:03.28 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp 6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-kb+ 7 root 20 0 0 0 0 I 0.0 0.0 0:00.29 kworker/u256:0-+ PID:进程的id。
USER:进程所有者的用户名。
PR:进程优先级。
NI:nice值。负值表示高优先级,正值表示低优先级。
VIRT:进程使用的虚拟内存总量,单位KB。VIRT=SWAP+RES。
RES:进程使用的、未被换出的物理内存大小,单位 KB。
RES=CODE+DATA,其中,CODE为执行代码占用的物理内存大小,DATA为数据占用的内存大小。
SHR:共享内存大小,单位KB。
S:进程状态,D表示不可中断的睡眠状态,R表示运行状态,S表示睡眠状态,T表示跟踪/停止,Z表示僵死进程。
%CPU:上次更新到现在的CPU时间占用百分比。
%MEM:进程占用的物理内存百分比。
TIME+:进程总计使用的CPU时间,单位为1/100秒。
COMMAND:正在运行进程的命令名或者命令路径。
top命令在linux运维过程中,对分析系统和业务有重大作用。