查看系統負
- # 查看系統負載
- 命令:uptime
-
20:32:10 up 9:22, 4 users, load average: 0.00, 0.00, 0.00 注:load average: 0.00, 0.00, 0.00
- # 查看系統負載
- 命令:w
-
20:31:05 up 9:21, 4 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - 13:56 43:51 0.15s 0.15s -bash root pts/0 192.168.1.150 18:58 1:02m 0.10s 0.10s -bash root pts/1 192.168.1.150 19:47 0.00s 0.01s 0.00s w root pts/3 192.168.1.150 14:22 2:39m 0.01s 0.01s -bash 注: load average: 0.00, 0.00, 0.00
- # 當前每隔10分鍾打印一次系統負載
- 命令:sar –q –f /var/log/sa/sa*
-
19時17分26秒 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 19時17分44秒 0 166 0.00 0.02 0.00 ldavg-1 # 系統1分鍾前負載 ldavg-5 # 系統 5分鍾前負載 ldavg-15 # 系統 15分鍾前負載
- # 查看系統負載
- 命令:top
- # 查看CPU個數
- 命令:top
- 終端:1
-
Tasks: 80 total, 1 running, 79 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 508960k total, 475576k used, 33384k free, 14392k buffers Swap: 2064376k total, 141052k used, 1923324k free, 127476k cached 注:0.0%hi, 0.0%si, 0.0%st
- # 查看CPU每十分鍾刷新一次
- 命令:sar
-
Linux 2.6.32-431.el6.i686 (localhost.localdomain) 2018年01月22日 _i686_ (1 CPU) 19時17分26秒 CPU %user %nice %system %iowait %steal %idle 19時17分44秒 all 0.00 0.00 0.17 0.06 0.00 99.77 平均時間: all 0.00 0.00 0.17 0.06 0.00 99.77
CPU:all表示統計信息為所有 CPU的平均值。 %user:顯示在用戶級別(application)運行使用 CPU 總時間的百分比。 %nice:顯示在用戶級別,用於nice操作,所占用 CPU總時間的百分比。 %system:在核心級別(kernel)運行所使用 CPU總時間的百分比。 %iowait:顯示用於等待I/O操作占用 CPU總時間的百分比。 %steal:管理程序(hypervisor)為另一個虛擬進程提供服務而等待虛擬 CPU 的百分比。 %idle:顯示 CPU空閑時間占用 CPU總時間的百分比。 1.若 %iowait的值過高,表示硬盤存在I/O瓶頸 2.若 %idle的值高但系統響應慢時,有可能是 CPU等待分配內存,此時應加大內存容量 3.若 %idle的值持續低於1,則系統的 CPU處理能力相對較低,表明系統中最需要解決的資源是 CPU。
注:三個數值:1分鍾內,5分鍾內,15分鍾內平均負載。
- 注:1分鍾內平均有多少個進程占用了cpu。
- 負載低:負載值/CPU個數=小於1
- 負載高:負載值/CPU個數=大於1
- 注:查看cpu個數cat /proc/cpuinfo
-
processor : 0 #cpu 個數 0代表1 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz stepping : 3 cpu MHz : 2494.299 cache size : 3072 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss nx pdpe1gb rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dts fsgsbase smep bogomips : 4988.59 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: