LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cgroups

Linux kernel resource control and isolation

TLDR

This page is an index — see cgcreate for creating control groups
$ cgcreate -g [controllers]:[path]
copy
Run a process in a cgroup with cgexec
$ cgexec -g [controllers]:[path] [command]
copy
Move a running process with cgclassify
$ cgclassify -g [controllers]:[path] [pid]
copy

DESCRIPTION

cgroups (control groups) is a Linux kernel feature for limiting, measuring, and controlling resource usage by processes. It is not a single command but a collection of tools and kernel interfaces.Cgroups can limit CPU, memory, I/O, and network resources. They are fundamental to container technologies like Docker and systemd resource management.

RELATED COMMANDS

cgclassify

Move running processes to a cgroup
cgcreate
Create new cgroups
cgexec
Run a command in a cgroup
cgget
Get cgroup parameters
cgset
Set cgroup parameters
cgdelete
Remove cgroups

CAVEATS

Linux has two versions of cgroups (v1 and v2) with different interfaces. Modern systems often use cgroups v2 unified hierarchy. The libcgroup tools work with v1; systemd manages v2 natively.

SEE ALSO

RESOURCES

Copied to clipboard
Kai