最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【整理】系统平均负载中的数值含义解析

Linux crifan 3326浏览 0评论

在看探针的显示内容中有个:

系统平均负载

想要知道

系统平均负载

中的数字的含义

系统平均负载 linux

入门:查看Linux系统的平均负载_Linux教程_Linux公社-Linux系统门户网站

关于Linux系统的平均负载最全面介绍-loughsky-ChinaUnix博客

linux系统平均负载的深度理解 – 知乎专栏

【总结】

此处输出的内容是:

系统平均负载
0.16 0.11 0.09 2/228

对应的是:

  • 系统平均负载 
    • 在过去的1分钟内运行队列中的平均进程数量
    • 在过去的5分钟内运行队列中的平均进程数量
    • 在过去的15分钟内运行队列中的平均进程数量
    • 正在运行的进程数/进程总数

(1)输出的数据的原意

对于这些数据,如何理解其中的含义:

因为时间长点的范围的平均值才有参考价值,所以一般来说主要看后面2个数字(5分钟和15分钟平均进程数),这些值的含义为:

需要换算为单核负载的值之后,才容易理解含义:

0.00-1.00 之间的数字表示系统运行很稳定,系统任务在有条不紊的运行,系统很流畅。

1.00 表示系统任务已经饱和,如果再有新的人物就会造成拥堵,可以说CPU,内存等已经满负荷运转。

1.00-无穷大表示CPU任务已经拥堵机器的反应就是会卡,从外部访问就有可能会没有响应。

一般来所:单核负载在0.7以下是安全的,超过0.7就需要进行优化了

对应着用图形解释便于理解含义:

单核:

双核:

(2)CPU内核数

想要把数值换算为单核负债,就需要先去了解CPU的内核数量,可以通过:

[root@crifan www.crifan.com]# grep ‘model name’ /proc/cpuinfo | wc -l
2

得知此处是2核

(3)此处的值的含义解析

所以前面的值换算后为:

  • 1分钟的平均负载:0.16
    • 换算为单核负载:0.16/2=0.08
  • 5分钟的平均负载:0.11
    • 换算为单核负载:0.11/2=0.055
  • 15分钟的平均负载:0.09
    • 换算为单核负载:0.09/2=0.045

-》所以5分钟和15分钟的平均单核负载都在0.1以下

-》说明系统非常流畅,CPU的能力被使用了10%都不到

-》而(万一那天)如果5分钟和15分钟的平均单核负载都达到0.7左右的话,就需要考虑去优化系统的资源使用,或者是升级(此处的Linode的VPS的套餐的)硬件配置了。

(4)其他可以看到系统负载的命令:

(a)cat /proc/loadavg

[root@crifan www.crifan.com]# cat /proc/loadavg
0.07 0.09 0.09 1/229 21153

对应的是,最后一行多了个21153,表示

  • 最近运行的进程ID号

(b)uptime

[root@crifan www.crifan.com]# uptime
10:10:57 up 1 day, 13:33,  1 user,  load average: 0.11, 0.11, 0.09

(c)w

[root@crifan www.crifan.com]# w
10:13:04 up 1 day, 13:35,  1 user,  load average: 0.03, 0.08, 0.08
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/1    58.209.166.54    09:34    0.00s  0.01s  0.00s w

(d)top

(e)tload

0.01, 0.06, 0.08

(5)想要查看更详细的CPU信息,可以通过:

cat /proc/cpuinfo

看到:

[root@crifan www.crifan.com]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz
stepping        : 1
microcode       : 0x1
cpu MHz         : 2299.998
cache size      : 4096 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
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 mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat
bugs            :
bogomips        : 4601.66
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           : 79
model name      : Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz
stepping        : 1
microcode       : 0x1
cpu MHz         : 2299.998
cache size      : 4096 KB
physical id     : 1
siblings        : 1
core id         : 0
cpu cores       : 1
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 mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat
bugs            :
bogomips        : 4601.66
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

其中有2个model name,所以是2核,每个都是Intel Xeon的E5

转载请注明:在路上 » 【整理】系统平均负载中的数值含义解析

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.167 seconds, using 22.16MB memory