I'm having a problem with a Python script that chokes on a particular input file, and causes excessive memory usage. Allocated size gets up to around 96GB, and with only 32GB of physical RAM, the system quickly grinds to a halt.
After several hours (literally: the system stalled for around 23 hours the last time this happened), the OOM killer finally kicks in, but instead of just killing off the process hogging the exhausted resource, it kills off other processes too, including unrelated but important ones like ntpd, or sendmail. At this point the server has to be restarted since half the background daemons have been killed off.
Is there a way to tune the OOM killer and/or limits to ensure that:
1. The system cannot get to the point where everything stops because a single process (normal user, not background daemon, not root initiated) has exhausted a resource
and
2. The OOM killer targets only the obvious culprit
I know that limits(1) could possibly achieve this, but that seems to be more about hard per-user or per-process limits.
I'd rather some way to tell FreeBSD that the process I'm about to run has first priority for OOM killing if it exhausts memory, and to leave other processes alone. Or more broadly, kill the current user's processes before randomly killing background daemons. Is it possible?
FreeBSD 12.0
Thanks.
After several hours (literally: the system stalled for around 23 hours the last time this happened), the OOM killer finally kicks in, but instead of just killing off the process hogging the exhausted resource, it kills off other processes too, including unrelated but important ones like ntpd, or sendmail. At this point the server has to be restarted since half the background daemons have been killed off.
Is there a way to tune the OOM killer and/or limits to ensure that:
1. The system cannot get to the point where everything stops because a single process (normal user, not background daemon, not root initiated) has exhausted a resource
and
2. The OOM killer targets only the obvious culprit
I know that limits(1) could possibly achieve this, but that seems to be more about hard per-user or per-process limits.
I'd rather some way to tell FreeBSD that the process I'm about to run has first priority for OOM killing if it exhausts memory, and to leave other processes alone. Or more broadly, kill the current user's processes before randomly killing background daemons. Is it possible?
FreeBSD 12.0
Thanks.