大鸟上撒点盐,生活才能多姿多彩。

Setting vm.swappiness=0 on RHEL 6.4 - 6.7 can cause OOM conditions.

Setting vm.swappiness=0 on RHEL 6.4 – 6.7 can cause OOM conditions.

Solution Verified – UpdatedJanuary 12 2017 at 1:27 AM-

Environment

  • Red Hat Enterprise Linux 6.4
  • Red Hat Enterprise Linux 6.5
  • Red Hat Enterprise Linux 6.6
  • Red Hat Enterprise Linux 6.7

    • A subsequent commit avoids this problem in RHEL7.

Issue

  • Setting vm.swappiness=0 on RHEL6.4 and later releases can result in applications like IBM DB2 which require a lot of memory, experience an OOM termination condition even though swap is not being used and memory does not appear to be actually exhausted.
  • If the option is set to crash on OOM, a system interruption can occur.

Resolution

  • Upgrade to kernel-2.6.32-642.el6 via errata: RHSA-2016-0855 or later.

Workaround

  • Setting the value of sysctl parameter vm.swappiness to “1” can workaround this issue.
  • This can be set using the following procedures:

Temporary – Lost across a reboot

Raw

Permanent

Raw

Root Cause

  • This bug is an effect of upstream kernel commit id:fe35004fbf9eaf67482b074a2e032abb9c89b1dd
  • Commitfe35004fbf9eaf67482b074a2e032abb9c89b1ddwas implemented in kernel to allow vm.swappiness to be set to 0. This was to avoid a situation where when set to 0 in previous releases, it would still swap. The change was to ensure that no swapping would occur.
  • The problem is, when memory is low but not exhausted, this change can cause the kernel to not find pages to free up in the zones even though many free pages exist. consequently, tasks can experience Out Of Memory conditions.
Raw

  • Subsequent changes:
Raw

Diagnostic Steps

  • Check via one of the of the following methods:

    • cat /proc/sys/vm/swappiness
    • sysctl vm.swappiness
    • (via crash) vm_swappiness

点赞

发表评论