?????????????????????У??????????????????????????? CPU ??????? ?м??????? Linux ???????????? UNIX ????????????????????????????? ??????? (loadaverage)  ??
????[huangc@V-02-01-00860 ~]$ uptime
????11:18:05 up 78 days??  1:17?? 11 users??  load average: 0.20?? 0.13?? 0.12
???????????????????????????? 1min?? 5min?? 15min????????е???????????????????е??????????????????е??????????????????е???????????????????е??????????е?????????? CPU?????????????/proc/cpuinfo???????????
[huangc@V-02-01-00860 ~]$ cat /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 62
model name: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping: 4
cpu MHz: 2500.000
cache size: 25600 KB
physical id: 0
siblings: 2
core id: 0
cpu cores: 2
apicid: 0
initial apicid: 0
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 ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat xsaveopt pln pts dts fsgsbase smep
bogomips: 5000.00
clflush size: 64
cache_alignment: 64
address sizes: 40 bits physical?? 48 bits virtual
power management:
processor: 1
vendor_id: GenuineIntel
cpu family: 6
model: 62
model name: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping: 4
cpu MHz: 2500.000
cache size: 25600 KB
physical id: 0
siblings: 2
core id: 1
cpu cores: 2
apicid: 1
initial apicid: 1
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 ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat xsaveopt pln pts dts fsgsbase smep
bogomips: 5000.00
clflush size: 64
cache_alignment: 64
address sizes: 40 bits physical?? 48 bits virtual
power management:
??????????У?????????????????????????????????£??????????е??????????????????????????????????????ζ??????????е????????????????????????????? CPU??????? uptime????????????????С?? 2.00????????????????????ж?????????????? 4?? CPU??????????????????С?? 4.00?????????????????????????????????????????????????????????
????????ù????????CPU?????????????? ?????????????????????????????????????????????????????????????????????????κ???????????????????????????????
????????uptime?????????????????????????????????????????????????????????????????????????????????????????(????)???????????????????????????????????????????С??????????Χ??
???????????????????????????????????????? 3????????????????CPU?????????????? vmstat?? iostat?? top?? ??Щ?????????????????????棬???????ù?????????????????????????????????????????????????????????????????????????(????????????)?????(?????????????)??У???????????????????????????????????????????????????е?????????н??????????????????????????????′????????С????磬???????????????????????С? ???????????????????? ????????????????????(????????????????)??????????е??????????????????????Щ????£????????????????(fallback)????????????Щ??ü??????У? ?????????????? ???磬 Internet??????????????????? named?????????? off-host??????в??????????????????????(?????????/etc/resolv.conf?????? name server?????)?????????У????????????????????????????????????????????????????????????????????е???????????????? uptime?????????????????????????????????????????????????????????£?vmstat?????????????????С?????????Χ??
???????vmstat
????vmstat???????????????????ù????????????????????????????????????????????????????????????л?????????Щ??????????????????????vmstat????????????????
????[huangc@V-02-01-00860 ~]$ vmstat
????procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
????r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
????1  0 3853948 1386860  43092 5049692    1    6     5    34    1    3 27 27 46  0  0
????vmstat ????????? ??
????· procs ?????????????????????????е??????? (r) ????????????????? (b) ?? ??????????Щ???????????????????????????????????????????????? ????????????????飺??ú???????????????????? I/O ???????????? ???????????????????
????· memory ?????????????? (swpd) ????????? (free) ?? I/O ???????????????? (buff) ???????????????????滺?? (cache) ??????????λ? KB ?? swpd ????????? kswapd ??????  ??
????· s wap ????????????????????????? (si) ????????????????????? (so) ?? ??λ? KB/s ?? so ???????????????????????? kswapd ?????????? si ????????汻??????????????????????????? ??
????· io ??????????豸???????? (bi) ???д?????豸?????? (bo) ????λ? KB/s ???????? I/O ?????????????????????????????? ??
????· system ?????????????ж???? (in) ?????????л???? (cs) ??
????· cpu ??????????? (us) ?? ?? (sy) ?? ???????? (id) ?????? I/O ??? (wa) ?? CPU ???????????????? CPU ???????????????????? ?? wa ????? ????ü?? I/O ?????????磬?????????????? I/O ????????????????? I/O ??????
??????? uptime ????????н???????? 3 ?????Χ (1min ?? 5min ?? 15min) ????????????? ???? ??? uptime ?????????????????κ????Χ??????? 1 ???? vmstat ?????????????????????y?? 1 ??
????vmstat
?????????????????????????????????????????????????????????
????vmstat 5 10
??????????????????? 5s ??? vmstat ????? ????? 10 ?Ρ? ???? ????? uptime ?????????? ?????????????? 1/5/10min ????? 1 ?? ?????????????????????????????о???????????е????? ?? vmstat ?????????г?????? 5 ?? 7 ???? 20 ????????????????????????????????????????????????????????????????????????????????????????? ??
???????????????????????????????????????????仺???? ??? uptime ??鵂???????????????? ?????????????? ????????λ????????????? ???? vmstat ?????????????????????????? ????? CPU?????????????ж?????????С???????????????Щ???????? ???????????????????????????????δ??????? ?????磬?Щ??ó??????????????????????????????????ɡ?????????????????????????????????ó?????????ó????????????????????????л????????????????????ó???????????????????У????? ???????????????????????????????????????????????????????????????????????????????????????????????????????? ??
????????????????У???????????????? 1 ?????????????????????????????????????? vmstat ??????????????????????е?????????????????Χ??????????????? ????????????????????? ps(1) ?? top(1) ???????????????Щ????????????? ?? CPU ??? ps(1) ???????е???????????б?? ???????????????????????????? top(1)( ?? gtop(1)) ???????????????????μ?????? ???л?????????????????? CPU ???????????Щ???????????????????????????????Ч????????????? ??? vmstat(1) ???????Щ????????????????????У????????????????????????? ( ???? gdb(1)) ???????y?????????????????л?????????????????????????е?????? ??? vmstat ??????????????“ ??” ????????????????????????????? strace(1) ??????????????Щ??????? ?? vmstat(1) ????????????????????????? I/O ???????? ???????? sar(1) ?????????????????е??豸?? ?????????Щ??????Щ?????????????????С????????????н??????????????? ??
????top ?? gtop ???????????????????? vmstat ?? uptime ??????????????????? ?????????? ????????????Щ???????????????Щ????????????????????
????top ??????????????????е??????????????????μ????????????? CPU ???ɡ? ??????????????????????????????????????????????????????? top ???????????????????????????? uptime(1) ????????????? top ????????????????????????????????????????????е????????????????????? “ ????”????????Щ???????????????????????? ????????????????????????????? socket ??????????????????? ( ???磬??????????????????? Web ?????? ) ???????? top(1) ??????????????????????????????? ????????????????????????е??κβ??????????????£? top ???????????????£??????????? CPU ?????????????????????????????????????????? CPU ??????????????????????? ??