{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker.github.io/issues/4335","repository_url":"https://api.github.com/repos/docker/docker.github.io","labels_url":"https://api.github.com/repos/docker/docker.github.io/issues/4335/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker.github.io/issues/4335/comments","events_url":"https://api.github.com/repos/docker/docker.github.io/issues/4335/events","html_url":"https://github.com/docker/docker.github.io/issues/4335","id":252242623,"number":4335,"title":"Documentation should cover how to prevent container from using swap","user":{"login":"delcypher","id":511795,"avatar_url":"https://avatars0.githubusercontent.com/u/511795?v=4","gravatar_id":"","url":"https://api.github.com/users/delcypher","html_url":"https://github.com/delcypher","followers_url":"https://api.github.com/users/delcypher/followers","following_url":"https://api.github.com/users/delcypher/following{/other_user}","gists_url":"https://api.github.com/users/delcypher/gists{/gist_id}","starred_url":"https://api.github.com/users/delcypher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delcypher/subscriptions","organizations_url":"https://api.github.com/users/delcypher/orgs","repos_url":"https://api.github.com/users/delcypher/repos","events_url":"https://api.github.com/users/delcypher/events{/privacy}","received_events_url":"https://api.github.com/users/delcypher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-23T11:01:58Z","updated_at":"2017-08-23T20:52:02Z","closed_at":null,"body":"File: [engine/admin/resource_constraints.md](https://docs.docker.com/engine/admin/resource_constraints/), CC @mstanleyjones\r\n\r\nThe documentation for `--memory-swap` is rather confusing. What I wanted to do was run a container without allowing it to use swap. An initial guess would be doing something like\r\n`--memory 1g --memory-swap 1g` but reading the documentation says that\r\n\r\n```\r\nIf --memory-swap is set to the same value as --memory, and --memory is set to a positive integer, the effect is the same as setting --memory-swap to 0 (the value is treated as unset).\r\n```\r\n\r\nthat then implies the behaviour is what the behaviour would be if `--memory-swap` is not set.\r\n\r\n```\r\nIf --memory-swap is unset, and --memory is set, the container can use twice as much swap as the --memory setting, if the host container has swap memory configured. For instance, if --memory=\"300m\" and --memory-swap is not set, the container can use 300m of memory and 600m of swap.\r\n```\r\n\r\nTo me this is not intuitive behaviour at all but if this is Docker's current behaviour I feel it should be documented more explicitly that this is the case. I also think that given that preventing as much swap use as possible is a common use case I feel that how to achieve this (if it is possible) should be explicitly documented. If it isn't possible to do this it should be documented.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker.github.io/issues/comments/324458832","html_url":"https://github.com/docker/docker.github.io/issues/4335#issuecomment-324458832","issue_url":"https://api.github.com/repos/docker/docker.github.io/issues/4335","id":324458832,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars3.githubusercontent.com/u/799078?v=4","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2017-08-23T20:52:02Z","updated_at":"2017-08-23T20:52:02Z","body":"> if this is Docker's current behaviour I feel it should be documented more explicitly that this is the case.\r\n\r\nCan you explain how it can be more explicitly documented?"}}
{"actor":{"display_login":"cpuguy83"}}