StarlingX Puppet modules and manifests
Go to file
Jim Somerville 6b64fc782a set sysvar vm_min_free_kbytes as function of total mem
Problem description:
During times of high memory pressure, the kernel will drop
into synchronous memory allocation mode if the amount of free
memory in the normal zone drops below the min watermark.
Synchronous mode reclaims some memory before allocating any,
and is thus vastly slower than asynchronous mode. If under high
memory pressure we drop to synchronous mode, and there's a lot
of memory allocation requests being made ie. contention for
locks in the memory allocator, and one of the tasks contending
is being monitored by pmon, then it can be blocked long enough
to trigger a watchdog timeout which brings down the entire node.

Solution:
One way to reduce the chances of dropping below the min
watermark in the normal zone is to increase the amount of
kernel reserved memory via sysctl variable vm_min_free_kbytes.
The three watermarks, min, low, and high are all calculated and
set by the kernel based on the amount of kernel reserved memory.
While all three of the watermarks will be increased, the spread
between them will also be increased.  When the number of pages
in the zone drops below low, the kswapd will run and reclaim
pages (typically from the buffer cache) until the high
watermark is met.  This operates a lot like a water pressure
tank.  So by increasing the amount of kernel reserved memory,
kswapd should engage sooner and thus increase the odds that
we don't hit the min watermark.

Currently the amount of kernel reserved memory is set statically
to 128 MB except on a storage node where we set it to 256 MB.
This is really too low on systems with a lot of memory.  It
should be set as a function of total system memory.  There are
many possibilities for such a function, such as just setting it
to a percentage of total memory such as 0.5% or 1% as examples.

Here we take a quantum approach to the function, reserving
128 MB for every 25 GB of system memory, with also a minimum
amount specified that we won't go below.  This is approximately
0.5% based on the step function.  Why this approach?  Because it
has no impact on typical small vbox nodes used in development.
Those nodes are typically around 25 GB in size, and it isn't
a great idea to be reclaiming pages from the buffer cache just
to have them sit unused, as these small emulated nodes need all
i/o performance help they can get.

This approach to the function is not absolute and is subject to
change as we learn more about how to best tune the settings.

Change-Id: I6244497b262c217dc9467010501a3041e102a288
Closes-Bug: 1940855
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
2021-08-31 13:35:33 -04:00
modules Add active_alarm audit interval value 2021-08-09 09:45:04 -04:00
playbooks/tox-puppet-lint Fix puppet-lint errors 2019-10-09 15:39:30 -05:00
puppet-manifests set sysvar vm_min_free_kbytes as function of total mem 2021-08-31 13:35:33 -04:00
.gitignore Adding zuul jobs for new repo 2019-09-09 14:52:12 -05:00
.gitreview Add a .gitreview file to the new repo 2019-09-09 09:45:59 -05:00
.zuul.yaml Tox and Zuul job for the bandit code scan in stx/stx-puppet 2020-05-19 14:08:03 +00:00
bindep.txt Add bindep target to tox 2021-02-19 12:14:38 -06:00
centos_build_layer.cfg Build layering, add layer build config file 2019-10-15 19:16:17 +08:00
centos_iso_image.inc Config file changes to add 'puppet-manifests modules/puppet-dcdbsync modules/puppet-dcmanager modules/puppet-dcorch modules/puppet-fm modules/puppet-mtce modules/puppet-nfv modules/puppet-patching modules/puppet-smapi modules/puppet-sshd modules/puppet-sysinv ' after relocation from 'stx-config' 2019-09-04 11:07:06 -04:00
centos_pkg_dirs Config file changes to add 'puppet-manifests modules/puppet-dcdbsync modules/puppet-dcmanager modules/puppet-dcorch modules/puppet-fm modules/puppet-mtce modules/puppet-nfv modules/puppet-patching modules/puppet-smapi modules/puppet-sshd modules/puppet-sysinv ' after relocation from 'stx-config' 2019-09-04 11:07:06 -04:00
CONTRIBUTING.rst Adding zuul jobs for new repo 2019-09-09 14:52:12 -05:00
HACKING.rst Adding zuul jobs for new repo 2019-09-09 14:52:12 -05:00
pylint.rc Support post-bootstrap config of kube-apiserver parameters 2020-03-10 11:19:19 -04:00
requirements.txt Adding zuul jobs for new repo 2019-09-09 14:52:12 -05:00
test-requirements.txt Calling an additional shell lint command from zuul 2021-06-03 09:42:07 -05:00
tox.ini Calling an additional shell lint command from zuul 2021-06-03 09:42:07 -05:00