Distribution models of system sources
To control system resource usage, apply distribution models such as weights, limits, and protections. These settings determine how resources like CPU and memory are shared among control groups (cgroups).
Distribution models of system sources include the following options:
- Weights
-
You can distribute the resource by adding up the weights of all sub-groups and giving each sub-group the fraction matching its ratio against the sum.
For example, if you have 10 cgroups, each with weight of value 100, the sum is 1000. Each cgroup receives one tenth of the resource.
Weight is usually used to distribute stateless resources. For example, the CPUWeight= option is an implementation of this resource distribution model.
- Limits
-
A cgroup can consume up to the configured amount of the resource. The sum of sub-group limits can exceed the limit of the parent cgroup. Therefore it is possible to overcommit resources in this model.
For example, the MemoryMax= option is an implementation of this resource distribution model.
- Protections
-
You can configure a protected amount of a resource for a cgroup. If the resource usage is less than the protection boundary, the kernel will try not to penalize this cgroup in favor of other cgroups that compete for the same resource. An overcommit is also possible.
For example the MemoryLow= option is an implementation of this resource distribution model.
- Allocations
- Exclusive allocations of an absolute amount of a finite resource. An overcommit is not possible. An example of this resource type in Linux is the real-time budget.
- unit file option
-
A setting for resource control configuration.
For example, you can configure CPU resource with options such as CPUAccounting=, or CPUQuota=. Similarly, you can configure memory or I/O resources with options such as AllowedMemoryNodes= and IOAccounting=.