求助贴: Centos 经常 OOM 是怎么回事?

2016-07-13 11:01:28 +08:00
 milespong
大体配置如下:

➜ ~ # free -lmh
total used free shared buffers cached
Mem: 1.0G 639M 366M 30M 187M 184M
Low: 868M 501M 366M
High: 138M 137M 252K
-/+ buffers/cache: 267M 739M
Swap: 2.0G 0B 2.0G

➜ ~ $ uname -ri
2.6.32-642.1.1.el6.i686 i386

➜ ~ $ cat /etc/centos-release
CentOS release 6.8 (Final)

serverSpeeder version 3.10.66.29
vm.lowmem_reserve_ratio = 256 512 32

Part of installed services or processes:

- google-drive-ocamlfuse
- bpcs_uploader
- LNMP
- gogs
- ss-python

相关日志和信息请移步

/var/log/messages:
https://gist.github.com/MilesPong/173611a702660f9e7cb1da6154efe63a#file-messages
/proc/meminfo:
https://gist.github.com/MilesPong/173611a702660f9e7cb1da6154efe63a#file-meminfo
/proc/zoninfo:
https://gist.github.com/MilesPong/173611a702660f9e7cb1da6154efe63a#file-zoneinfo

---

请问如何正确配置才能避免 OOM 的出现?还是说内存已经就是瓶颈,再怎么优化配置没有用?

---

晕~gist 显示不正常,完整的gist在这里
https://gist.github.com/MilesPong/173611a702660f9e7cb1da6154efe63a

锚点分别是
#file-messages
#file-meminfo
#file-zoneinfo
3262 次点击
所在节点    Linux
8 条回复
defunct9
2016-07-13 11:45:49 +08:00
1G 内存,应该够用了
defunct9
2016-07-13 11:47:41 +08:00
优化一下 nginx 和 php-fpm 吧
raysonx
2016-07-13 11:53:03 +08:00
物理机还是 VPS ?如果是 VPS 可能是 VPS 超售了
milespong
2016-07-13 12:36:04 +08:00
@defunct9 那么问题真的是在 Nginx 和 php 吗?
@raysonx VPS 啊 超售会导致 oom ?
raysonx
2016-07-13 12:48:44 +08:00
@milespong 当宿主机上的实际可用内存不足时就会发生
milespong
2016-07-13 12:59:56 +08:00
@raysonx 我的是 conoha ,没听过有相关超售的新闻,而且也判断不出来吧?
milespong
2016-07-13 13:00:11 +08:00
这个 oom 困扰我好久了,最长时间是将近一个月才来一次,频繁点就是三两天抽风一次,还望有会内存优化的大神指点一下。。
defunct9
2016-07-13 13:10:18 +08:00
1G 小优化即可。我的 vps 256m 的,无法优化,只能换成 debian

两个脚本

http://www.lowendtalk.com/discussion/comment/846721/

https://github.com/Xeoncross/lowendscript

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

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

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

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

© 2021 V2EX