From 94ec35ff2d5363d3816f6d267a77a4efba6c6aa8 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Wed, 14 Apr 2021 23:28:03 -0400 Subject: [PATCH] Increase min_free_kbytes to 256M for storage to avoid OOM issue Help to prevent the OOM issue that it failed to allocate memory with error message 'page allocation failure: order:2, mode:0x104020' As the min_free_kbytes in the linux documentation shows: This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a watermark[WMARK_MIN] value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Keeping more memory free in those zones means that the os itself is less likely to run out of memory during high memory pressure and high allocation events. Based on the issue occurs on the storage node so far, we only update the value for the storage node. Closes-Bug: #1924209 Change-Id: Iae2e5a0787f69c62ba5da53663371fd2be148e15 Signed-off-by: Zhixiong Chi --- .../src/modules/platform/manifests/sysctl.pp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/puppet-manifests/src/modules/platform/manifests/sysctl.pp b/puppet-manifests/src/modules/platform/manifests/sysctl.pp index 8b1bf1c97..8c56c0193 100644 --- a/puppet-manifests/src/modules/platform/manifests/sysctl.pp +++ b/puppet-manifests/src/modules/platform/manifests/sysctl.pp @@ -10,11 +10,6 @@ class platform::sysctl $ip_version = $::platform::network::mgmt::params::subnet_version - # Increase min_free_kbytes to 128 MiB from 88 MiB, helps prevent OOM - sysctl::value { 'vm.min_free_kbytes': - value => '131072' - } - # Set sched_nr_migrate to standard linux default sysctl::value { 'kernel.sched_nr_migrate': value => '8', @@ -119,6 +114,11 @@ class platform::sysctl::controller include ::platform::sysctl include ::platform::sysctl::controller::reserve_ports + # Increase min_free_kbytes to 128 MiB from 88 MiB, helps prevent OOM + sysctl::value { 'vm.min_free_kbytes': + value => '131072' + } + # Engineer VM page cache tunables to prevent significant IO delays that may # occur if we flush a buildup of dirty pages. Engineer VM settings to make # writebacks more regular. Note that Linux default proportion of page cache that @@ -164,11 +164,21 @@ class platform::sysctl::controller class platform::sysctl::compute { include ::platform::sysctl + + # Increase min_free_kbytes to 128 MiB from 88 MiB, helps prevent OOM + sysctl::value { 'vm.min_free_kbytes': + value => '131072' + } } class platform::sysctl::storage { include ::platform::sysctl + + # Increase min_free_kbytes to 256 MiB for storage node, helps prevent OOM + sysctl::value { 'vm.min_free_kbytes': + value => '262144' + } }