open-nomad/client
Fabian Holler e6af051c93 fix: disable swap for executor_linux allocations
A comment in the nomad source code states that swapping for
executor_linux allocations is disabled but it wasn't.

Nomad wrote -1 to the memsw.limit_in_bytes cgroup file to disable
swapping.
This has the following problems:

1.) Writing -1 to the file does not disable swapping. It sets
    the limit for memory and swap to unlimited.
2.) On common Linux distributions like Ubuntu 16.04 LTS the
    memsw.limit_in_bytes cgroup file does not exist by default.
    The memsw.limit_in_bytes file only exist if the Linux kernel is
    build with CONFIG_MEMCG_SWAP=yes and either
    CONFIG_MEMCG_SWAP_ENABLED=yes or when the kernel parameter
    swapaccount=1 is passed during boot.
    Most Linux distributions disable swap accounting by default because
    of higher memory usage.
    Nomad silently ignores if writing to the memsw.limit_in_bytes file
    fails. The allocation succeeds, no message is logged to notify the
    user.

To ensure that disabling swap works on common Linux kernels, disable
swapping by writing 0 to the memory.swappiness file.
Using the memory.swappiness file only requires that the kernel is
compiled with CONFIG_MEMCG=yes. This is the default in common Linux
kernels.
2018-03-13 10:52:50 +01:00
..
allocdir Client Stat/List impl 2018-02-15 13:59:02 -08:00
config Plumb config 2018-02-15 13:59:01 -08:00
driver fix: disable swap for executor_linux allocations 2018-03-13 10:52:50 +01:00
fingerprint code review fixup 2018-01-31 18:34:03 -05:00
getter
lib/streamframer clarify force 2018-02-15 13:59:02 -08:00
servers Fix original client server list behavior 2018-02-15 16:04:53 -08:00
stats Fix manager tests and make testagent recover from port conflicts 2018-02-15 13:59:01 -08:00
structs Server side impl + touch ups 2018-02-15 13:59:02 -08:00
testutil Skip tests that require root when not root 2017-12-12 16:58:27 -08:00
vaultclient Recognize renewing non-renewable Vault lease as fatal 2018-01-08 20:32:31 +01:00
acl.go SecretID -> AuthToken 2017-10-12 15:16:33 -07:00
acl_test.go Add testing interfaces 2018-02-15 13:59:00 -08:00
alloc_endpoint.go feedback and rebasing 2018-02-15 13:59:03 -08:00
alloc_endpoint_test.go fix flaky gc tests 2018-02-15 13:59:03 -08:00
alloc_runner.go Destroy partially migrated alloc dirs 2017-11-29 17:26:11 -08:00
alloc_runner_health_watcher.go
alloc_runner_test.go Remove testing 2018-02-15 13:59:01 -08:00
alloc_watcher.go chown dirs when migrating ephemeral_disk data 2018-01-08 15:31:12 -08:00
alloc_watcher_test.go Remove testing 2018-02-15 13:59:01 -08:00
client.go simplify retry logic 2018-03-01 09:48:26 -05:00
client_stats_endpoint.go Server side impl + touch ups 2018-02-15 13:59:02 -08:00
client_stats_endpoint_test.go Server side impl + touch ups 2018-02-15 13:59:02 -08:00
client_test.go add network resources equal method, use time ticker 2018-02-27 12:42:53 -05:00
consul.go
consul_template.go alway load all templates 2017-11-10 12:35:51 -08:00
consul_template_test.go Handle multiple environment templates 2017-11-10 11:08:19 -08:00
consul_testing.go Remove testing 2018-02-15 13:59:01 -08:00
fingerprint_manager.go use time ticker, update how network resources are compared 2018-02-26 18:47:11 -05:00
fingerprint_manager_test.go improved testing; node networks comparison 2018-02-26 15:55:38 -05:00
fs_endpoint.go Code review feedback 2018-02-15 13:59:02 -08:00
fs_endpoint_test.go Code review feedback 2018-02-15 13:59:02 -08:00
gc.go Remove noisy log line 2017-11-03 16:00:30 -07:00
gc_test.go Remove testing 2018-02-15 13:59:01 -08:00
restarts.go
restarts_test.go
rpc.go Client tls 2018-02-15 15:22:57 -08:00
rpc_test.go Client tls 2018-02-15 15:22:57 -08:00
state_database.go
task_runner.go Drop log level to TRACE 2018-01-18 15:35:24 -08:00
task_runner_test.go Remove testing 2018-02-15 13:59:01 -08:00
task_runner_unix_test.go
testing.go Remove testing 2018-02-15 13:59:01 -08:00
util.go
util_test.go Remove structs import from api 2017-09-29 10:36:08 -07:00