The main functions of cgroups in docker:
Resource Limitation (ResourceLimitation)
cgroups can limit the total resources used by the process group. For example, if you set an upper limit for memory usage when the application is running, an OOM (OutofMemory) will be issued once this quota is exceeded.
Prioritization
By assigning the number of CPU time slices and the size of the hard disk IO bandwidth, it is actually equivalent to controlling the priority of the process.
Resource Statistics (Accounting)
cgroups can count system resource usage, such as CPU usage time, memory usage, etc. This function is very suitable for billing.
Process Control (Control)
cgroups can perform operations such as suspending and resuming process groups.
For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.
The above is the detailed content of What is the function of cgroup in docker. For more information, please follow other related articles on the PHP Chinese website!