΢ Ͷ ߹

dz̸ΪʲôᵼLinux

  ʱ䣺2018-02-01 16:58:10   ߣ   Ҫ

ƪҪdz̸ΪʲôᵼLinuxСûͦģһֵҪѿԲο

 һCPUʺ͸ʵ

ҪCPUغCPUʣDzͬǵϢͬһtopнʾCPUʾdzڼʵʱռõCPUٷֱȣǶһʱCPUʹ״ͳƣָͨԿijһʱCPUռõ ռʱܸߣôҪCPUǷѾڳCPUʾһʱCPUڴԼȴCPUĽ֮͵ͳϢҲCPUʹöеijȵͳϢ

CPUʸ߲ζŸؾһ󣬿һCPUܼ͵ġһCPUʵǷиLoad AverageأռʱʹʱͿ֪CPUʱƬԺǷʹȫȡʹߣȫֵܳʸLoad AverageIO豸ҲܵCPUظߡ

ɴCPUʹжCPUǷһֳɵĹ״̬DzģLoad AverageȫֵĿCPUʹи˵ߵ£ijõ绰ͤһڴ绰ĸڵȴÿ޶ʹõ绰һӣһ֮ûд绰ֻܹҵ绰ȥŶӣȴһ֡绰൱CPUڻȴ绰˾൱ڵ绰ͤʹùУ϶˴绰ߵûд绰ѡŶӣŶӣı仯൱Ϊͳƽ5ͳһڵ1515ӵʱͳȡƽֵӶγɵ1515ӵƽءе绰ʹһֱ1ӣе˿ǰʮҵ绰룬ԥҪҪ򣬺ʮڴ绰ѵ绰CPUǾ˵ǰһˣ񣩵CPUʸߣһˣ񣩵CPUʵ͡Ȼ CPUǰʮ빤ʮЪţCPUһֱڹֻ˵еij漰ļ㣬CPUʾ͸ߣеijǣ浽IJֺ٣CPUȻ͵͡CPUǸǵͣжŶûбȻϵ

CPUCPUںӰ쵽CPUأΪҪ䵽CPUȥġCPUҪһCPUã˫Ҫȵ˺áˣҪסȥCPUϵIJ죬CPUǻںģ“жںˣжٸ”絥òҪ100%ҲǸΪ1.00ơ

Linuxһ/procĿ¼ŵǵǰϵͳӳ䣬һļΪcpuinfoļCPUϢ/proc/cpuinfoļ߼CPUʵCPUֶʾϢÿ߼CPUϢռһ䣬һ߼CPUʶ0ʼ

$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
stepping        : 2
microcode       : 0x36
cpu MHz         : 2399.998
cache size      : 20480 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 15
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr ......
bogomips        : 4799.99
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

ҪļеCPUϢмصĸҪ֪磺processorʾ߼CPUıʶmodel nameʾʵCPUͺϢphysical idʾʵCPUͱʶcpu coresʾʵCPUںȵȡ

߼CPUڵķһ㶼ʹ“߳”Hyper-ThreadingHTCPUܡ̼߳һCPUͬʱִжͬһCPUڵԴҪCPUһͬһʱִ̡߳Ȼó̼߳ͬʱִ̣߳CPUÿCPUжԴ̶߳ͬʱҪijһԴʱһҪʱֹͣóԴֱЩԴúܼ˳̵߳ܲCPUܡг̼߳CPUһЩơ

CPUʵļ㷽ʽ

Load averageĸԴUNIXϵͳȻҵĹʽͬںʹCPUĽڵȴCPUĽһ仰runable processesLoad averageΪCPUƿIJοָ꣬CPU˵CPUܲˡ

ǣLinuxе죡

Linuxϵload average˰ʹCPUĽڵȴCPUĽ֮⣬uninterruptible sleepĽͨȴIO豸ȴʱ򣬽̻ᴦuninterruptible sleep״̬Linuxߵ߼ǣuninterruptible sleepӦöǺܶݵģܿͻָУԱͬrunnableȻuninterruptible sleepʹٶҲsleepοʵuninterruptible sleepδغܶݣġʱuninterruptible sleepͨζIO豸ƿ֪sleep״̬ĽDzҪCPUģʹеCPUУsleepĽҲв˵ģsleep̵ԲʺCPUصָ꣬Linuxuninterruptible sleepload averageֱӵ߸load averageı塣Linuxϵͳϣload averageָʧȥãΪ㲻֪ʲô˼load averageܸߵʱ㲻֪runnable̫໹uninterruptible sleep̫࣬Ҳ޷жCPUûIO豸ƿ

һ˵ҲͿԽΪʲôʱʹʱCPUػ쭸ˡCPUظߵCPU̫ټжϺл̫Ƶ¸ظߣپǴ̫˲ж˯̫ർCPUظߡ

ϾDZĹdz̸ΪʲôᵼLinuxȫݣϣԴȤѿԼıվר⣬в֮ӭָлǶԱվ֧֣

  • dz̸2017Linux ʹ

    ƪҪdz̸2017Linux ʹ㣬2017Linuxʹʲôͨһ˽°ɣοľ
    2018-02-05
  • dz̸Ϊ Linux Ӱ

    ƪҪdz̸Ϊ Linux Ӱ򵥽ʹshellҷݣСûͦģһֵҪѿԲο
    2018-02-01
  • LinuxµĶ̱̺߳fork()

    ƪҪLinuxµĶ̱̺߳fork()⣬漰fork()̵߳ݣСûͦģңҪѿԲο
    2018-01-24
  • ̸̸LinuxάԱǷҪһű

    ƪҪ̸̸LinuxάԱǷҪһűԣСûͦģһֵҪѿԲο£һ𿴿ɣϣ
    2018-01-24
  • Linuxļļеķ

    ƪҪLinuxļļеķСûͦģһֵҪѿԲο¡ͺһLinuxпЧļ
    2018-01-24
  • LinuxgrepʾǰϢ

    ƪҪLinuxgrepʾǰϢܣشʾСûͦģһֵҪѿԲο
    2018-01-23
  • LinuxͨbashָȨ޵˺Ŵ

    ƪҪLinuxͨbashָȨ޵˺ţشʾСûͦģһֵҪѿԲο
    2018-01-23
  • Linux䳬ļ

    ƪҪLinux䳬ļܣ漰ncʹãشʾСûͦģһֵҪѿԲο
    2018-01-23
  • dz̸linuxһЩ

    ƪҪdz̸linuxһЩɣ Ҫԣмԭ7мݣСûͦģң
    2018-01-22
  • linux SYN

    ƪҪlinux SYN⣬СûͦģңҪѿԲο
    2018-01-22