Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of cgroup in ceph

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the use of cgroup in ceph, the article is very detailed, has a certain reference value, interested friends must read it!

1. Introduction of Cgroup

What is Cgroup? Cgroups, which stands for control groups, is a mechanism provided by the Linux kernel to limit, record, and isolate physical resources (such as cpu,memory,IO, etc.) used by process groups (process groups). It was originally proposed by google engineers and later integrated into the Linux kernel. Cgroups is also a resource management tool used by LXC to achieve virtualization. It can be said that without cgroups, there would be no LXC.

What can Cgroup do?

The original goal of Cgroups is to provide a unified framework for resource management, which not only integrates existing subsystems such as cpuset, but also provides interfaces for future development of new subsystems. Today's cgroups is suitable for a variety of application scenarios, from resource control of a single process to operating system-level virtualization (OS Level Virtualization). Cgroups provides the following features:

Limit the number of resources that a process group can use (Resource limiting). For example, the memory subsystem can set an upper limit of memory usage for the process group, and once the memory used by the process group reaches the limit, it will start OOM (out of memory).

Priority control (Prioritization) of the process group. For example, you can use the cpu subsystem to assign a specific cpu share to a process group.

Record the number of resources used by the process group (Accounting). For example, you can use the cpuacct subsystem to record the cpu time used by a process group

Process group isolation (isolation). For example: the use of ns subsystem can make different process groups use different namespace to achieve the purpose of isolation, different process groups have their own process, network, file system mount space.

Process group control (control). For example, a process group can be suspended and restored using the freezer subsystem.

What related concepts can Cgroup do?

Task (task). In cgroups, a task is a process of the system.

Control population (control group). A controlling group is a process divided according to certain criteria. Resource control in Cgroups is realized on the basis of controlling ethnic groups. A process can join a control group and migrate from one process group to another. The process of a process group can use cgroups to allocate resources in units of the control population, and is subject to the restrictions set by cgroups on the basis of the control group.

Hierarchy (hierarchy). The control population can be organized in the form of hierarchical, which is a control group tree. The child node on the control group tree the control group is the child of the parent node control group, inheriting the specific attributes of the parent control group.

Subsystem (subsytem). A subsystem is a resource controller. For example, the cpu subsystem is a controller that controls the allocation of cpu time. A subsystem must be attach to a level in order to work. After a subsystem is attached to a level, all control groups at that level are controlled by that subsystem.

interrelation

Each time a new level is created in the system, all tasks in the system are initial members of the default cgroup at that level (we call it root cgroup, this cgroup is created automatically when the level is created, and the cgroup created later in that level is a descendant of this cgroup).

A subsystem can only be attached to at most one level.

Multiple subsystems can be attached to a level.

A task can be a member of multiple cgroup, but these cgroup must be at different levels.

When a process (task) in the system creates a child process (task), the child task automatically becomes a member of the cgroup where its parent process resides. The subtask can then be moved to a different cgroup as needed, but it always inherits the cgroup of its parent task at first.

The Cgroups subsystem introduces blkio-this subsystem sets input / output limits for block devices, such as physical devices (disks, solid state drives, USB, etc.). Cpu-this subsystem uses the scheduler to provide cgroup task access to CPU. Cpuacct-- this subsystem automatically generates CPU reports used by tasks in cgroup. Cpuset-this subsystem allocates independent CPU (on multicore systems) and memory nodes for tasks in cgroup. Devices-this subsystem allows or denies tasks in cgroup access to the device. Freezer-this subsystem suspends or resumes tasks in cgroup. Memory-this subsystem sets the memory limits used by tasks in cgroup and automatically generates reports on memory resources used by those tasks. Net_cls-this subsystem marks network packets with a level identifier (classid), allowing the Linux flow control program (tc) to identify packets generated from a specific cgroup. Ns-- the namespace subsystem.

The above is all the content of the article "what is the use of cgroup in ceph?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report