进入正题前先说明:OOM killer什么时候出现?

linux下允许程序申请比系统可用内存更多的内存,这个特性叫Overcommit。这样做是出于优化系统考虑,因为不是所有的程序申请了内存就立刻使用的,当你使用的时候说不定系统已经回收了一些资源了。不幸的是,当你用到这个Overcommit给你的内存的时候,系统还没有资源的话,OOM killer就跳出来了

今天外网某个游戏服无法登陆,查到mysqld进程不在了,于是查系统日志(/var/log/message)如下:

----------------------------------------------系统日志----开始---------------------------------------------

Apr 13 04:00:59 localhost kernel: Out of memory: Kill process 6033 (mysqld) score 85 or sacrifice child
Apr 13 04:00:59 localhost kernel: Killed process 6033, UID 498, (mysqld) total-vm:56872260kB, anon-rss:3202560kB, file-rss:40kB
Apr 13 09:28:37 localhost auditd[1979]: Audit daemon rotating log files

----------------------------------------------系统日志----结束---------------------------------------------

我的内存是64G,一般运行游戏服的90个进程是没问题的,而且内存还剩12个G,今天突然被OOM 杀掉,于是查了系统日志,发现 syslog-ng在作怪,日志如下:

--------------------------------syslog-ng--------------系统日志----开始---------------------------------------------

Apr 13 03:32:16 localhost kernel: syslog-ng[178936]: segfault at c06000 ip 00007f77c269a820 sp 00007f77b61f9390 error 4 in libsyslog-ng-3.6.so.0.0.0[7f77c2642000+9b000]
Apr 13 03:32:16 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:19 localhost kernel: syslog-ng[178944]: segfault at c06000 ip 00007f77c269a820 sp 00007f77bca5c390 error 4 in libsyslog-ng-3.6.so.0.0.0[7f77c2642000+9b000]
Apr 13 03:32:19 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:32 localhost kernel: syslog-ng[178960]: segfault at c0cbb0 ip 00007f77c0e4d9df sp 00007f77b6bfa2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:32:32 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:32:44 localhost kernel: syslog-ng[178973]: segfault at c06370 ip 00007f77c0e4d9df sp 00007f77bca5c2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:32:45 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'
Apr 13 03:33:02 localhost kernel: syslog-ng[178997]: segfault at c06050 ip 00007f77c0e4d9df sp 00007f779bffc2f8 error 4 in libc-2.12.so[7f77c0d1a000+18b000]
Apr 13 03:33:02 localhost supervise/syslog-ng[105636]: Daemon exited due to a deadlock/signal/failure, restarting; exitcode='11'

--------------------------------syslog-ng--------------系统日志----结束---------------------------------------------

syslog-ng 一直  restarting。所以猜测是syslog-ng内存占用过大,正好mysql要使用之前申请的系统内存时,而此时系统并没有资源,就被无情KILL了。

total -vm:个人理解是当前占用的虚拟内存。

以上是个人碰到问题收集,如果各路大神觉得有问题,记得给我留言纠正,生命不息,奋斗不止。

Out of memory: Kill process 6033 (mysqld) score 85 or sacrifice child的更多相关文章

  1. Out of memory: Kill process 25280 (php-fpm) score 86 or sacrifice child

    php-fpm 耗尽服务器内存的办法 java服务今天突然宕机,通过 cat /var/log/messages进行查看,发现是系统内存溢出导致系统把java的进程杀掉了 使用top查看系统内存使用情 ...

  2. 理解和配置Out of memory: Kill process

    转自:爱开源 理解 OOM killer 最近有位 VPS 客户抱怨 MySQL 无缘无故挂掉,还有位客户抱怨 VPS 经常死机,登陆到终端看了一下,都是常见的 Out of memory 问题.这通 ...

  3. Mongodb副本集--Out of memory: Kill process 37325 (mongod)

    1.Mongodb副本集--Out of memory: Kill process 37325 (mongod) 场景描述: 恢复一个22TB数据的mongodb实例的时候. 将备用结点加入mongo ...

  4. Out of memory: Kill process 内存不足

    服务直接被 killed,感觉特别奇怪.代码肯定是没有问题的,但为什么放到服务器上就出错了呢. 部署时报错如下: Failed to add the deployment content to the ...

  5. linux 终端报错 Out of memory: Kill process[PID] [process name] score问题分析

    从Out of memory来看是内存超出了,后面的 Kill process[PID] [process name] score好像和进程有关了,下面我们就一起来看看linux 终端报错 Out o ...

  6. Kill Process by Name

    Kill Process by Name(works in: Microsoft Windows 95/98/ME/NT/2000/XP)It is sometimes necessary to te ...

  7. Android Kill Process

    /********************************************************************** * Android Kill Process * 说明: ...

  8. [LeetCode] Kill Process 结束进程

    Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each ...

  9. 582. Kill Process杀死所有子代

    [抄题]: Given n processes, each process has a unique PID (process id) and its PPID (parent process id) ...

随机推荐

  1. chocolatey install curl and netcat

    chocolatey install curl and netcat 软件仓库 https://chocolatey.org/packages choco install curl choco ins ...

  2. 增强学习--TRPO算法

    理论部分参考 推导 数学上的分析 代码

  3. Vivado debug异常现象

    前言 bit文件和ltx文件的信号位宽不匹配问题.用了dont_touch等属性没用... WARNING: [Labtools 27-1972] Mismatch between the desig ...

  4. spring boot 简要常用配置

    # 激活开发环境 spring.profiles.active=dev spring.mvc.date-format=yyyy-MM-dd HH:mm:ss spring.http.encoding. ...

  5. centOS学习part7:Oracle开机自启配置

    0 上一章(http://www.cnblogs.com/souvenir/p/3884904.html)我们用了很多时间以及很长的篇幅来介绍oracle的整个安装过程,希望对大家用所帮助.oracl ...

  6. C# NPOI Excel 合并单元格和取消单元格

    1.合并单元操作 //合并单元格 /** 第一个参数:从第几行开始合并 第二个参数:到第几行结束合并 第三个参数:从第几列开始合并 第四个参数:到第几列结束合并 **/ CellRangeAddres ...

  7. Air for ANE:打包注意的地方

    来源:http://blog.csdn.net/hero82748274/article/details/8631982 今天遇到了一个打包ANE 文件的问题,导致花费了几个小时查找,最后师弟的一句话 ...

  8. HDFS读流程

    客户端先与NameNode通信,获取block位置信息,之后线性地先取第一个块,然后接二连三地获取,取回一个块时会进行MD5验证,验证通过后会使read顺利进行完,当最终读完所有的block块之后,拼 ...

  9. Entity framework 生成的SQL如何设置兼容低版本的数据(转载)

    来源:https://q.cnblogs.com/q/84401/ 右键 edmx 文件,有xml方式打开. 将ProviderManifestToken 改为 2008 .

  10. linux下载并安装redis

    1 到http://redis.io/download 官网下下载最新稳定的redis 2 下载的redis安装包移动到要安装的位置 3 解压安装包 tar zxvf redis-3.0.5.tar. ...