Post by @meowski@fluf.club

mcc
@mcc @mastodon.social

I have 2 Linux VPSes running Apache. Over the years, system upgrades have switched everything to systemd out from under me and some of my prior sysadmin knowledge is no longer correct.

I have been having for the last few weeks a problem where apache will simply quit. Nothing in the error.log, nothing that looks relevant in journalctl. No error I've seen. The page isn't loaded, I check, apache is not loaded.

The VPSes are low-resource, so the most obvious conclusion is "OOMkiller did it"

(1/2)

Replying to @mcc@mastodon.social
mcc
@mcc @mastodon.social

I discover that for some reason (!?!?!??) OOMkills are not logged in journalctl; they are logged in dmesg. I look in dmesg. I find lots of oomkill messages saying they killed mysql. Not apache, mysql.

I look in the .service files. mysql is Restart=on-failure and apache is Restart=on-abort.

I think what I want to do is change apache to Restart=on-failure. However now I am afraid of "oom fights" where apache and mysql get in a loop of killing each other when they start up.

(2/3)

Replying to @mcc@mastodon.social
Red Rozenglass
@rozenglass @fedi.dreamscape.link
@mcc@mastodon.social Both MySQL and Apache can be configured to limit themselves to less memory usage I think, might allow them to be more conservative and efficient in their internal allocations if they know ahead of time that they have a small amount of heap memory / workers / connections allowed. Perhaps better than processess dying and restarting all the time, but you know your use-case better of course.
woodland creature
@meowski @fluf.club
@rozenglass @mcc there are tools like this: https://database.gkanev.com/ that can help you optimize mysql memory usage for your system
Replying to @meowski@fluf.club
Red Rozenglass
@rozenglass @fedi.dreamscape.link
@mcc@mastodon.social @meowski@fluf.club
https://database.gkanev.com
Thanks, I'll take a look at that config generator myself~