Skip to content

cgroup limits are not detected in docker #8777

Closed
@tmds

Description

@tmds

Triggered by the discussion at aspnet/KestrelHttpServer#1260, I'm having a look at the cgroup code in coreclr.

The first problem I encounter is the code isn't properly parsing the mountinfo when the mountpoint contains a dash. PR: dotnet/coreclr#13488

The next problem I have is the limits aren't found.
The code is looking for a mountpoint in the /proc/self/mountinfo file and then combines that with a path it finds under /proc/self/cgroup.

I ran a container on rhel7.4+docker and one on minishift(= local instance of openshift, which is using kubernetes as an orchectrator) and the limits are not found at that location.

Instead they are present directly under the mount path.

For example:
mountpoint:

396 394 0:21 /kubepods/besteffort/pod9a18ffb8-8513-11e7-b26e-7e29fbe2a5a3/d28e0087cf8f3f0429f755d60b0de415b20fcf76736ded7bab6e30e7b739ee36 /sys/fs/cgroup/cpu ro,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpu

cgroup

2:cpu:/kubepods/besteffort/pod9a18ffb8-8513-11e7-b26e-7e29fbe2a5a3/d28e0087cf8f3f0429f755d60b0de415b20fcf76736ded7bab6e30e7b739ee36
$ ls /sys/fs/cgroup/cpu                                                                                                                                                                                                             
cgroup.clone_children  cgroup.procs  cpu.cfs_period_us  cpu.cfs_quota_us  cpu.rt_period_us  cpu.rt_runtime_us  cpu.shares  cpu.stat  notify_on_release  tasks

cc @janvorli @benaadams @markvincze @rahku @gboucher90

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions