After reading another topic about the same issue, @Joe asked me to create a new topic.
The command dmesg give me a tons of info but I didn’t see MariaDB with an error. Do I have to run the command when MariaDB is stopped?
I saw different OOM Kill Process, like Systemd-journal or php-cgi8.2.
Also this line at the end:
File /run/log/journal/0ef30511d74646618d92e464efb187ce/system.journal corrupted or uncleanly shut down, renaming and replacing.
[5019071.191809] systemd[1]: Started Journal Service.
You don’t have enough memory. (We have to assume Mariadb is also being killed by the OOM killer. The OOM killer appears random to users, though there is a heuristic for trying to kill the least active process that frees enough memory to avoid worse problems. An out-of-memory condition is a disastrous condition. There’s nothing good the kernel can do in that circumstance, so killing processes to free up memory is a compromise.)
You either need to reduce memory usage, or increase memory.
You can, as a stopgap measure, add swap memory to the system, to stop the OOM killer. Swap is very slow compared to real memory, but software that isn’t even running is the slowest software.
I have 8GB.
My Wordpress websites are not very big tho. I have 9 actives for now. I guess that a plugin is taking more memory than it should…
Is there a way to know more detail what happens exactly? to know if it’s a plugin or a different service running.
Seems very likely something is misbehaving. 8GB is probably fine for a few WordPress sites.
Assuming you haven’t wildly altered the Mariadb or PHP configuration to consume a lot more memory. And, assuming you don’t have mod_php installed (mod_php is a big memory user, even if you aren’t using it).
top is where I usually start. You can sort by memory (press M, that’s <shift>-m).
restarting a stopped service is OK - but you should really resolve what is causing it to stop. Find and fix the bug (lazy code) in the code that is causing it. The problem will not go away you are just trying to hide it.
Automatically restarting a service that is randomly being killed by the OOM killer guarantees that some day you’ll have data loss.
Safer to add a bunch of swap memory (like twice your current memory) until you figure out why you’re running out. (Though if you still run out after doubling available memory, it’s something truly pathological going wrong, and it should be apparent what it is if you spend a few minutes looking at what’s using memory.)