From 7148b65306627ce4e45aabb0391fd44e0e424aab Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Sun, 10 Sep 2017 17:46:45 -0700 Subject: [PATCH] Fix MemorySwappiness on Windows Docker Fixes https://github.com/hashicorp/nomad/issues/3181 --- client/driver/docker.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/driver/docker.go b/client/driver/docker.go index 3539691b038..ef1e1827f8c 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -970,8 +970,11 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas VolumeDriver: driverConfig.VolumeDriver, } - // Windows does not support MemorySwap #2193 - if runtime.GOOS != "windows" { + // Windows does not support MemorySwap/MemorySwappiness #2193 + if runtime.GOOS == "windows" { + hostConfig.MemorySwap = 0 + hostConfig.MemorySwappiness = -1 + } else { hostConfig.MemorySwap = memLimit // MemorySwap is memory + swap. }