为什么新装的 vps, load average 一直为 1

2014-03-18 13:12:23 +08:00
 interdev
新买了台vps,已优化为最小化,除了sshd 和必要的基础程序外,其他都停了,为什么 load average 一直为 1,正常应该是 0 才对。

很不解,有人知道如何解决吗?

[root@cloud ~]# free
total used free shared buffers cached
Mem: 509172 497496 11676 0 16184 105088
-/+ buffers/cache: 376224 132948
Swap: 2064376 0 2064376
[root@cloud ~]# uptime
13:11:20 up 25 min, 1 user, load average: 1.00, 0.97, 0.78
3147 次点击
所在节点    Linux
10 条回复
hadoop
2014-03-18 14:10:56 +08:00
top看一下吧
Livid
2014-03-18 14:13:24 +08:00
如果 top 里看到大量的 wa,且 swap > 0 的话,基本可以确定是内存太少了。
ScotGu
2014-03-18 14:36:38 +08:00
CPU太渣了?
thinkxen
2014-03-18 14:38:07 +08:00
是不是有坏道邻居了
interdev
2014-03-18 15:15:25 +08:00
top - 15:14:56 up 20 min, 1 user, load average: 1.00, 0.97, 0.72
Tasks: 122 total, 1 running, 121 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 509172k total, 452436k used, 56736k free, 21892k buffers
Swap: 2064376k total, 0k used, 2064376k free, 54872k cached
interdev
2014-03-18 15:16:22 +08:00
cpuid level : 13
interdev
2014-03-18 15:17:24 +08:00
cpu 不差,很奇怪。

[root@cloud ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping : 9
cpu MHz : 3392.250
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
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 mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc unfair_spin lock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c rdrand hyp ervisor lahf_lm xsaveopt fsgsbase smep erms
bogomips : 6784.50
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping : 9
cpu MHz : 3392.250
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
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 mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc unfair_spin lock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c rdrand hyp ervisor lahf_lm xsaveopt fsgsbase smep erms
bogomips : 6784.50
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
interdev
2014-03-18 15:44:21 +08:00
太怪了,vmstat 也看不出什么问题,我怀疑是母机设置不对,导致loadavg显示不正确。

[root@cloud ~]# cat /proc/loadavg
1.00 0.97 0.91 2/125 1573

[root@cloud ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 55992 21896 55448 0 0 12 3 1007 10 0 1 98 0 0
interdev
2014-03-18 15:54:01 +08:00
8楼vmstat格式不对,发个代码处女帖:

https://gist.github.com/9615396
interdev
2014-03-18 16:47:13 +08:00
经跟我一台do的vps对比,发现是system下的 in 异常高引起的 loadavg 升高。

这是问题机:
https://gist.github.com/anonymous/9615776

这是do的正常机:
https://gist.github.com/anonymous/9615818


问题:在什么情况下会导致 in 如此高? 如何解决?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/104827

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX