LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cgset

set cgroup parameters

TLDR

Set CPU quota for a cgroup
$ cgset -r cpu.cfs_quota_us=[50000] [/mygroup]
copy
Set memory limit for a cgroup
$ cgset -r memory.limit_in_bytes=[512M] [/mygroup]
copy
Set multiple parameters at once
$ cgset -r cpu.shares=[512] -r memory.limit_in_bytes=[1G] [/mygroup]
copy
Copy settings from one cgroup to another
$ cgset --copy-from [/source_group] [/dest_group]
copy

SYNOPSIS

cgset [-r name=value]... cgroupcgset --copy-from source destination

DESCRIPTION

cgset modifies parameters of existing control groups (cgroups). It allows setting resource limits and controls for CPU, memory, I/O, and other subsystems on groups of processes.Common parameters include CPU shares (relative priority), CPU quotas (hard limits), memory limits, and I/O weights. The available parameters depend on which controllers are mounted and the cgroup version.cgset is part of libcgroup-tools for managing cgroups v1. For cgroups v2, systemd or direct filesystem writes are typically used instead.

PARAMETERS

-r name=value

Set a parameter to a value.
--copy-from cgroup
Copy parameters from another cgroup.
-h, --help
Display help information.

INSTALL

sudo apt install cgroup-tools
copy
sudo apk add cgroup-tools
copy

CAVEATS

Requires appropriate permissions (typically root). Parameter names and values are controller-specific. Invalid values may be rejected by the kernel. Only works with cgroups v1 hierarchy. Some parameters cannot be changed while processes are in the cgroup.

HISTORY

cgset is part of libcgroup, developed by Red Hat starting around 2008 to provide user-space cgroup management. The tool provided a way to configure resource limits without direct filesystem manipulation. As cgroups v2 and systemd became prevalent, direct management through these tools became less common.

SEE ALSO

cgcreate(1), cgdelete(1), cgget(1), cgexec(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid