MySQL stops due to lack of memory, even though it runs at only 50% according to Virtualmin panel-

SYSTEM INFORMATION
OS type and version Ubuntu 18.0.4
Webmin version 2.0001
Virtualmin version 7.3.1
Related packages SUGGESTED

Hello,
I have a Virtualmin installation with approximately 15 domains connected to it running on a Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz, 4 cores with 8GB of memory.

I have been paying close attention to the memory usage, and it is constantly running around 50%, according to the control panel of Virtualmin.

Still, mySQL was killed a few days ago, due to lack of memory.
[Fri Dec 16 17:40:54 2022] Out of memory: Kill process 27744 (mysqld) score 58 or sacrifice child
[Fri Dec 16 17:40:54 2022] Killed process 27744 (mysqld) total-vm:2674204kB, anon-rss:314012kB, file-rss:0kB, shmem-rss:0kB
[Fri Dec 16 17:41:07 2022] Out of memory: Kill process 7671 (mysqld) score 23 or sacrifice child
[Fri Dec 16 17:41:07 2022] Killed process 7671 (mysqld) total-vm:2672404kB, anon-rss:242552kB, file-rss:0kB, shmem-rss:0kB
[Fri Dec 16 17:41:14 2022] Out of memory: Kill process 7732 (mysqld) score 19 or sacrifice child
[Fri Dec 16 17:41:14 2022] Killed process 7732 (mysqld) total-vm:2672004kB, anon-rss:197232kB, file-rss:0kB, shmem-rss:0kB

Does this mean that there is too little memory on the server, or should it be enough, seeing that it runs on 50% constantly (normally). Might there have been a special incident then that made this happen (some attack)? I saw in the mysql.cnf file that connections are bond to 127.0.0.1 (localhost).

Are there any monitoring tools I should use/can use to find out exactly what caused this, or what would be the right way to investigate and to solve this issue?

Thanks a lot for all your help.

Memory use is all processes. The process the OOM killer takes out is not necessarily the process that triggered the OOM killer. Looking exclusively at the MySQL process is not useful, you need to look at aggregate usage of all processes…if it’s going over what’s available (obviously it it), you have to either reduce usage or increase memory.

Generally you can watch top or htop for close to realtime memory usage info per process (you can sort by memory usage, so top users are first).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.