Skip to content

Commit

Permalink
Fix MemorySwappiness on Windows Docker
Browse files Browse the repository at this point in the history
Fixes #3181
  • Loading branch information
dadgar committed Sep 11, 2017
1 parent 03e63d0 commit 7148b65
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down

0 comments on commit 7148b65

Please sign in to comment.