Skip to content

Commit

Permalink
Merge pull request #3958 from simplesurance/swappiness
Browse files Browse the repository at this point in the history
fix: disable swap for executor_linux allocations
  • Loading branch information
schmichael committed Mar 13, 2018
2 parents 89845b3 + 6c9dc48 commit a90ce65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ BUG FIXES:
space in it on Windows [[GH-3855](https://github.com/hashicorp/nomad/issues/3855)]
* client/vault: Recognize renewing non-renewable Vault lease as fatal [[GH-3727](https://github.com/hashicorp/nomad/issues/3727)]
* config: Revert minimum CPU limit back to 20 from 100.
* driver/exec: Properly disable swapping [[GH-3958](https://github.com/hashicorp/nomad/issues/3958)]
* driver/lxc: Cleanup LXC containers after errors on container startup. [[GH-3773](https://github.com/hashicorp/nomad/issues/3773)]
* ui: Fix ui on non-leaders when ACLs are enabled [[GH-3722](https://github.com/hashicorp/nomad/issues/3722)]
* ui: Fix requests using client-side certificates in Firefox. [[GH-3728](https://github.com/hashicorp/nomad/pull/3728)]
Expand Down
3 changes: 2 additions & 1 deletion client/driver/executor/executor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func (e *UniversalExecutor) configureCgroups(resources *structs.Resources) error
// Total amount of memory allowed to consume
e.resConCtx.groups.Resources.Memory = int64(resources.MemoryMB * 1024 * 1024)
// Disable swap to avoid issues on the machine
e.resConCtx.groups.Resources.MemorySwap = int64(-1)
var memSwappiness int64 = 0
e.resConCtx.groups.Resources.MemorySwappiness = &memSwappiness
}

if resources.CPU < 2 {
Expand Down

0 comments on commit a90ce65

Please sign in to comment.