{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/bugs/issues/242","labels_url":"https://api.github.com/repos/coreos/bugs/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/coreos/bugs/issues/242/comments","events_url":"https://api.github.com/repos/coreos/bugs/issues/242/events","html_url":"https://github.com/coreos/bugs/issues/242","id":54543805,"number":242,"title":"resource controls?","user":{"login":"porjo","id":1296987,"avatar_url":"https://avatars.githubusercontent.com/u/1296987?v=3","gravatar_id":"","url":"https://api.github.com/users/porjo","html_url":"https://github.com/porjo","followers_url":"https://api.github.com/users/porjo/followers","following_url":"https://api.github.com/users/porjo/following{/other_user}","gists_url":"https://api.github.com/users/porjo/gists{/gist_id}","starred_url":"https://api.github.com/users/porjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porjo/subscriptions","organizations_url":"https://api.github.com/users/porjo/orgs","repos_url":"https://api.github.com/users/porjo/repos","events_url":"https://api.github.com/users/porjo/events{/privacy}","received_events_url":"https://api.github.com/users/porjo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-16T06:26:20Z","updated_at":"2015-01-16T18:14:32Z","closed_at":null,"body":"I'd like to limit the maximum memory a particular container can consume. I've tried adding `MemoryLimit=200M` to my service file, however the process has now consumed in excess of 200M and is still happily running!?\r\n\r\n$ systemctl cat vulcand\r\n```ini\r\n# /run/fleet/units/vulcand.service\r\n[Unit]\r\nDescription=Vulcand Reverse Proxy\r\nAfter=docker.service\r\n\r\n[Service]\r\nMemoryLimit=200M\r\nTimeoutStartSec=0\r\nExecStartPre=-/usr/bin/docker kill vulcand\r\nExecStartPre=-/usr/bin/docker rm vulcand\r\nExecStart=/usr/bin/docker run --rm --name vulcand -p 80:8181 -p 443:8183 vulcand /opt/vulcand \r\nExecStop=/usr/bin/docker stop vulcand\r\n\r\n[X-Fleet]\r\nGlobal=true\r\n```\r\n\r\n$ systemctl status vulcand\r\n```\r\n● vulcand.service - Vulcan Reverse Proxy\r\n   Loaded: loaded (/run/fleet/units/vulcand.service; linked-runtime)\r\n   Active: active (running) since Thu 2015-01-15 21:41:59 UTC; 8h ago\r\n  Process: 6719 ExecStartPre=/usr/bin/docker rm vulcand (code=exited, status=1/FAILURE)\r\n  Process: 6711 ExecStartPre=/usr/bin/docker kill vulcand (code=exited, status=1/FAILURE)\r\n Main PID: 6728 (docker)\r\n   CGroup: /system.slice/vulcand.service\r\n           └─6728 /usr/bin/docker run --rm --name vulcand -p 80:8181 -p 443:8183 vulcand /opt/vulcand \r\n```\r\nOutput from top:\r\n```\r\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                    \r\n 6754 99        20   0  243776 236840   7236 S   0.0 23.2   1:13.58 vulcand          \r\n```\r\nIs limiting of memory (and other resources) possible with CoreOS, and if so, how should that be configured?"},"comment":{"url":"https://api.github.com/repos/coreos/bugs/issues/comments/70296350","html_url":"https://github.com/coreos/bugs/issues/242#issuecomment-70296350","issue_url":"https://api.github.com/repos/coreos/bugs/issues/242","id":70296350,"user":{"login":"robszumski","id":755540,"avatar_url":"https://avatars.githubusercontent.com/u/755540?v=3","gravatar_id":"","url":"https://api.github.com/users/robszumski","html_url":"https://github.com/robszumski","followers_url":"https://api.github.com/users/robszumski/followers","following_url":"https://api.github.com/users/robszumski/following{/other_user}","gists_url":"https://api.github.com/users/robszumski/gists{/gist_id}","starred_url":"https://api.github.com/users/robszumski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robszumski/subscriptions","organizations_url":"https://api.github.com/users/robszumski/orgs","repos_url":"https://api.github.com/users/robszumski/repos","events_url":"https://api.github.com/users/robszumski/events{/privacy}","received_events_url":"https://api.github.com/users/robszumski/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T18:14:32Z","updated_at":"2015-01-16T18:14:32Z","body":"Docker doesn’t pay attention to certain systemd parameters since the daemon creates its own cgroups/namespaces. You'll have to use the Docker-specific resource flags on your run command.\r\n\r\nThis is one thing that we hope to fix with Rocket. Any resource settings and environment variables set in the unit will take affect as you would expect."}}