nixos/test-instrumentation: Set vm.min_free_kbytes

We hit page allocation failures a lot at random for VM tests, in case of
my own Hydra when it comes to the installer tests. The reason for this
is that once the memory of the VM gets heavily fragmented the kernel is
unable to allocate new pages.

Setting vm.min_free_kbytes to 16MB forces the kernel to keep a minimum
of 16 MB free.

I've done some testing accross repeated runs of the installer tests with
and without vm.min_free_kbytes set. So accross 30 test runs for each
settings, all of the tests with the option being set passed while 14
tests without that sysctl option triggered page allocation failures.

Sure, running 30 tests is not a guarantee that 16MB is enough, but we'll
see how it turns out in the long run across all VM tests.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-12-12 23:40:11 +01:00
parent 53979b54a8
commit 02b568414d
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -88,6 +88,10 @@ let kernel = config.boot.kernelPackages.kernel; in
boot.consoleLogLevel = 7;
# Make sure we don't hit page allocation failures if the VM's memory is
# heavily fragmented.
boot.kernel.sysctl."vm.min_free_kbytes" = 16384;
# Prevent tests from accessing the Internet.
networking.defaultGateway = mkOverride 150 "";
networking.nameservers = mkOverride 150 [ ];