Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting OOM score #13116

Closed
phemmer opened this issue May 10, 2015 · 2 comments · Fixed by #16277
Closed

Support setting OOM score #13116

phemmer opened this issue May 10, 2015 · 2 comments · Fixed by #16277
Labels
kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@phemmer
Copy link
Contributor

phemmer commented May 10, 2015

One thing that would be useful is prioritizing certain containers when it comes to the OOM killer. Right now, docker only supports a simple on/off. It would be much more useful to be able to score containers, so that if a process has to be killed, it favors certain containers.
This behavior is controlled by the /proc/$pid/oom_score_adj tunable. A score of -1000 disables the OOM killer, and the max score of 1000 makes it a near certain target for the OOM killer.

Additionally, since -1000 disables the OOM killer, this setting would deprecate the current --oom-kill-disable parameter.

@thaJeztah thaJeztah added the kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny label May 11, 2015
@thaJeztah
Copy link
Member

For reference; earlier discussion on this topic here: #12528.

The --oom-kill-disable flag was introduced in #11034, and isn't in a release yet, so _if_ this is something that's wanted, it would be preferable to decide on this before the 1.7 release, to prevent having to introduce and deprecate that flag.

/cc @HuKeping @hqhq @thockin @LK4D4

@hqhq
Copy link
Contributor

hqhq commented May 11, 2015

Yes, oom_score_adj is more flexible, technically is't per process, while oom-kill-disable is per cgroup, but we can hack oom_score_adj to make it per cgroup because it will be inherited to child processes.
I'm +1 to add oom_score_adj support, but I don't think it would deprecate oom-kill-disable, because oom-kill-disable is more obvious and clear for what it does. And I think kernel support both of them for some reasons, I don't remember either of them is for backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants