资源占用率监测方法

CPU

TOP,地球人都知道
[root@~]# top
top – 14:50:56 up 22:31, 7 users, load average: 45.76, 33.64, 15.93
Tasks: 622 total, 1 running, 621 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.6 us, 0.2 sy, 0.0 ni, 93.9 id, 2.4 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 13198510+total, 56110604 free, 41665376 used, 34209120 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 89487664 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2566 root 20 0 629720 561460 70156 D 67.2 0.4 0:19.35 clang
3197 root 20 0 144644 69224 42192 D 15.6 0.1 0:00.66 clang
3057 root 20 0 308968 234124 53692 D 12.6 0.2 0:06.64 clang

磁盘IO

[root@~]# iostat -x

Linux 3.10.0-514.el7.x86_64 (bsabj36) 02/10/2020 _x86_64_ (32 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle 11.12 0.00 2.45 0.70 0.00 85.73
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %utilsda 0.01 0.22 8.82 7.20 1072.97 386.24 182.17 0.17 10.34 2.75 19.65 9.98 15.99sdb 0.02 0.57 9.43 8.03 1064.23 325.95 159.18 0.20 11.41 22.09 29.59 11.08 19.35sdc 0.00 0.17 9.58 1.88 955.05 222.93 205.64 0.01 0.51 12.96 68.48 8.94 10.24sdd 0.05 0.56 1.97 3.99 42.70 73.31 38.93 0.14 22.93 5.20 31.71 3.53 2.10dm-0 0.00 0.00 1.34 3.35 30.00 29.12 25.22 0.11 22.51 5.16 29.43 3.13 1.47dm-1 0.00 0.00 0.06 0.16 0.23 0.64 8.00 0.11 484.35 7.16 652.83 0.19 0.00dm-2 0.00 0.00 0.64 0.77 12.43 43.54 79.25 0.05 36.75 5.56 62.72 5.55 0.78
看来rkB/s wkB/s比较高,可能存在io竞争看看哪些进程io占用率高?iotop -oPTotal DISK READ : 3.37 M/s | Total DISK WRITE : 1689.08 K/sActual DISK READ: 3.37 M/s | Actual DISK WRITE: 15.33 M/s PID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 991980 be/4 qemu 3.37 M/s 0.00 B/s 0.00 % 9.29 % qemu-kvm -name WANNA_defend_win7_update_BJOBM1 -S -machine~alloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on 845146 be/4 qemu 0.00 B/s 1520.52 K/s 0.00 % 3.57 % qemu-kvm -name WANNA_defend_win7_update_GDSZ1 -S -machine ~alloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on 232279 be/4 qemu 0.00 B/s 158.02 K/s 0.00 % 0.73 % qemu-kvm -name MNG_ESPC -S -machine pc-i440fx-rhel7.0.0,ac~alloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on 860489 be/4 qemu 0.00 B/s 0.00 B/s 0.00 % 0.01 % qemu-kvm -name WANNA_SECURITY_RSAS_off -S -machine pc-i440~alloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on 993858 be/4 bsaworke 0.00 B/s 10.53 K/s 0.00 % 0.00 % java -Dproc_nodemanager -Xmx1000m -Dhadoop.log.dir=/home/b~rties org.apache.hadoop.yarn.server.nodemanager.NodeManager

网络IO

[root@~]# iftop -n -i eth0
-n表示不解析域名,-i表示对应网络接口

                            191Mb                                    381Mb                                    572Mb                                    763Mb                               954Mb
└───────────────────────────────────────┴────────────────────────────────────────┴────────────────────────────────────────┴────────────────────────────────────────┴────────────────────────────────────────
192.168.19.14 => 101.6.8.193 42.5Kb 34.5Kb 34.5Kb
<= 2.75Mb 2.45Mb 2.45Mb 192.168.19.14 => 10.63.1.90

Leave a Reply

Your email address will not be published. Required fields are marked *