The out-of-swap killer makes poor choices
Olivier Certner
olivier.freebsd at free.fr
Wed Feb 24 12:02:26 UTC 2021
Hi,
> > Ok, I'll abandon this idea.
I hope you don't abandon the idea of improving the OOM killer in the long term
if you feel that something is wrong.
> I explained the reasoning for the current design, even if it actually
> evolved this way, instead being written as a whole with the stated goal.
> I do not object against adding something that would help to get it more
> fit with different goals as well, but the current idea of making the
> system survive should be kept.
So true. The main goal (system survival) does not prevent (not so) secondary
ones.
I'm sorry not to have any technical contribution to propose, but instead I
have some testimony that may interest you, although old.
2 to 3 years ago, I stumbled against production problems on servers doing
heavy computations. Only a few processes (2 generally) were doing them, and
most of the time consumed less than 1/4 of the available RAM (2 GiB). Apart
from that, no other process was allocating any significant amount of memory.
Only some base default daemons (syslogd, cron) and sshd were running.
Occasionally, very big jobs would come, and one or more of these processes
would start eating up all available memory, until FreeBSD decided that it was
time to take action.
Sometimes it would decide to kill one of these processes, but more often than
not sshd or cron were killed instead, although they were consuming ridiculous
amounts of memory. I tried tweaks via vm.pageout_oom_seq (I think I set it to
120, as Mark did) and vm.pfault_oom_attempts, without much change.
In the end, I decided to use 'protect', via rc.conf's '*_oomprotect="YES"'
facility, to workaround this problem and save me some headaches.
At some point, some of these machines had swap configured (separate AWS
disks), but later I removed swap entirely. What I report occurred for the
latter configuration, but IIRC I observed similar behavior in the former.
I have not had this use case since then, so I can't say if this has been fixed
(by commits such as r353734/d307bdcc2c473858) or not.
--
Olivier Certner
More information about the freebsd-hackers
mailing list