Skip to content

Add cgroup v2 support to .NET Core #30337

@omajid

Description

@omajid

The Linux kernel includes a feature called "cgroup" (or "cgroups"). This allows managing - specially limiting - resources (cpu, memory, etc) for a collection of processes. This is one of the underlying technology pieces used by projects like docker, podman, kubernetes and systemd to limit various resources for processes.

The first version of cgroup has a number of design issues and a redesign, cgroup v2, was implemented in the Linux kernel. There are a number of incompatibilities between cgroup v1 and cgroup v2.

Complete documentation of cgroup v2 is available here: https://www.kernel.org/doc/Documentation/cgroup-v2.txt

Both cgroup v1 and cgroup v2 may be enabled on a system at the same time. Container runtimes (podman, docker) will only use one.

Some Linux distributions, such as Fedora, are starting to switch to cgroup v2 as the default: https://fedoraproject.org/wiki/Changes/CGroupsV2. Even where it's not the default, adding systemd.unified-cgroup-hierarchy=1 to the kernel command can be used to make it the default for testing.

A technique to disambiguate between cgroup v1 and cgroup v2 is documented here: https://systemd.io/CGROUP_DELEGATION/#three-different-tree-setups-

Currently, .NET Core doesn't support cgroup v2. This issue is for tracking the changes/fixes required across the different .NET Components.

CoreCLR:

CoreFx:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-PAL-coreclrenhancementProduct code improvement that does NOT require public API changes/additionsos-linuxLinux OS (any supported distro)tenet-performancePerformance related issueuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions