Help a hobbyist: How do I diagnose "Out of memory: Killed process" freezes? (original) (raw)
December 5, 2024, 11:30pm 1
Background: During covid lockdown, in a fit of hyperfixation, I learned Linux and built a CentOS web server all in one go. I since had to return to my day job, but I periodically add new websites to my server, and I love having the freedom and control to run my own instance. (It’s running on a VPS on Vultr, if that matters.)
Periodically, maybe a couple times a day? I get a string of errors that say " Out of memory: Killed process ####" and my server freezes.
Not generally a big deal, since I am running a bunch of websites for myself (my band, my writing), none of them are paying clients, none of them get very much traffic — all hobbyist stuff. I usually just reset the server from the Vultr page and that’s that.
My question is: How do I diagnose what causes this? If it’s just a matter of needing more memory, I will upgrade my VPS. But if it’s a bug somewhere, or an error in my setup, I’d rather fix it than resort to “throwing money at it.”
I don’t want someone to step in and fix it for me, I want to learn how to do it myself. But I have googled around a little about this without finding any step-by-step instructions.
Screenshot attached…
Any and all help is greatly appreciated!
barryascott (Barry A Scott) December 6, 2024, 9:25am 2
Please post text as pre-formatted text not screen shots, using the </>
button.
You can see that mysqld is being killed. That is because it used lots of memory.
Your server needs more memory to run the work load you put on it I assume. Or maybe you need to tune mysqld to use less memory.
My guess is you have been adding web services without increasing the resources of your VM.
oceanjeremy (Jeremy Yocum) December 6, 2024, 4:42pm 3
Sorry for the screenshot faux pas! Will post code next time.
This is very helpful and gave me exactly what I need to move forward (i.e., 1: upgrade RAM, 2: tune mysqld, or 3: a combination of both).
A quick Google search tells me that disabling MySQL Performance Schema can solve the problem outright, so I’m going to try there and see if it persists.
Thanks so much!
barryascott (Barry A Scott) December 6, 2024, 4:56pm 4
Fyi there is a solution button on each reply you can use instead of editing the title. It is the like icon.
oceanjeremy (Jeremy Yocum) December 6, 2024, 5:05pm 5
Whoo boy, I’m rusty at using the forums. Thanks, and apologies again for any faux pas.
barryascott (Barry A Scott) December 6, 2024, 5:12pm 6
Go on then tick the reply with the solution