Skip to main content

Resolving Missing Cgroup Files in CircleCI Build Environments

Overview

Users may encounter issues with missing Cgroup files, such as /sys/fs/cgroup/cpu/cpu.shares and /sys/fs/cgroup/memory/memory.max_usage_in_bytes, in CircleCI build containers. This is due to the transition from CgroupV1 to CgroupV2, which affects how resource information is accessed within the containers.

Solution

  1. Understanding the Change: CircleCI is transitioning from CgroupV1 to CgroupV2. This change affects the availability of certain files used to determine resource allocation in build containers.

  2. Adjusting Scripts for CgroupV2:

    • Instead of using /sys/fs/cgroup/cpu/cpu.shares, use /sys/fs/cgroup/cpu.max.

    • Instead of using /sys/fs/cgroup/memory/memory.max_usage_in_bytes, consider using /sys/fs/cgroup/memory.peak.

  3. Planning for CgroupV2: Begin planning to update your scripts to be compatible with CgroupV2, as this will be the standard going forward.

Additional Resources

Did this answer your question?