Skip to content

cgroupsv2 support #699

Open
Open
@dzuelke

Description

@dzuelke

The buildpack currently reads available RAM from a hard-coded location: /sys/fs/cgroup/memory/memory.limit_in_bytes.

This is a cgroups v1 path; cgroups v2 use a set of different soft and hard limits exposed via /sys/fs/cgroup/mem.{min,low,high,max}.

For both v1 and v2, groups can be arranged hierarchically, so it's actually necessary to determine the group that applies to the currently running process by parsing the cgroup table for the current process in /proc.

For cgroups v1, an entry may exist for a particular controller, e.g. "memory". For v2, only a single unified hierarchy exists.

For cgroups v2, all leaf nodes always expose all effective limits for active controllers, meaning no traversal up the tree is necessary to determine a limit. For v1, such path traversal must be performed, as a child group may inherit a limit from its parent.

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