Mysql keeps crashing on my 2 core server with 4GB RAM.

Muneeb_07

Member
Nov 24, 2021
5
2
3
J & k
cPanel Access Level
Root Administrator
Hello everyone ! I have a server with CENTOS 7.9 installed having 2 cores and 4 Gb of RAM. Every hour or so , the mysql server crashes and restarts automatically. I logged in the errors but the error log doesn't seem to give any clue. I'm using a wordpress site on the server and the site has around 700K - 1M traffic monthly. This problem came up recently and the site was working fine before that. Any suggestions that can help?
 
  • Like
Reactions: cPanelAnthony

quietFinn

Well-Known Member
Feb 4, 2006
1,394
178
193
Finland
cPanel Access Level
Root Administrator
I kept a eye on server today and for the most part of the day server load was below 2 but sometimes the server load spiked up and it crashed the MYSQL server.
I think it's the memory usage you should be looking at :rolleyes:
 

RoseHosting

Active Member
PartnerNOC
Jan 3, 2003
33
7
158
You can run this command to make sure that OOM killer is killing your MySQL service:
Code:
dmesg -T | grep -i 'killed process'
And if that's the case, you would want to consider upgrading your RAM
 
  • Like
Reactions: Muneeb_07

Muneeb_07

Member
Nov 24, 2021
5
2
3
J & k
cPanel Access Level
Root Administrator
You can run this command to make sure that OOM killer is killing your MySQL service:
Code:
dmesg -T | grep -i 'killed process'
And if that's the case, you would want to consider upgrading your RAM
Here is the result of the command.
Code:
[Thu Nov 25 07:44:47 2021] Killed process 23924 (clamd), UID 0, total-vm:1445580kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:45:52 2021] Killed process 23366 (mysqld), UID 27, total-vm:1478188kB, anon-rss:103056kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:45:53 2021] Killed process 24240 (php-cgi), UID 1004, total-vm:407804kB, anon-rss:17504kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:46:09 2021] Killed process 24368 (php-cgi), UID 1004, total-vm:407532kB, anon-rss:11176kB, file-rss:1240kB, shmem-rss:0kB
[Thu Nov 25 07:49:04 2021] Killed process 25753 (clamd), UID 0, total-vm:677384kB, anon-rss:29448kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:49:36 2021] Killed process 25763 (mysqld), UID 27, total-vm:1473380kB, anon-rss:105464kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:49:38 2021] Killed process 25918 (php-cgi), UID 1004, total-vm:407984kB, anon-rss:10520kB, file-rss:388kB, shmem-rss:0kB
[Thu Nov 25 07:49:47 2021] Killed process 25909 (php-cgi), UID 1004, total-vm:407996kB, anon-rss:15428kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:57:26 2021] Killed process 29066 (clamd), UID 0, total-vm:1445580kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:58:23 2021] Killed process 27641 (mysqld), UID 27, total-vm:1471328kB, anon-rss:98420kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:58:24 2021] Killed process 27711 (mysqld), UID 27, total-vm:1471328kB, anon-rss:98512kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:58:24 2021] Killed process 27723 (mysqld), UID 27, total-vm:1471328kB, anon-rss:98644kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:58:33 2021] Killed process 28628 (spamd child), UID 0, total-vm:258064kB, anon-rss:284kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 07:58:34 2021] Killed process 28629 (spamd child), UID 0, total-vm:246272kB, anon-rss:396kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:02:27 2021] Killed process 31124 (clamd), UID 0, total-vm:1445580kB, anon-rss:3420kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:02:45 2021] Killed process 30894 (clamd), UID 0, total-vm:1362032kB, anon-rss:186420kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:03:23 2021] Killed process 30281 (mysqld), UID 27, total-vm:1470540kB, anon-rss:58580kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:05:14 2021] Killed process 31807 (mysqld), UID 27, total-vm:1494308kB, anon-rss:109332kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:07:06 2021] Killed process 32753 (mysqld), UID 27, total-vm:1464960kB, anon-rss:130536kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:17:07 2021] Killed process 1594 (clamd), UID 0, total-vm:1519312kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:17:54 2021] Killed process 1000 (mysqld), UID 27, total-vm:1479524kB, anon-rss:69460kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:18:02 2021] Killed process 30249 (spamd child), UID 0, total-vm:258736kB, anon-rss:272kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:18:05 2021] Killed process 30252 (spamd child), UID 0, total-vm:245188kB, anon-rss:508kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:18:05 2021] Killed process 24062 (spamd), UID 0, total-vm:245188kB, anon-rss:1324kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:23:46 2021] Killed process 4887 (clamd), UID 0, total-vm:1445580kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:24:29 2021] Killed process 4052 (mysqld), UID 27, total-vm:1470896kB, anon-rss:67204kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:39:29 2021] Killed process 7218 (clamd), UID 0, total-vm:1445580kB, anon-rss:20kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:39:29 2021] Killed process 7219 (clamd), UID 0, total-vm:1445580kB, anon-rss:60kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 08:39:56 2021] Killed process 5818 (mysqld), UID 27, total-vm:1468036kB, anon-rss:93760kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:07:55 2021] Killed process 11223 (clamd), UID 0, total-vm:1445580kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:08:30 2021] Killed process 10044 (mysqld), UID 27, total-vm:1469392kB, anon-rss:87208kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:12:30 2021] Killed process 16790 (clamd), UID 0, total-vm:1445580kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:12:55 2021] Killed process 16087 (mysqld), UID 27, total-vm:1480020kB, anon-rss:34444kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:13:00 2021] Killed process 6597 (spamd child), UID 0, total-vm:246288kB, anon-rss:704kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:13:04 2021] Killed process 6599 (spamd child), UID 0, total-vm:246260kB, anon-rss:608kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:13:06 2021] Killed process 4592 (spamd), UID 0, total-vm:245168kB, anon-rss:1740kB, file-rss:0kB, shmem-rss:0kB
[Thu Nov 25 09:33:01 2021] Killed process 19532 (clamd), UID 0, total-vm:1519312kB, anon-rss:0kB, file-rss:164kB, shmem-rss:0kB
[Thu Nov 25 09:33:45 2021] Killed process 17906 (mysqld), UID 27, total-vm:1469652kB, anon-rss:114004kB, file-rss:0kB, shmem-rss:0kB
 

RoseHosting

Active Member
PartnerNOC
Jan 3, 2003
33
7
158
Did you upgrade your RAM? It is obvious that some of the services are killed by OOM killer, it means your server needs more RAM.
Pay more attention to MySQL service, if OOM killer keeps killing it, it will subsequently cause a non-recoverable database corruption.
The problem is still not solved. Any one there to help?