MySQL 5.6因为OOM导致数据库重启
发表于:2024-10-18 作者:千家信息网编辑
千家信息网最后更新 2024年10月18日,线上的一套MySQL 5.6的从库,因为OOM而导致数据库重启。# tail -50 /var/log/messagesNov 13 16:00:40 app-push-db2 kernel: Out
千家信息网最后更新 2024年10月18日MySQL 5.6因为OOM导致数据库重启
线上的一套MySQL 5.6的从库,因为OOM而导致数据库重启。
# tail -50 /var/log/messagesNov 13 16:00:40 app-push-db2 kernel: Out of memory: Kill process 26121 (mysqld) score 957 or sacrifice childNov 13 16:00:40 app-push-db2 kernel: Killed process 26121 (mysqld) total-vm:18804176kB, anon-rss:15541596kB, file-rss:0kB, shmem-rss:0kB
报错原因:
这台实例所在的服务器上面部署了单实例MySQL,物理内存为16G,分配给数据库的缓存innodb_fuffer_pool_size为12G。
# free -g total used free shared buff/cache availableMem: 15 10 0 0 5 4Swap: 0 0 0
为了提高性能,这台实例关闭了磁盘的swap交换。
# cat /etc/rc.local#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In contrast to previous versions due to parallel execution during boot# this script will NOT be run after all other services.## Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure# that this script will be executed during boot.touch /var/lock/subsys/localswapoff -a
当客户端连接多的时候,导致内存资源耗尽。
解决方法:
将innodb_buffer_pool_size调整为10G,预留出一些内存给操作系统和客户端连接。
重启数据库,使参数生效。
# grep innodb_buffer_pool /etc/my.cnfinnodb_buffer_pool_size=10G
数据
数据库
内存
实例
客户
客户端
操作系统
原因
参数
性能
所在
方法
时候
服务器
物理
磁盘
系统
缓存
资源
分配
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发备考
公开软件开发周期
网络安全简写句子
ps4如何看注册服务器
数据库应用技术 1256
数据库加密api和透明加密
齐鲁网络安全事件
网络安全与网络优化产品
软件开发中什么时候使用数组
网络安全员怎么添加网段
钱包系统如何防止数据库直接增加
联想服务器散热工程师工资怎么样
犇牛量化软件开发
吉安市网络安全在身边直播
MySQL是后端的数据库吗
未央之秋网络技术
天津室内设计软件开发
我的世界服务器挖化石
网络安全给人民带来
数据库列动态添加
舟山制造软件开发项目
2k22本世代怎么服务器连不上去了
服务器上吃外卖
万娱棋牌软件开发
网络安全策略动态编排
怎样用到TXT代替数据库
u8如何设置文件服务器
做软件开发的电脑配置
金蝶服务器维修费需要多少
天气数据存入数据库并前端展示