About Resource Distribution Models
The following distribution models provide you ways of implementing control or regulation in
distributing resources for use by cgroups v2
:
- Weights
-
In this model, the weights of all the control groups are totaled. Each group receives a fraction of the resource based on the ratio of the group's weight against the total weight.
Consider 10 control groups, each with a weight of 100 for a combined total of 1000. In this case, each group can use a tenth of a specified resource.
Weight is typically used to distribute stateless resources. To apply this resource, the
CPUWeight
option is used. - Limits
-
In this model, a group can use up to the configured amount of a resource. If a resource such as memory usage for a process exceeds the limit, the kernel might stop the process with an out-of-memory (oom) message.
You can also overcommit resources so that the sum of the subgroups limits can exceed the limit of the parent group. Overcommitment assumes that resources in all subgroups aren't likely to all reach their limits at the same time.
To implement this distribution model, the
MemoryMax
option is often used. - Protections
-
In this model, a group is assigned a protected boundary. If the group's resource usage remains within the protected amount, the kernel can't deprive the group of the use of the resource in favor of other groups that are competing for the same resource. In this model, an overcommitment of resources is allowed.
To implement this model, the
MemoryLow
option is often used. - Allocations
-
In this model, a specific absolute amount is allocated for the use of finite type of resources, such as real-time budget.