cgroups (Control Groups)
- a linux kernel feature
- allows resouces like CPU time, memory, and network bandwidth, to be allocated
to groups of processes
- help manage resource utilization
- prevents any single process, or user, from monopolizing system resources
(i.e. CPU time, memory, network bandwidth, etc.)
There are two kinds of cgroups:
1) transient
2) persistent
A transient cgroup refers to a temporary control group that is automatically
deleted when a process or seriice, associated with the cgroup, finishes executing.
What this simply means is that the cgroup does NOT persist after the process
or service is stopped.
A persisitent cgroup, on the other hand, remains configured even after a system
reboot. This type of cgroup can be created in a couple of ways, but is typically
done so using the systemd-run command - to manage resource (CPU time,
memory, network bandwidth, etc.) usage of a temporary process or service.
Some key points about transient cgroups:
- Creation:
Usually created dynamically using the systemd tools like systemd-run when
starting a process or service.
- Lifetime:
Exists only for the duration of the associated process or service, and is automatically
removed upom termination of the process or service. - Use cases:
Useful for managing resource usage of temporary tasks or applications that only need resource control during their active runtime.
Contrasting Transient cgroups with persistent cgroups:
- Persistent cgroups:
These cgroups are configured in systemd unit files and remain after a
system reboot, allowing for long-term resource management of services.
cgroups are a powerful resource management tool in the Linux ecosystem!!!
Trevor "Red Hat Evangelist" Chandler