3 ms·
The most annoying thing about OOM is when a process goes crazy and starts using a lot of memory, the OOM killer looks at the system and sees that process is rea
by linsomniac 7y ago
The most annoying thing about OOM is when a process goes crazy and starts using a lot of memory, the OOM killer looks at the system and sees that process is really active, so it kills mysql/ssh/apache/postgres to make room for the run away.
I've set up monitoring that pages me when "dmesg" includes "OOM".
- punnerud 7y agoApple have solved some of it by limiting the maximum number of processes before the user get a warning and have to close some of the old. Not sure if they handle memory any better, from my experience; no.
- mort96 7y agoIf there's one process going crazy and using tonnes of memory, what does a maximum number of processes help? We're not talking about a forkbomb here, just one rogue process.
- isodude 7y agoYou can actually adjust the oom_score on those long lived important processes to hinder OOM to kill them.
- linsomniac 7y agoAnd I've always meant to go in and set SSH to be immune to OOM, and deprioritizing others like databases, but I've just never gotten around to it. Looks like oomd could be useful, once we get to kernels that support it in production (looks like 4.20, Ubuntu 18.04 has 4.15).
- isodude 7y agoAnother interesting aspect is to set SSH to realtime. When you log in you set it non-realtime if you work is not important to avoid sinking the server into oblivion by a simple command. It is possible to do when you have shared servers as well, by letting root log in to another port instead and setting that process to realtime instead. Thoughts in my head but never got around to do it.
- kasabali 7y agoTry setting vm.oom_kill_allocating_task. I find it more useful than the default behavior and it seems to be closer to what you want.