ctdb-scripts: Drop script configuration variable CTDB_MONITOR_SWAP_USAGE
authorMartin Schwenke <martin@meltin.net>
Fri, 29 Mar 2019 00:19:55 +0000 (11:19 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 7 May 2019 05:45:34 +0000 (05:45 +0000)
commitb80967f5dcc6b58db0c38ec3e5cf0cbe46dbeb4b
tree66c0171b773cb11e555ffcd1248ee112017a952b
parent8108b3134c017c22d245fc5b2207a88d44ab0dd2
ctdb-scripts: Drop script configuration variable CTDB_MONITOR_SWAP_USAGE

CTDB's system memory monitoring in 05.system.script monitors both main
memory and swap.  The swap monitoring was originally based on
the (possibly incorrect, see below) idea that swap space stacks on top
of main memory, so that when a system starts filling swap space then
this is supposed to be a good sign that the system is running out of
memory.  Additionally, performance on a Linux system tends to be
destroyed by the I/O associated with a lot of swapping to spinning
disks.

However, some platforms default to creating only 4GB of swap space
even when there is 128GB of main memory.  With such a small swap to
main memory ratio, memory pressure can force swap to be nearly full
even when a significant amount of main memory is still available and
the system is performing well.  This suggests that checking swap
utilisation might be less than useful in many circumstances.

So, remove the separate swap space checking and change the memory
check to cover the total of main memory and swap space.

Test function set_mem_usage() still takes an argument for each of main
memory and swap space utilisation.  For simplicity, the same number is
now passed twice to make the intended results comprehensible.  This
could be changed later.

A couple of tests are cleaned up to no longer use hard-coded
/proc/meminfo and ps output.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events/legacy/05.system.script
ctdb/doc/ctdb-script.options.5.xml
ctdb/doc/examples/config_migrate.sh
ctdb/tests/eventscripts/05.system.monitor.011.sh
ctdb/tests/eventscripts/05.system.monitor.012.sh
ctdb/tests/eventscripts/05.system.monitor.013.sh [deleted file]
ctdb/tests/eventscripts/05.system.monitor.014.sh
ctdb/tests/eventscripts/05.system.monitor.015.sh
ctdb/tests/eventscripts/05.system.monitor.016.sh [deleted file]
ctdb/tests/eventscripts/05.system.monitor.017.sh
ctdb/tests/eventscripts/05.system.monitor.018.sh