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

cgroup-parent breaks hierarchical cgroups #16681

Closed
mohitsoni opened this issue Sep 30, 2015 · 4 comments
Closed

cgroup-parent breaks hierarchical cgroups #16681

mohitsoni opened this issue Sep 30, 2015 · 4 comments

Comments

@mohitsoni
Copy link
Contributor

While working on docker/compose#2114, I noticed that docker handles cgroups hierarchies via cgroup-parent flag a little differently.

For ex:
First, I launched a parent docker container using:

docker run busybox ping www.docker.com

For this container daemon creates a cgroup here:

# cat /proc/10968/cgroup 
...
8:memory:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope
6:cpuset:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope
5:net_cls,net_prio:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope
2:cpu,cpuacct:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope
...

Next, I launch another container using cgroup-parent flag:

docker run --cgroup-parent docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope busybox ping www.paypal.com

For this container, docker creates a cgroup, but the hierarchy is broken:

# cat /proc/11105/cgroup 
...
8:memory:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope-33917fb99f596633a1731a90f91b1d079528c6898e512e90b6eae89af462c52a.scope
6:cpuset:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope-33917fb99f596633a1731a90f91b1d079528c6898e512e90b6eae89af462c52a.scope
5:net_cls,net_prio:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope-33917fb99f596633a1731a90f91b1d079528c6898e512e90b6eae89af462c52a.scope
2:cpu,cpuacct:/system.slice/docker-773e468adb0e97459059804f5906fee50edfe37fb4babad5655508fa7a1f27e0.scope-33917fb99f596633a1731a90f91b1d079528c6898e512e90b6eae89af462c52a.scope
...

Is this the expected behavior ? I assumed that cgroup-parent flag should nest the child's cgroup under the parent.

Here's are some details of my system:

# docker version
Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:21:21 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:21:21 UTC 2015
 OS/Arch:      linux/amd64
# uname -a
Linux mohit-mate 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
@mohitsoni mohitsoni changed the title cgroup_parent breaks hierarchical cgroups cgroup-parent breaks hierarchical cgroups Sep 30, 2015
@mohitsoni
Copy link
Contributor Author

Providing output of docker info command:

Containers: 9
Images: 36
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 54
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-15-generic
Operating System: Ubuntu 15.04
CPUs: 2
Total Memory: 1.954 GiB
Name: mohit-mate
ID: DXNG:J54F:6VEY:X6GK:C5XY:ARJY:URK3:GNHX:6NNV:Q4WU:3C6K:RMXI
WARNING: No swap limit support

@calavera calavera added this to the 1.9.0 milestone Sep 30, 2015
@icecrime icecrime removed this from the 1.9.0 milestone Oct 10, 2015
@hqhq
Copy link
Contributor

hqhq commented Oct 15, 2015

I'll take a look at this.

@aulanov
Copy link

aulanov commented Oct 16, 2015

Related bug: #17126

@mohitsoni
Copy link
Contributor Author

@hqhq Let me know, if I can help out in anyway.

hqhq added a commit to hqhq/runc that referenced this issue Dec 3, 2015
dims pushed a commit to dims/libcontainer that referenced this issue Oct 19, 2024
dims pushed a commit to dims/libcontainer that referenced this issue Oct 19, 2024
dims pushed a commit to dims/libcontainer that referenced this issue Oct 19, 2024
kolyshkin pushed a commit to kolyshkin/containerd-cgroups that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants