Announcement

Collapse
No announcement yet.

Linux Kernel over committing memory for application requests.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linux Kernel over committing memory for application requests.

    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.


    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
    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.

    Code:
    vm.overcommit_memory = 2
    
    vm.overcommit_ratio = 80
    Just restart the virtual machine so the changes are applied. The above changes helps to fix this issue.
    Regards,
    Sam
    System Admin

  • #2
    Re: Linux Kernel over committing memory for application requests.

    Originally posted by eukSam View Post
    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.


    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
    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.

    Code:
    vm.overcommit_memory = 2
    
    vm.overcommit_ratio = 80
    Just restart the virtual machine so the changes are applied. The above changes helps to fix this issue.
    Nice observation..but don't u think limiting memory allotment to the applications would affect their performance?

    Comment


    • #3
      Re: Linux Kernel over committing memory for application requests.

      Originally posted by DanielCzech View Post
      Nice observation..but don't u think limiting memory allotment to the applications would affect their performance?
      The value only stops over committing of memory. If your application needs more memory, you can adjust the values.
      Regards,
      Sam
      System Admin

      Comment

      Working...
      X