Oom

From Wiki

Jump to: navigation, search

Contents

OOM - Out of Memory

Am oom refers to both RAM and SWAP all been used up. It pretty much cripples the server. By default an oom_killer kicks in and should kill the offending process. However with a lamp stack (MySQL and Apache) oom_killer does not do a good job (in my opinion).

99% of the time, I had to do a hard reboot on the server as the console was not responding.

If an OOM does not happen often, you can simply tell the server to reboot on oom.

Reboot Server on OOM

vi /etc/sysctl.conf
#Add the following
vm.panic_on_oom=1
kernel.panic=10
#60 = wait 60 seconds before rebooting.

To put it into immediate effect

echo 1 > /proc/sys/vm/panic_on_oom
echo 60 > /proc/sys/kernel/panic

References

http://www.linode.com/wiki/index.php/Rebooting_on_OOM

https://syslog.tv/2011/10/25/rebooting-on-oom/

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_MRG/1.3/html/Realtime_Tuning_Guide/sect-Realtime_Tuning_Guide-General_System_Tuning-Swapping_and_Out_Of_Memory_Tips.html

Personal tools