{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41342037","id":41342037,"diff_hunk":"@@ -0,0 +1,165 @@\n+<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->\n+\n+<!-- BEGIN STRIP_FOR_RELEASE -->\n+\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+\n+<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>\n+\n+If you are using a released version of Kubernetes, you should\n+refer to the docs that go with that version.\n+\n+<strong>\n+The latest 1.0.x release of this document can be found\n+[here](http://releases.k8s.io/release-1.0/docs/proposals/resource-qos.md).\n+\n+Documentation for other releases can be found at\n+[releases.k8s.io](http://releases.k8s.io).\n+</strong>\n+--\n+\n+<!-- END STRIP_FOR_RELEASE -->\n+\n+<!-- END MUNGE: UNVERSIONED_WARNING -->\n+\n+# Memory Management in Kubernetes\n+\n+**Author**: Vishnu Kannan ([@vishh](https://github.com/vishh))\n+\n+**Status**: Draft proposal\n+\n+#### Goals\n+\n+1. Document existing state of memory management.\n+\n+2. Explore opportunities for improving memory management in the future.\n+\n+#### Why is memory management important?\n+\n+Memory is a limited resource on machines. It is shared among multiple user containers and system processes. Unlike CPU, Memory is not compressible. Kubernetes being a cluster management system, aims to improve the utilization of memory on all nodes. Memory access latencies could vary a lot based on the architecture, state of the system, etc. When the available memory on a node becomes very low, the kernel can start killing processes. Kubernetes aims to provide a stable and predictable application performance by managing memory on the nodes, and providing efficient memory isolation for user containers. \n+\n+\n+#### How is memory managed as of now?\n+\n+###### Requirements\n+\n+* Cgroups are used to manage memory on the node.\n+* Kernel Out of Memory killer is expected to be enabled. [`/proc/<pid>/oom_score_adj`](https://www.kernel.org/doc/Documentation/filesystems/proc.txt) is used to manage priority for access to memory. The kernel assigns an `oom_score` to individual processes based on the memory usage of the process and a few [other policies](https://lwn.net/Articles/317814/). `oom_score_adj` is taken into account while calculating the oom_score. Higher values for `oom_score_adj` will increase the likelihood for being considered for OOM kills.\n+\n+###### Node level memory management\n+\n+Kubelet, the node agent, performs some amount of memory management. Specifically, it can\n+\n+1. Expose the memory capacity and usage of the node.\n+\n+2. Apply memory limits to user containers and individual processes on the node.\n+\n+3. Set up cgroups to track the memory consumption of itself and other system processes like docker daemon, kube-proxy, sshd, etc. The cgroups being setup by kubelet are,\n+  a. `/docker-daemon`: The docker daemon is under this cgroup. This cgroup is limited to 70% of the total available memory on the node.\n+  b. `/system`: OS processes, excepting init, are under this cgroup.","path":"docs/proposals/memory-management.md","position":68,"original_position":68,"commit_id":"c801f3fc6221e4b1a54fd08378f35009dd01f052","original_commit_id":"81802425b4a392f0e316b87351946c5b2eeda362","user":{"login":"derekwaynecarr","id":6233452,"avatar_url":"https://avatars.githubusercontent.com/u/6233452?v=3","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false},"body":"Is there an issue for ```NodeSpec``` I can track?  I assume we would just work with the default user, system, machine slices for now.","created_at":"2015-10-07T01:07:42Z","updated_at":"2015-10-07T01:07:42Z","html_url":"https://github.com/kubernetes/kubernetes/pull/13006#discussion_r41342037","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41342037"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13006#discussion_r41342037"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006","id":42996183,"html_url":"https://github.com/kubernetes/kubernetes/pull/13006","diff_url":"https://github.com/kubernetes/kubernetes/pull/13006.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/13006.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13006","number":13006,"state":"open","locked":false,"title":"Memory management documentation and improvement","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"@kubernetes/goog-node @bgrant0607 @rjnagal @smarterclayton @davidopp ","created_at":"2015-08-21T01:29:46Z","updated_at":"2015-10-07T01:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea22246f3616971060a673056020e65f92daee65","assignee":{"login":"dchen1107","id":7740897,"avatar_url":"https://avatars.githubusercontent.com/u/7740897?v=3","gravatar_id":"","url":"https://api.github.com/users/dchen1107","html_url":"https://github.com/dchen1107","followers_url":"https://api.github.com/users/dchen1107/followers","following_url":"https://api.github.com/users/dchen1107/following{/other_user}","gists_url":"https://api.github.com/users/dchen1107/gists{/gist_id}","starred_url":"https://api.github.com/users/dchen1107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchen1107/subscriptions","organizations_url":"https://api.github.com/users/dchen1107/orgs","repos_url":"https://api.github.com/users/dchen1107/repos","events_url":"https://api.github.com/users/dchen1107/events{/privacy}","received_events_url":"https://api.github.com/users/dchen1107/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13006/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c801f3fc6221e4b1a54fd08378f35009dd01f052","head":{"label":"vishh:mem_management","ref":"mem_management","sha":"c801f3fc6221e4b1a54fd08378f35009dd01f052","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"repo":{"id":26461931,"name":"kubernetes","full_name":"vishh/kubernetes","owner":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vishh/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/vishh/kubernetes","forks_url":"https://api.github.com/repos/vishh/kubernetes/forks","keys_url":"https://api.github.com/repos/vishh/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vishh/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vishh/kubernetes/teams","hooks_url":"https://api.github.com/repos/vishh/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/vishh/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/vishh/kubernetes/events","assignees_url":"https://api.github.com/repos/vishh/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/vishh/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/vishh/kubernetes/tags","blobs_url":"https://api.github.com/repos/vishh/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vishh/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vishh/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/vishh/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vishh/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/vishh/kubernetes/languages","stargazers_url":"https://api.github.com/repos/vishh/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/vishh/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/vishh/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/vishh/kubernetes/subscription","commits_url":"https://api.github.com/repos/vishh/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/vishh/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/vishh/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/vishh/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/vishh/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/vishh/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vishh/kubernetes/merges","archive_url":"https://api.github.com/repos/vishh/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vishh/kubernetes/downloads","issues_url":"https://api.github.com/repos/vishh/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/vishh/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/vishh/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/vishh/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vishh/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/vishh/kubernetes/releases{/id}","created_at":"2014-11-11T00:05:03Z","updated_at":"2014-12-18T20:48:07Z","pushed_at":"2015-10-05T19:25:05Z","git_url":"git://github.com/vishh/kubernetes.git","ssh_url":"git@github.com:vishh/kubernetes.git","clone_url":"https://github.com/vishh/kubernetes.git","svn_url":"https://github.com/vishh/kubernetes","homepage":null,"size":112572,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"b9293a093b51182486c133c44fce636536d28e21","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-10-06T23:46:25Z","pushed_at":"2015-10-07T00:56:46Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":440187,"stargazers_count":10582,"watchers_count":10582,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2658,"mirror_url":null,"open_issues_count":2003,"forks":2658,"open_issues":2003,"watchers":10582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/13006"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13006"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/13006/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13006/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c801f3fc6221e4b1a54fd08378f35009dd01f052"}}}}