Your database keeps disappearing overnight, and the only clue is a kernel line saying “Out of memory: Killed process”. Here’s how to protect it using choom, OOMScoreAdjust, MemoryMax, a swap file, and systemd-oomd.
Imagine you check a server in the morning and find that MariaDB stopped at 2 AM, even though nothing changed in its configuration. The service restarts fine, the logs from MariaDB itself show nothing useful, and a few nights later it happens again.
When you finally look at the kernel log, you find that the Linux OOM killer (Out-Of-Memory killer) ended the database process because the server ran out of RAM.
What makes this confusing is that MariaDB usually wasn’t the program that used up the memory. A PHP worker, a runaway script, or a backup job asked for more memory than the server had, and the kernel picked the largest process it could find to free memory quickly, which on most servers is the database.