进入正题前先说明: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. java报错与解决方法总结

    错误 error:Syntax error, insert ")" to complete MethodDeclaration 解决办法:放到main方法里 错误原因: 错误: e ...

  2. 重置文件reset

    body { margin:0; padding:0; font-family: Helvetica, STHeiti, Droid Sans Fallback; // font-family: '微 ...

  3. mysql order by基于时间的盲注

    order by后面的注入,一般先尝试报错注入,无报错的时候可以通过rand(ture)和rand(false)来进行bool型盲注,但是今天遇到完全没有数据回显的(也就是数据库中没有数据)情况,这就 ...

  4. mtd设备操作、jffs2

    安装mtd相关命令 手动安装mtd-utils,根据系统自行选择 mtd交叉编译:https://blog.csdn.net/zhangxuechao_/article/details/5212442 ...

  5. ceph维护命令小结(基于jewel版)

    ceph osd pool 操作小计 #列出所有pool root@ceph:~# ceph osd pool ls [detail] #新建pool root@ceph:~# ceph osd po ...

  6. 常用模块(collections模块,时间模块,random模块,os模块,sys模块,序列化模块,re模块,hashlib模块,configparser模块,logging模块)

    认识模块 什么是模块? 常见的场景:一个模块就是一个包含了python定义和声明的文件,文件名就是模块名字加上.py的后缀. 但其实import加载的模块分为四个通用类别: 1 使用python编写的 ...

  7. angularcli 第四篇(执行事件)

    目录: 1.按下按钮执行事件 2.按下键盘回车“Enter”执行事件 1.按下按钮执行事件:<button  (click) = 'setName()'>......</button ...

  8. Nginx中获取真实ip地址

    location / { proxy_pass http://localhost; proxy_set_header Host $host; proxy_set_header X-Real-IP $r ...

  9. STM32移植USB驱动总结

    https://blog.csdn.net/stm32_newlearner/article/details/88095944 stm32   移植usb驱动开发 单片机 STM32单片机和51单片机 ...

  10. 一 创建一个springboot项目之(微信点餐系统的设计与开发)

    第一步:收到项目需求,进行数据库表的设计. 1.角色的划分: 卖家:  订单,类目 买家:  商品列表 2.功能模块的划分: 商品:商品列表 订单:  订单创建,订单查询,订单取消 类目:基于管理的功 ...