Post by @pmarheine@digipres.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
mcc
@mcc @mastodon.social

I *think* this is how I avoid "oomkill fights"

redhat.com/en/blog/systemd-aut

But I am wondering if there is any better way to get and view coherent logs/reports about oomkills. I think I could make something like this by writing a python script that scans dmesg at all times and gives me a daily report like "mysql oomkilled 8 times today, apache2 once". It seems like something that might exist already (but if it's vibecoded, I'd rather write the python script myself). (3/3)

Replying to @mcc@mastodon.social
Peter Marheine
@pmarheine @digipres.club

@mcc /proc/vmstat has a line `oom_kills` counting the number of OOM kills since boot.

mcc
@mcc @mastodon.social

@pmarheine OMG thank you so much

$ cat /proc/vmstat | grep oom
oom_kill 99

Hannibel Burress ha ha man this sucks.gif

Replying to @mcc@mastodon.social
Noxie :butterfly_lesbian:
@Noxie @eldritch.cafe

@mcc the zodiac killer would be proud 🥲
@pmarheine

Replying to @mcc@mastodon.social
Lee Leighton
@leel8on @mastodon.social

@mcc @pmarheine 99 problems but a running process ain't one