When the box OOMs, the kernel kills the wrong thing
Under memory pressure the OOM-killer often nukes sshd or MySQL, and now you're locked out of a broken box. Protect your lifeline. Tell the kernel to kill sshd last:
— echo -1000 > /proc/$(pgrep -o sshd)/oom_score_adj
— make it permanent via a systemd drop-in: OOMScoreAdjust=-1000
Now even when PHP eats all the RAM, you can still SSH in and fix it instead of begging support to reboot. Saved me a 3am datacenter ticket. Try it tonight.
Root Access Daily
@RootAccessDaily
When the box OOMs, the kernel kills the wrong thing
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.