系统负载监控

 

 

1、cat /proc/loadavg

$ cat /proc/loadavg
6.83 6.52 6.77 9/7697 382398
You have new mail in /var/spool/mail/glc
$ 

/proc/loadavg 各项数据的含义
/proc文件系统是一个虚拟的文件系统,不占用磁盘空间,它反映了当前操作系统在内存中的运行情况,查看/proc下的文件可以了解到系统的运行状态。
查看系统平均负载使用“cat /proc/loadavg”命令,输出结果如下:
6.83 6.52 6.77 9/7697 382398
前三个数字大家都知道,是1、5、15分钟内的平均进程数(有人认为是系统负荷的百分比,其实不然,有些时候可以看到200甚至更多)。
后面两个呢,一个的分子是正在运行的进程数,分母是进程总数;另一个是最近运行的进程ID号。

 

 

2、uptime

$ uptime
 15:42:09 up 103 days, 23:49, 61 users,  load average: 7.26, 6.68, 6.81$ 

 

 

3、w

$ w
 15:42:48 up 103 days, 23:50, 61 users,  load average: 6.62, 6.61, 6.78
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/1    10.12.60.18      08:59   48.00s  0.14s  0.00s tmux at -t ygc
root     pts/25   10.12.14.90     13:02   29:52   1:29   1.06s mysql 
root     pts/37   10.12.13.41    14:33    4:16   0.26s  0.11s ssh root@XXXXX
root     pts/47   10.12.13.41    14:01    8.00s  0.69s  0.62s -bash
root     pts/49   10.12.14.20      09:17   48.00s  1.19s  1.12s -bash
root     pts/48   10.12.14.20      12:44    1:12   0.13s  0.00s tmux a -t wjl
root     pts/52   10.12.14.20      09:18   55:12   0.19s  0.00s tmux new -s glc
root     pts/56   10.12.13.54    14:02   32.00s  0.22s  0.15s -bash
root     pts/53   10.12.14.90     09:18    8.00s  0.36s  0.17s w
root     pts/75   10.12.13.40    14:08    1:33m  0.28s  0.04s mysql 
root     pts/78   10.12.13.40    14:40   22:40   1.57s  1.50s -bash
root     pts/79   10.12.13.40    14:09    8.00s  0.15s  0.08s -bash
root     pts/183  10.12.15.28     15:19    5:44   0.18s  0.03s ssh 10.142.26.14
root     pts/184  10.12.65.18      15:26    2:00   0.22s  0.07s ssh root@hostname$ 

 

 

 

4、top

top - 15:49:10 up 103 days, 23:56, 64 users,  load average: 6.32, 6.55, 6.71
Tasks: 6280 total,  11 running, 2395 sleeping,   0 stopped, 3874 zombie
%Cpu(s): 20.8 us,  3.9 sy,  0.0 ni, 74.8 id,  0.0 wa,  0.0 hi,  0.6 si,  0.0 st
KiB Mem : 13127068+total, 24441904 free, 14969144 used, 91859648 buff/cache
KiB Swap: 12582908 total, 12582908 free,        0 used. 11109324+avail Mem 

   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                
 53512 glc      20   0  117092   2696    524 R  85.4  0.0   0:02.74 audit.sh                                                                                                                          
 48720 glc      20   0  128760   3512   2524 R  65.4  0.0   0:02.10 mysqldump                                                                                                                              
 15668 glc      20   0  205564  13544   3828 S  14.0  0.0   9097:14 python                                                                                                                                                                                                                                                       
403643 glc      20   0  115504   1936   1384 S   1.6  0.0   1:22.16 mysql.sh                                                                                                                          
416270 root      20   0  160328   4844   3048 S   1.6  0.0   1:08.51 apple                                                                                                                          
 53875 root      20   0  172556   7152   3424 S   1.2  0.0   0:00.04 python                                                                                                                                 

 

 

5、tload

 8.12, 7.08, 6.87

 

你可能感兴趣的:(系统负载监控)