-
Notifications
You must be signed in to change notification settings - Fork 317
cgroups: Make systemd cgroup parent support use specified slices. #549
Conversation
6893ab1
to
ebd5f9b
Compare
|
Is there no way to get the container to launch in an existing service? The original proposal was allowing the ability to set the cgroup parent was specifically to allow this. |
@ibuildthecloud I think might have to add the pid to the service's cgroup cpuset to make that work. |
@vishh @crosbymichael ping |
I get the intent, but, overloading a cgroup fs path to represent systemd slices doesn't sound good to me. May be its just me :) I would prefer moving in the direction of handling systemd explicitly. I wonder what other maintainers think - @vmarmol @crosbymichael @LK4D4. |
@vishh Thanks for taking a look :) We could use another property do it, but this could be used to run multiple containers under the same slice. And there could be slices under slices so it gives us the hierarchy that we need to support the notion of a parent in systemd. |
I would like to see there be an easy way to say run the container under the clients cgroup. --cgroup-parent=self Or something like that. (I actually wish this was the default). Admins expect the constraints on a service or user executing the docker client to apply to the container. Most envision the container to be a child of the client. (Which is another story). If I set up a systemd unit file with a constraint of only having 500M or memory, I would figure the container would run with just 500M of memory. To make this work currently you need to modify the docker run/create command. |
I do like the idea of easily running multiple containers under the same cgroup constraints. |
Docker feature request was to have the ability to group docker containers On Wed, Apr 22, 2015 at 11:39 AM, Mrunal Patel [email protected]
|
@vishh @rhatdan I see your point w.r.t service file integration. I would argue that it is a separate use case from this one which could probably be enabled by --cgroup-parent=self or some other keyword.
|
The original intent was to allow the docker container to be launched in the service unit's cgroup and then let the client die. If you notify systemd of the container PID systemd will now be properly monitoring the container. There's two hang ups that prevent this from working. First, systemd doesn't seem to support launching new process and placing them in an existing service. Second, if you get the processes in the right cgroup and tell systemd about the PID you still get some odd behavior because systemd is monitoring a grandchild and not a child. The best route right now seems to be to use cgroup parent and then disable systemd code and use cgroupfs. With these two things you can actually write a decent wrapper to Docker that will make the two play a bit nicer with each other. |
Except this will not work in the long run, I believe, when the kernel moves to the Unified Model of handling cgroups. |
@crosbymichael @rhatdan Any thoughts whether this PR is worth pursuing. I think it does make sense. |
@mrunalp Yes I think this would be very valuable. |
This PR is far more reasonable than the current behavior. |
@ibuildthecloud yes, today it essentially has no effect other than changing the name of the scope file. |
@mrunalp Need rebase, sorry :/ |
ebd5f9b
to
bd948ae
Compare
Signed-off-by: Mrunal Patel <[email protected]>
bd948ae
to
3aa8e3a
Compare
@LK4D4 done |
I don't see harm. |
ping @crosbymichael |
1 similar comment
ping @crosbymichael |
closing as ported |
Today, we just change the prefix name of the scope file. This PR allows one to specify a slice to use as parent.
Signed-off-by: Mrunal Patel [email protected]