-
Notifications
You must be signed in to change notification settings - Fork 553
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
Setting oom_score_adj while launching applications #115
Comments
I merged opencontainers/runc#160 (at opencontainers/runc@4f7ff04) into runc's master (at opencontainers/runc@0f85e4e), reverted opencontainers/runc@cc232c47 (part of opencontainers/runc#232) to avoid clobbering my adjustment, and wrote a host-side hook to handle the adjustment:
The Then I added the hook to my
Then launching the container gives the right score:
So the hook approach ((2) in my original post here) is valid, and not particularly difficult. I propose we document that approach in this spec (for the reasons outlined in my original post here) and roll back opencontainers/runc#232 in runC. |
The Do we have other use cases which demand the need for giving access to the init process from a hook? |
On Mon, Oct 12, 2015 at 01:18:28PM -0700, Vish Kannan wrote:
Regardless of implementation, a runtime will almost certainly need to
Agreed. And the container isn't established until there's a process
What do you mean “giving access”? Just “listing the |
On Mon, Oct 12, 2015 at 01:33:20PM -0700, W. Trevor King wrote:
@vishh pointed out that the unshare and pivot_root calls can live in a
You can get a fair ways toward handling its unshare/setns bits with So I don't think it's a particularly large win to support the “two Am I missing something? |
While in there, to show why someone may want it, I also added support for: runc run cmd args... runc batch batchFileOfCommands | - Signed-off-by: Doug Davis <dug@us.ibm.com>
with hooks being in the spec, the setting of this should be supported. |
On Wed, Mar 16, 2016 at 10:24:02AM -0700, Vincent Batts wrote:
This issue was “how do we want to support things like oom_score_adj”, Anyway, I'm happy to continue this discussion on the mailing list, or
|
This spins off a more tightly-scoped version of #114. The
oom_score_adj
is more of a host-side and/or multi-container-orchestration issue, and less of a bundle issue, which means it probably should be inruntime.json
if/once #88 lands. Possible approaches for setting this include:/proc/<pid>/oom_score_adj
, which would need a config-side setting./proc/<pid>/oom_score_adj
. This would require a hook with sufficient permissions for the write.A number of attributes where you could use (2) currently have explicit, (1)-style configs for via hooks (e.g. setting up networking and creating cgroups and namespaces). I'd guess the balance involves “how easy is it to handle without (1)?” and “how frequently will folks be tweaking this attribute?”, with high-cost or high-frequency attributes being handled via (1). So which way do we think makes the most sense for this particular setting?
Is it easy to handle via (2) or (3)? It seems like (2) would be easy assuming sufficient hook permissions, but (3) is probably too annoying to be worth the trouble.
How frequently do we expect folks will use this? I can't weigh in here, since I haven't set this. And I expect most runtime managers that set this will be doing it automatically, so in that case it's a wash between (1) and (2) for difficulty.
If those assumptions are correct, then I think we should go with (2), since that is the least work on the spec/runtime-implementation side. If nobody chimes in with anti-(2) thoughts in the next few days, I'll merge opencontainers/runc#160 locally see whether I can get it working ;).
The text was updated successfully, but these errors were encountered: