Dear ben,
The vm.swappiness is a kernel parameter that control the "tendency" of
the kernel to swap or to use the swap space. Here is a better
explanation:
https://en.wikipedia.org/wiki/Swappiness
Over the years, speculations were made about which value was better,
someone says that it's better to swap, someone says that it's
better to not swap (because have plenty of RAM and wants to preserve the
disks or the SSDs) and so on. Some tweaking guide around the web
advice to alter to a value of 0 or 10 to get better performance
(performance in the sense of responsiveness of a desktop system), some
other guide instead advice to leave the default value. Some further
guide says that is anyway obsolete and it's no longer used to promote
or disable the swapping anyway. There is not a final word on this and
one can do advocacy and speculations forever.
The default value is 60 and it's set internally to the kernel. To
alter such value you can either do as root:
echo 10 > /proc/sys/vm/swappiness
and that works until you change again or do a reboot. Under OMV
2014.1/2 (dunno about cooker), the default value is altered internally
into the initscripts package, and in particular in the file:
/usr/lib/sysctl.d/00-system.conf. What I made in my special
initscripts package build, is just to comment these special "tweaking"
and leave the default values which are set before in the kernel.
Anyway I, NiCCo (and many others) found "empirically" that the
original OMV special tweaking don't give (when they work) much visible
performance improvement over the default values, but on the contrary
when they don't work the problems are clearly visible and the system
become unusable as many have experienced. So the conservative choice
is, if possible, to not to alter these values with tweaked ones.
Also none of the other major upstream distros, even the most
responsive ones, alter these values by default.
What other package might alter these values? The "tuned" package,
which might "dinamically" alter the internal values beyond to whatever
value you might have placed into 00-system.conf, and in fact my
suggestion to avoid interfering is to disable it (systemctl stop
tuned.service; systemctl disable tuned.service) or uninstall such
package too or to not install it by default.
What exactly are the values altered by the tweaking? Looking to old
00-system.conf, we see that changes were made in the previous OMV
initscripts (up to 9.53-1.6) to the following internal kernel
parameters:
vm.swappiness from 60 to 10
vm.vfs_cache_pressure from 100 to 50
vm.dirty_writeback_centisecs from 500 to 1500 (sound required by powertop)
kernel.shmmax from 33554432 to 4294967295
kernel.shmall from 2097152 to 268435456
net.bridge.bridge-nf-call-{iptables,ip6tables ,arptables} -> set to 0
(to disable netfilter on bridges)
kernel.nmi_watchdog -> 0 (disable NMI watchdog)
I do not enter in merit of net.bridges, and kernel.nmi_watchdog, as
are not related, but in initscripts-9.53-1.7|1.8 I just switched back (or to be
precise, I've not let the package initscripts altering) the values of:
vm.swappiness -> so it goes back to default 60
vm.vfs_cache_pressure -> so it goes back to default 100
vm.dirty_writeback_centisecs -> this is left altered as in original
initscripts to 1500.
in initscripts-9.53-1.8 I also switched back (commented in):
kernel.shmmax -> so it goes back 33554432
kernel.shmall -> so it goes back to 2097152
as these values are tipically changed for managing or improving the
performance of big databases (e.g. Oracle) and I don't see any reason
in a desktop environment to tweak them.