Cgroup full name control groups, can be used to limit, record, and isolate the physical resources of the process group, the following small series will be a detailed introduction to the installation and configuration of Cgroup on Linux, interested in Cgroup Friends can come and learn.
Why do you have a cgroup
There is often a need in Linux systems to limit the allocation of resources for one or some processes. That is, the concept of a set of containers can be completed. In this container, there is a specific proportion of cpu time allocated, IO time, available memory size, and so on. So the concept of cgroup appeared, cgroup is the controller group, originally proposed by google engineers, and later integrated into the Linux kernel.
Cgroup is a Linux kernel function that manages the management of any process. The cgroup itself provides the infrastructure for the functions and interfaces that manage the process of packets.
Then the Android operating system relies on this technology to assign different cgroups to each application, and to isolate each program, so that an application does not affect other application environments.
Concepts
task:
A process
control group:
Control group, process group according to certain criteria< Br>
hierarchy:
Hierarchy, the control group can form a tree structure with parent nodes and child nodes. Each node is a control group, and the child nodes inherit the specific properties of the parent node.
subsystem:
Subsystem.
The subsystem is the resource controller, and each subsystem is a resource allocator. For example, the cpu subsystem controls the CPU time allocation.
You can use lssubsys -al to list how much seed system support system, and use ls /sys /fs /cgroup /(Ubuntu) has been mounted to display subsystem:
You can see several subsystems here, such as cpu is to control cpu time slice, memory is to control memory usage.
How to install cgroup
Install cgroup:
apt-get install cgroup-bin
How to assign restricted resources to cgroup
First of all, understand that the subsystem is mounted first, and then there is a control group. This means that if you want to limit the resources of some processes, then I will first mount the memory subsystem, then create a cgroup node in the memory subsystem, in which the process id to be controlled will be written and will be controlled. The properties are written.
Take memory subsystem, for example:
By looking cgroup configuration file:
cat /etc/cgconfig.conf
see The memory subsystem is mounted in the directory /sys/fs/cgroup/memory
Enter this directory
Create a folder and create a control group
Mkdir test
Previous12Next page Total 2 pages
The default path under Linux system is usually long, it seems very inconvenient, th
When we use a Linux computer, the default is to use ROOT users to log in, but sometimes we need to u
In the big family of Linux systems, Android is undoubtedly the most dazzling one. A
Recently, Xiaobian of the System Home found that many Linux beginners dont know muc
How to share files between Ubuntu and Windows
Linux removes the physical volume of PV in LVM
Ubuntu prompts missing fonts after installing WPS. What should I do?
How to undo operations in Git in Linux
Linux replacement hard disk has been mounted directory skills
How to back up web files under Linux
Git Workflow and Basic Operations in Linux
Ubuntu compile and install Hypertable method
Summary of screenshots under Ubuntu
Gentoo xorg-server prompts how to handle the failed to load module
Linux shell script comprehensive learning
Win10 comes with system compression function
How to disable guest users under Win8 system
Win10 Home Edition users: Microsoft should set up flow control for automatic update
Learn to start the screen management program with Win 8
What can I do if win7 cannot be shut down? Win7 does not have a shutdown option solution
Comprehensive analysis of why the Windows7 partition is more and worse,
How to set up a variety of screensavers under win7 system
Win7 system prompts the solution to find the share name
Win10 enters the countdown Win8 will rise to Win10 new system reason