-
Notifications
You must be signed in to change notification settings - Fork 596
runtime-config-linux: Clarify resources vs. cgroupsPath #247
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,6 +144,12 @@ Also known as cgroups, they are used to restrict resource usage for a container | |
| cgroups provide controls to restrict cpu, memory, IO, pids and network for the container. | ||
| For more information, see the [kernel cgroups documentation](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt). | ||
|
|
||
| There are a few facets to this: | ||
|
|
||
| * Managing the existence of cgroups within the hierarchy (`cgroupsPath`). | ||
| * Moving processes to respective cgroups. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also affected by
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Wed, Dec 16, 2015 at 11:06:00AM -0800, Jonathan Boulle wrote:
I don't think so (see my breakdown here 1)
And so has everyone else that has reviewed it ;). So I think we need |
||
| * Configuring cgroups to apply resource limits (`resources`). | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Wed, Nov 18, 2015 at 03:35:28AM -0800, Qiang Huang wrote:
I think the lack of a distinction between “what the cgroup is called”
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand what's the meaning of "Managing the existence of cgroups within the hierarchy", does this includes:
Because above two are almost all we can do to manage cgroup. I think the three facets are not on the same page, that's why I think is not clear.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Thu, Dec 10, 2015 at 11:16:03PM -0800, Qiang Huang wrote:
No, those are both separate facets in my list.
“Adding process to a cgroup” and “applying resource limits” are both $ CGROUP=/sys/fs/cgroup/cpuset/a/b/c the first two lines are “managing the existence of cgroups within the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wking That explains, thanks. In my understanding, "Assigning processes to cgroups (where to assign to)" includes where you say "managing the existence of cgroups within the hierarchy", but it makes sense to separate them. |
||
| The path to the cgroups can be specified in the Spec via `cgroupsPath`. | ||
| `cgroupsPath` is expected to be relative to the cgroups mount point. | ||
| If `cgroupsPath` is not specified, implementations can define the default cgroup path. | ||
|
|
@@ -156,11 +162,13 @@ The cgroups will be created if they don't exist. | |
| "cgroupsPath": "/myRuntime/myContainer" | ||
| ``` | ||
|
|
||
| `cgroupsPath` can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container. | ||
| The container process will be added to the cgroups at `cgroupsPath`. | ||
|
|
||
| You can configure a container's cgroups via the `resources` field of the Linux configuration. | ||
| Do not specify `resources` unless limits have to be updated. | ||
| For example, to run a new process in an existing container without updating limits, `resources` need not be specified. | ||
| For example, to run a new process in an existing container without updating limits, specify `cgroupsPath` but not `resources`. | ||
| To run a new process in an existing container and update limits, specify both `cgroupsPath` and `resources`. | ||
| To run a new process in a new container with explicit resource limits, specify `resources` and optionally set `cgroupsPath` to a cgroup that does not yet exist. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't a user run a new container using existing cgroups?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Wed, Dec 16, 2015 at 11:46:24AM -0800, Vish Kannan wrote:
They can, but it wouldn't be a new container (and I tried to cover
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work when launching under systemd which creates a cgroup before launching a process. I don't understand why we are tying the concept of container to creation of cgroup.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Wed, Jan 06, 2016 at 02:26:40AM -0800, Brandon Philips wrote:
I'm not familiar with systemd and its interaction with OCI-specified
I agree, but I think that's what 1 and #237 are about. This PR is |
||
|
|
||
| #### Disable out-of-memory killer | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within what hierarchy?
cgroupsPathis the path to a cgroups hierarchy.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume he means the unified hierarchy, since subsequently it mentions the spec does not support split, but would be good to make that explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Dec 16, 2015 at 10:23:07AM -0800, Vish Kannan wrote:
This spec requires a unified cgroups hierarchy 1. cgroupsPath
locates the cgroup for this process within that hierarchy. The
runtime creates cgroups as needed to make that happen, and removes any
cgroups it created (but which are no longer used) when it cleans up
after itself. That makes the “within the hierarchy” phrasing clear to
me, but if you have an alternative that you prefer I'll switch to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Dec 16, 2015 at 11:02:59AM -0800, Jonathan Boulle wrote:
I can make “the hierarchy” a link to 1. But as far as I know, we
don't actually require you to use that unified-hierarchy
implementation. We just don't allow you to give per-controller paths.
I think that's too complicated an idea for this summary-list, but I'll
happily add more detail to the existing split-hierarchy reference to
clarify this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is, this could allow for either, though can you point me to where unified-hierarchy is explicitly required for this spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Tue, Jan 05, 2016 at 12:14:37PM -0800, Vincent Batts wrote:
The wording (from 429f936, #137) is:
The Spec does not support split hierarchy
And the surrounding discussion 1 was (paraphrased):
me: cgexec(1) lets you set per-controller paths, do we want that?
@vishh: Won't this break with unified hierarchy 2?
me: I see. Can we link to those kernel docs?
I could see someone reading that as either:
Whether the runtime implements that via an __DEVEL__sane_behavior
mount or not is undefined”.
Personally I'm in favor of the latter interpretation, but I think the
current wording could go either way. In either case, there is only
one name for all controllers, so I feel comfortable saying “the
hierarchy” here.