Hello,
In my recent observation some Linux virtual machine were frequently going down though enough memory was assigned to the virtual machine. Looking at the messages logs, on one of the virtual machine I saw following errors.
The virtual machines was getting rebooted randomly at any time due to these "oom-killer" process. The virtual machine going down was a strange thing as sometimes the uptime was for a week or a month & sometimes it went down twice or thrice in a day.
Applications running on a virtual machine needs memory & kernel does the job to assign memory to these applications when ever the applications needs memory. The main problem here is that the kernel never checks if there is enough memory available on the virtual machine & provides memory to the applications. In other words we can say that the Linux kernel is over committing memory to the applications running under it which results in virtual machine crash. To avoid this we have to limit the memory over commit by the kernel which can be done by adding following values to /etc/sysctl.conf on the virtual machine.
Just restart the virtual machine so the changes are applied. The above changes helps to fix this issue.
In my recent observation some Linux virtual machine were frequently going down though enough memory was assigned to the virtual machine. Looking at the messages logs, on one of the virtual machine I saw following errors.
Code:
cloudvps kernel: php invoked oom-killer: gfp_mask=0x200da, order=0, oom_adj=0, oom_score_adj=0 cloudvps kernel: [<ffffffff8111400a>] ? oom_kill_process+0x8a/0x2c0 cloudvps kernel: [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
Applications running on a virtual machine needs memory & kernel does the job to assign memory to these applications when ever the applications needs memory. The main problem here is that the kernel never checks if there is enough memory available on the virtual machine & provides memory to the applications. In other words we can say that the Linux kernel is over committing memory to the applications running under it which results in virtual machine crash. To avoid this we have to limit the memory over commit by the kernel which can be done by adding following values to /etc/sysctl.conf on the virtual machine.
Code:
vm.overcommit_memory = 2 vm.overcommit_ratio = 80
Comment