Hi, @Jeff I try to write down my understanding about the cgroup in Mesos,
maybe some parts are incorrect, feel free to correct them if you think it
is incorrect. :-)

Actually the hierarchy you mentioned is not v2 hierarchy (v2 hierarchy is a
totally different structure).
The hierarchy you mentioned is a hierarchy structure systemd proposal. It
only exists in Ubuntu 16.04 and CentOS 7 (RHEL 7) which use systemd as the
default init system. But Mesos supports Ubuntu 14.04 / CentOS 6 as well
which xx.slice not exists. I believe this is why docker use

```
/sys/fs/cgroup/{resource}/docker (Yep, this is created by Docker daemon,
not Mesos )
```

Suppose Mesos only support CentOS 7.1 which systemd is installed default. I
think we still could not put the cgroups root hierarchy under `
 /sys/fs/cgroup/{resource}/user.slice/` as well. Because `user.slice` is
only used for user sessions. Refer to
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Resource_Management_Guide/sec-Default_Cgroup_Hierarchies.html,
services should maintain its root hierarchy under
`/sys/fs/cgroup/{resource}` instead of to put it in the cgroup hierarchy
user sessions.

But if you want to put it under `/sys/fs/cgroup/{resource}/user.slice`,
Mesos Agents provides a flag `--cgroups_root` to specific the cgroup root.
You could pass `--cgroups_root="user.slice/mesos"` when launch Mesos Agents
to achieve that target.

On Fri, Oct 28, 2016 at 2:30 AM, Jeff Kubina <jeff.kub...@gmail.com> wrote:

> I am running Mesos 0.28.1 on Centos 7.1 using --isolation=cgroups and
> noticed that mesos creates the cgroups:
>
> /sys/fs/cgroup/{resource}/docker
> /sys/fs/cgroup/{resource}/mesos
> /sys/fs/cgroup/{resource}/mesos_executors.slice
>
> Shouldn't these cgroups be in /sys/fs/cgroup/{resource}/
> user.slice/{docker,mesos,mesos_executors.slice} to ensure a more fair
> allocation of the cgroup resources possible? Or is there a way to configure
> that to happen?
>
> The v2-cgroup hierarchy is such that:
>
> 1) /sys/fs/cgroup, is for kernel processes
>
> 2) /sys/fs/cgroup/system.slice is for systemd processes, which contains
> docker.service and mesos-slave.service, and
>
> 3) /sys/fs/cgroup/user.slice is for all other processes.
>
> Having {docker,mesos,mesos_executors.slice} in user.slice would enable
> finer grain control of the resources across the mesos and user processes.
>
>
>
>


-- 
Best Regards,
Haosdent Huang

Reply via email to