$linuxjunkies
>

cgroup

also: control groups, cgroups v1, cgroups v2

A Linux kernel feature that limits, prioritizes, and isolates resource usage (CPU, memory, I/O) for groups of processes. cgroups allow fine-grained control over system resources at the process-group level.

cgroups (control groups) are a kernel mechanism for organizing processes into hierarchical groups and applying resource limits and accounting to each group. They enable administrators and container systems to constrain how much CPU, memory, disk I/O, and other system resources a process or set of processes can consume.

For example, you might use cgroups to ensure a web server process never uses more than 2GB of memory, or that a batch job never consumes more than 50% of available CPU cycles, preventing it from starving other critical services.

cgroups are the foundation for modern containerization technologies like Docker and systemd services. You can interact with cgroups through /sys/fs/cgroup or higher-level tools like systemd, which automatically creates and manages cgroups for services and user sessions.

Related terms