新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL5.6因為OOM導(dǎo)致數(shù)據(jù)庫重啟
線上的一套MySQL 5.6的從庫,因為OOM而導(dǎo)致數(shù)據(jù)庫重啟。

成都創(chuàng)新互聯(lián)公司長期為近千家客戶提供的網(wǎng)站建設(shè)服務(wù),團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為尖草坪企業(yè)提供專業(yè)的網(wǎng)站制作、成都網(wǎng)站設(shè)計,尖草坪網(wǎng)站改版等技術(shù)服務(wù)。擁有10余年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。
# tail -50 /var/log/messages Nov 13 16:00:40 app-push-db2 kernel: Out of memory: Kill process 26121 (mysqld) score 957 or sacrifice child Nov 13 16:00:40 app-push-db2 kernel: Killed process 26121 (mysqld) total-vm:18804176kB, anon-rss:15541596kB, file-rss:0kB, shmem-rss:0kB
報錯原因:
這臺實例所在的服務(wù)器上面部署了單實例MySQL,物理內(nèi)存為16G,分配給數(shù)據(jù)庫的緩存innodb_fuffer_pool_size為12G。
# free -g total used free shared buff/cache available Mem: 15 10 0 0 5 4 Swap: 0 0 0
為了提高性能,這臺實例關(guān)閉了磁盤的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/local swapoff -a
當客戶端連接多的時候,導(dǎo)致內(nèi)存資源耗盡。
解決方法:
將innodb_buffer_pool_size調(diào)整為10G,預(yù)留出一些內(nèi)存給操作系統(tǒng)和客戶端連接。
重啟數(shù)據(jù)庫,使參數(shù)生效。
# grep innodb_buffer_pool /etc/my.cnf innodb_buffer_pool_size=10G
網(wǎng)頁標題:MySQL5.6因為OOM導(dǎo)致數(shù)據(jù)庫重啟
分享鏈接:http://fisionsoft.com.cn/article/ihedog.html


咨詢
建站咨詢
