CN116089089A - Resource management method and device - Google Patents

Resource management method and device Download PDF

Info

Publication number
CN116089089A
CN116089089A CN202310107325.9A CN202310107325A CN116089089A CN 116089089 A CN116089089 A CN 116089089A CN 202310107325 A CN202310107325 A CN 202310107325A CN 116089089 A CN116089089 A CN 116089089A
Authority
CN
China
Prior art keywords
resource
resource pool
class
application
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310107325.9A
Other languages
Chinese (zh)
Inventor
张慧敏
任钦伟
夏俊明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202310107325.9A priority Critical patent/CN116089089A/en
Publication of CN116089089A publication Critical patent/CN116089089A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a resource management method and device, wherein the resource management method comprises the following steps: selecting a corresponding resource pool from the resource pool set based on the class of the object of the resource to be allocated; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories; and allocating processing resources for the object of the resources to be allocated based on the selected resource pool.

Description

Resource management method and device
Technical Field
The present disclosure relates to computer technology, and in particular, to a method and apparatus for resource management.
Background
In a container arrangement platform such as K8S (Kubernetes), application is realized in a container state, and a workload is abstracted into PODs, so that automatic service arrangement and resource allocation are realized. Different applications have different demands on resources, such as applications requiring one or more dedicated central processing unit (Central Processing Unit, CPU) cores, requiring memory resources from the same non-coherent memory access (None-Uniform Memory Access, NUMA) node; alternatively, the application requires a hyper-thread from the same CPU, and the CPU core to which the tasks in the container and the tasks between containers in one POD are allocated cannot cross the NUMA node or the like.
It is therefore a constantly sought-after goal how to rationally perform resource allocation within a container orchestration platform so that applications run efficiently.
Disclosure of Invention
The embodiment of the application provides a resource management method and device, which can reasonably allocate resources in a container arrangement platform so that an application can effectively run.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a resource management method, which comprises the following steps: selecting a corresponding resource pool from the resource pool set based on the class of the object of the resource to be allocated; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories;
and allocating processing resources for the object of the resources to be allocated based on the selected resource pool.
In some embodiments, the method further comprises: and dividing the processing resources into a resource pool set formed by at least one resource pool for each node addressed by the non-physical address.
In some embodiments, the selecting a corresponding resource pool from a set of resource pools based on the class of the object to which the resource is to be allocated comprises:
if the class of the object of the resource to be allocated is a first type, selecting a first resource pool from the resource pool set;
wherein the first type is associated with a core component, and the processing resources in the first resource pool are reserved resources.
In some embodiments, the selecting a corresponding resource pool from a set of resource pools based on the class of the object to which the resource is to be allocated comprises:
if the class of the object of the resource to be allocated is the second type, selecting one resource pool from the resource pool set based on the attribute of the application;
wherein the second type is application dependent.
In some embodiments, the selecting one resource pool from the set of resource pools based on the attributes of the application comprises:
the attribute of the application is the service quality class of the application, and if the service quality class of the application is the first class and the application needs a certain amount of processing resources, a second resource pool is selected from the resource pool set;
the processing resources in the second resource pool are only used for applications with the service quality class of the first class, the limit values of the processing resources corresponding to the applications of the first class are the same, and the request values of the processing resources corresponding to the applications of the first class are the same.
In some embodiments, the selecting one resource pool from the set of resource pools based on the attributes of the application comprises:
the attribute of the application is the service quality class of the application, and if the service quality class of the application is the second class or the third class, a third resource pool is selected from the resource pool set;
wherein, the processing resources in the third resource pool are only used for applications with the service quality class of the second class and the third class;
the plurality of applications with the service quality categories of the second class have different limiting values of the processing resources corresponding to at least one application or have different request values of the processing resources corresponding to at least one application;
the quality of service class does not set the limit value and the request value of the corresponding processing resource for the application of the third class.
In some embodiments, the method further comprises: the object of the resource to be allocated runs in a container, and an event aiming at the container is monitored;
updating the set of resource pools based on the events for the containers.
In some embodiments, the updating the set of resource pools based on the events of the container comprises:
if the event aiming at the container is adding a container and the event aiming at the container carries information of exclusive resources, dividing the exclusive resources into a first resource pool of the container;
and if the event aiming at the container is deleting the container and the event aiming at the container carries the information of the exclusive resource, releasing the exclusive resource.
An embodiment of the present application provides a resource management device, including:
a selection module, configured to select a corresponding resource pool from a resource pool set based on a class of an object to be allocated resources; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories;
and the allocation module is used for allocating processing resources for the objects to be allocated with the resources based on the selected resource pool.
In some embodiments, the selecting module is configured to select a first resource pool from the resource pool set if the class of the object of the resource to be allocated is a first type;
if the class of the object of the resource to be allocated is the second type, selecting one resource pool from the resource pool set based on the attribute of the application;
wherein the first type is associated with a core component and the second type is associated with an application, and the processing resources in the first resource pool are reserved resources.
In some embodiments, the resource management device further comprises:
and the dividing module is used for dividing the processing resources into a resource pool set formed by at least one resource pool aiming at each node addressed by the non-physical address.
In some embodiments, the selecting module is configured to select a second resource pool from the set of resource pools if the attribute of the application is a quality of service class of the application, and the application needs a certain amount of processing resources if the quality of service class of the application is a first class;
the processing resources in the second resource pool are only used for applications with the service quality class of the first class, the limit values of the processing resources corresponding to the applications of the first class are the same, and the request values of the processing resources corresponding to the applications of the first class are the same.
In some embodiments, the attribute of the application is a quality of service class of the application, and if the quality of service class of the application is a second class or a third class, selecting a third resource pool from the set of resource pools;
wherein, the processing resources in the third resource pool are only used for applications with the service quality class of the second class and the third class;
the plurality of applications with the service quality categories of the second class have different limiting values of the processing resources corresponding to at least one application or have different request values of the processing resources corresponding to at least one application;
the quality of service class does not set the limit value and the request value of the corresponding processing resource for the application of the third class.
In some embodiments, the object to be allocated with the resource runs in a container, and the resource management device further includes:
a processing module for monitoring events for the container; updating the set of resource pools based on the events for the containers.
In some embodiments, the processing module is configured to divide the exclusive resource into a first resource pool of the container if the event for the container is adding the container and the event for the container carries information of the exclusive resource;
and if the event aiming at the container is deleting the container and the event aiming at the container carries the information of the exclusive resource, releasing the exclusive resource.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the resource management method provided by the embodiment of the application when executing the executable instructions stored in the memory.
The embodiment of the application provides a computer readable storage medium, which stores executable instructions for implementing the resource management method provided by the embodiment of the application when being executed by a processor.
According to the resource management method and the resource management device, a corresponding resource pool is selected from a resource pool set based on the category of an object to be allocated with resources; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories; and allocating processing resources for the object of the resources to be allocated based on the selected resource pool. In the embodiment of the application, processing resources are divided according to nodes addressed by non-physical addresses to obtain different resource pools; and the resource is divided according to the categories of the objects to be allocated with the resources, so that the resource allocation of the objects is realized as required, the reasonable allocation of the resources in the container arrangement platform is realized, and the application is effectively operated.
Drawings
FIG. 1 is a schematic diagram of an alternative process flow of a resource management method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a service provided by an embodiment of the present application;
FIG. 3 is a flowchart of a specific implementation of selecting a corresponding resource pool from a resource pool set based on a class of an object to be allocated resources according to an embodiment of the present application;
FIG. 4 is a flowchart of a specific implementation of selecting a resource pool from a set of resource pools based on an attribute of an application according to an embodiment of the present application;
FIG. 5 is a detailed process flow diagram of a resource management method according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another detailed process flow of the resource management method according to the embodiment of the present application;
FIG. 7 is a schematic diagram of a detailed process flow of a resource management method according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of resource partitioning for CPU cores included in a NUMA node according to an embodiment of the present application;
fig. 9 is a schematic diagram of a composition structure of a resource management device provided in an embodiment of the present application;
fig. 10 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein. In the following description, the term "plurality" refers to at least two.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
1) NUMA: there are multiple nodes, each of which may have multiple CPUs (each of which may have multiple cores or threads).
2) A container: the method is used for solving the problems of application development, testing, deployment and the like; the container may package the code with the configuration files and related dependency libraries to ensure consistent operation in any environment. The container provides process-level isolation, so that the utilization rate of the CPU and the memory can be set more finely, and the computing resources of the server can be utilized better. Each container may run as a separate process and may share system resources of the underlying operating system, which may increase the efficiency of starting and stopping the containers.
3) POD: is the smallest deployment unit in k8s, not a program/process, but an environment (including container, storage, network ip: port, container configuration). 1 or more containers can be run in the POD, and the containers inside one POD share all resources, including the ip: port and disk of the shared POD.
4) Processing resources: the resources corresponding to the virtualized application of the container orchestration platform may include at least a CPU, memory, large page memory, heterogeneous computing resources (e.g., accelerator cards and graphics processors (Graphic Processing Unit, GPU).
In the related art, when allocating resources to virtualized applications of a container orchestration platform, the resources are generally allocated by application-specific resources (resource) parameters, the resource parameters are confirmed by kubelet, the resources are scheduled by a scheduler (scheduler), and allocation of the resources is performed based on the total resources of K8S nodes and the configuration of the container. In this way, it can be ensured that the total amount of requests for resources required for all container acquisitions is within the range of the node's allocable capacity. If many CPU-intensive PODs are running on a node, the workload may migrate to a different CPU core.
Some applications (also referred to as workloads) are insensitive to resource migration, regardless of which resources are allocated, only a certain number of resources need to be acquired to ensure that the application is operating properly. Some applications have exclusive demands on resources such as a CPU (Central processing Unit), for example, some applications require one or more special CPU cores, and memory resources are required to come from the same NUMA node; alternatively, the application requires a hyper-thread from the same CPU, and the CPU core to which the tasks in the container and the tasks between containers in one POD are allocated cannot cross the NUMA node or the like. For such applications with exclusive demands on resources, when the resource management method in the related technology is adopted, a plurality of tasks corresponding to the applications may be migrated to different CPU cores, or one task occupies a plurality of CPUs, and a plurality of CPUs may also have a situation of crossing NUMA nodes; the reasonable allocation of resources is not carried out, and the running of the application program is affected.
Referring to fig. 1, fig. 1 is a schematic flowchart of an alternative process of the resource management method according to the embodiment of the present application, and will be described with reference to the steps shown in fig. 1.
Step S101, selecting a corresponding resource pool from the resource pool set based on the class of the object to be allocated the resource.
In some embodiments, the set of resource pools comprises one or at least two resource pools; the resource pool is obtained by dividing processing resources for each node addressed by a non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories. As an example, the resource pools in the set of resource pools may include: a system pool, a shared pool and an exclusive pool; the system pool is used for distributing resources to components such as an operating system, a K8S core component, a system kube and the like; the resources in the exclusive pool are used for being distributed to the applications needing the CPU and memory resources with the determined quantity; the resources in the shared pool are used for allocation to applications that do not require the distribution of resources, etc.
The processing resources may include at least one or more heterogeneous computing resources among a CPU, a memory, a large page memory, an accelerator card, and a GPU.
In some embodiments, a non-physically addressed node may refer to a node that has no actual physical address, such as a NUMA node or a service (service) as shown in FIG. 2. The service shown in fig. 2 is made up of any two or more working nodes in K8S.
In some embodiments, the class of objects to which resources are to be allocated may include at least a first type associated with the core component and a second type associated with the application. Wherein the first type of object may include an operating system, a K8S core component, a system kube, and the like. The second type of object may include applications requiring a certain amount of CPU and memory resources.
Step S102, processing resources are allocated to the objects to be allocated with the resources based on the selected resource pool.
In some embodiments, resources are selected in a selected resource pool according to the number of resources required by an object and the selected resources are allocated to the object.
The specific implementation procedure of step S101 is described in detail below.
In some embodiments, a specific implementation procedure of selecting a corresponding resource pool from the resource pool set based on a class of an object of the resource to be allocated, as shown in fig. 3, may at least include:
step S101a, determining a category of an object to which a resource is to be allocated.
In some embodiments, if the class of the object to be allocated with the resource is the first type, step S101b is performed. If the object class of the resource to be allocated is the second type, step S101c is executed.
Wherein, the first type of object may be an operating system, a K8S core component, a system kube, etc.; the first type of object requires the use of system reservation resources to ensure that other applications do not preempt the CPU core of the system component.
The second type of object may be an application requiring a certain amount of CPU and memory resources.
Step S101b, selecting a first resource pool from the set of resource pools.
In some embodiments, the first resource pool may also be referred to as a system resource pool, where the CPU core resources in the first resource pool are reserved for the system and kube daemon, and the resources in the first resource pool may only be allocated to components such as an operating system, a K8S core component, a system kube, and the like, so as to ensure that other applications do not preempt the CPU cores of the system components.
Step S101c, selecting a resource pool from the set of resource pools based on the attributes of the application.
In some embodiments, the application may be a quality of service (Quality of Service, qoS) class; accordingly, a specific implementation procedure for selecting one resource pool from the resource pool set based on the attribute of the application, as shown in fig. 4, may at least include:
step S1C1, determining the service quality class of the application.
In some embodiments, if the quality of service class of the application is the first class and the application needs a certain amount of processing resources, step S1C2 is performed.
If the quality of service class of the application is the second class or the third class, step S1C3 is executed.
And step S1C2, selecting a second resource pool from the resource pool set.
In some embodiments, the second resource pool may also be referred to as an exclusive resource pool, and resources within the second resource pool may only be allocated to applications requiring a certain amount of CPU and memory resources, which applications require the use of the isolCPU resources within the second resource pool and precisely specify the processor core distribution, i.e. deterministic supported PODs. The CPU cores in the exclusive resource pool can be isolated as special resources of specific service loads, the deterministic computing instance can select the CPU cores in the exclusive resource pool, and the service loads bind the deterministic computing instance, so that the effect of binding the POD with the appointed CPU cores is realized. In this way, it can be ensured that tasks in applications using the second resource pool are not scheduled by the exaggerated NUMA node. Or the resources in the second resource pool may only be allocated to applications requiring a certain amount of CPU and memory resources, which applications require the use of isolCPU resources in the second resource pool, but do not precisely specify processor core distribution; i.e. the normal supported POD.
The processing resources in the second resource pool are only used for applications with the service quality class of the first class, the limit value (limit) of the processing resources corresponding to the applications of the first class is the same, and the request value (request) of the processing resources corresponding to the applications of the first class is the same.
And step S1C3, selecting a third resource pool from the resource pool set.
In some embodiments, the third resource pool may also be referred to as a shared resource pool; the processing resources in the third resource pool are only used for the applications with the service quality class of the second class and the third class; the CPU cores in the shared resource pool may be shared for other resources. The plurality of applications with the service quality categories of the second class have different limiting values of the processing resources corresponding to at least one application or have different request values of the processing resources corresponding to at least one application; i.e., burstable POD. The quality of service class is that the application of the third class does not set the limit value and the request value of the corresponding processing resource, namely the BestEffort POD.
In the embodiment of the application, the resources are divided into the resource pool sets formed by one or more resource pools, and the resources in different resource pools are used for being distributed to different objects, so that the classification of the resources according to the requirements of the objects and the fixation and isolation of the resources are realized; and then the resource allocation in the container arrangement platform can be reasonably carried out, so that the resources are effectively and accurately allocated for the application, and the application can be effectively operated.
A detailed process flow diagram of the resource management method provided in the embodiment of the present application, as shown in fig. 5, at least includes the following steps:
step S201, for each node addressed by a non-physical address, dividing the processing resource into a set of resource pools consisting of at least one resource pool.
In some embodiments, if the node addressed by the non-physical address is a NUMA node, a different resource pool is configured for the NUMA node; such as configuring a system resource pool, a shared resource pool, and an exclusive resource pool for a NUMA node.
In some embodiments, resources within different resource pools are annotated into the node information of k8 s. Accordingly, after each deterministic service is deployed, the exclusive resources used by each POD are annotated to the annotation information of the POD in the form of annotations.
Step S202, selecting a corresponding resource pool from a plurality of resource pools based on the category of the object of the resource to be allocated.
Step S203, allocating processing resources to the objects to be allocated with resources based on the selected resource pool.
In some embodiments, the specific implementation process of step S202 to step S203 is the same as that of step S101 to step S102, and will not be described here again.
The detailed process flow diagram of the resource management method provided in the embodiment of the present application, as shown in fig. 6, at least includes the following steps:
step S301, selecting a corresponding resource pool from a plurality of resource pools based on the class of the object to be allocated the resource.
Step S302, processing resources are allocated to the objects to be allocated with the resources based on the selected resource pool.
In some embodiments, the specific implementation process of step S301 to step S302 is the same as that of step S101 to step S102, and will not be described here again.
Step S303, an object to be allocated with resources runs in a container, and an event aiming at the container is monitored; updating the set of resource pools based on the events for the containers.
In some embodiments, if the event for a container is adding a container and the event for a container carries information of an exclusive resource, dividing the exclusive resource into a first resource pool of the container; and if the event aiming at the container is deleting the container and the event aiming at the container carries the information of the exclusive resource, releasing the exclusive resource from the first resource pool.
In the embodiment of the application, by actively monitoring the starting and stopping of the container, whether the corresponding configuration (such as Cgroup setting) is to be updated or not is determined according to the container configuration, and the accurate allocation of the CPU core and the memory is dynamically realized.
Taking the K8S platform and the NUMA architecture as an example, a detailed process flow diagram of the resource management method provided in the embodiment of the present application, as shown in fig. 7, at least includes the following steps:
step S401, a system resource pool, an exclusive resource pool and a shared resource pool are configured for NUMA nodes.
In some embodiments, resources within different resource pools are annotated into the node information of the K8S.
Step S402, obtaining K8S node information.
In some embodiments, the cgroup dynamic programming implementation independent service (tc-exclusive-agent) detects resource pool information in the K8S node information every time it is started; such as which types of resource pools are configured for the K8S node, which processing resources are included in each type of resource pool.
Step S403, acquires processing resource information of the POD.
In some embodiments, the set of exclusive processing resources used by each POD will be annotated into the annotation information of the POD in the form of annotations; the set of exclusive processing resources used by the POD may include a set of CPUs.
In some embodiments, NUMA node information corresponding to the exclusive set of processing resources used by each POD is also annotated to the annotation information of the POD in the form of annotations.
the tc-exclusive-agent detects subsystem configuration of a CPU set of Cgroup of the POD when the service is started each time; and according to the CPU.mes and the CPU.memory_size parameters in the subsystem configuration, the memory used by the POD is constrained to the NUMA node where the CPU set is located, so that the memory is not accessed across the NUMA node.
Step S404, configuring the Cgroup subsystem.
In some embodiments, cgroups, collectively referred to as Control Groups, are the physical resource isolation mechanisms provided by the Linux kernel by which the resource restriction, isolation, and statistics functions of the Linux process or group of processes can be implemented. The configuration parameters corresponding to the Cgroups subsystem may include cpu et. Cpu and cpu et. Mes; where CPU sets represents CPU cores that can be used; cpu.mes represents the memory nodes (e.g., NUMA0, NUMA 1) that can be used.
In the embodiment of the application, the POD related to the Cgroup subsystem and the cpu of the hierarchy may be configured.
In some embodiments, the configuration parameters corresponding to the Cgroup subsystem may further include: cpu_exclusive and cpu_mem_exclusive. The cpu_output indicates whether to exclusive the resource in the cpu_output, and the default value of cpu_output is 0, which indicates that the resource in the cpu_output can be shared with other tasks.
Step S405, monitoring whether there is a POD addition event or a POD deletion event, and updating the resource pool according to the monitoring result.
In some embodiments, if a POD addition event is detected and the POD addition event carries a keyword "external", the CPU core to be used by the POD is deleted from the CPU cores and the CPU cores of the new POD are set as designated CPU cores.
In some embodiments, if a POD deletion event is detected and the deleted POD carries the keyword "external", the Cgroup configuration parameter of other gussed PODs is modified, and the CPU core that the POD originally occupies is added to the CPU.
An application scenario of the embodiments of the present application is described below. If the NUMA node includes NUMA0 and NUMA1, the resource partitioning is performed on the CPU cores included in the NUMA node, as shown in FIG. 8. As shown in fig. 8, the CPU cores included in the NUMA0 node and the NUMA1 node divide the CPU cores c00, c24, c12, and c36 into a system resource pool, and the CPU cores in the system resource pool are used for allocation to the system components. The CPU cores c03, c04, c05, c06, c27, c28, c29, c30, c15, c16, c17, c18, c39, c40, c41 and c42 are divided into exclusive resource pools, the CPU cores in the exclusive resource pools are marked CPU cores which are exclusively shared by the application X, and the CPU cores in the exclusive resource pools are exclusive CPU cores used by other protected applications Y. The CPU cores c01, c02, c07, c08, c09, c10, c11, c25, c26, c31, c32, c33, c34, c35, c13, c14, c19, c20, c21, c22, c23, c37, c38, c43, c44, c45, c46, and c47 are divided into a shared resource pool.
1) Configuration information for allocating CPU cores in a system resource pool to system components is shown in tables 1 and 2 below: table 1 is a configuration information table of an outer layer dock folder, and table 2 is a configuration information table of a kube container folder; from tables 1 and 2, both the outer docker folder and the kube container folder are configured to use only the CPU cores in the system resource pool.
TABLE 1 configuration information Table of docker folder
Figure BDA0004078290200000131
/>
Table 2. Configuration information table of kube container folder
Figure BDA0004078290200000132
2) The configuration information of the CPU cores in the exclusive resource pool allocated for application X is as follows in table 3:
TABLE 3 configuration information Table for allocating CPU cores in exclusive resource pool for application X
Figure BDA0004078290200000133
When the method is implemented, firstly, an X application is created, qoS class is set as protected, keywords are set in POD notes, and specific CPU cores in an exclusive resource pool are identified for use; the specific arrangement is as follows:
[root@master1 kubepods]#kubectl describe pod<app-A-pod-name>
Name:deterministic-calculation-pod
Annotations:tc_exclusive_CPUs:15,16,17,18,39,40,41,42
3) The configuration information of the CPU cores in the exclusive resource pool allocated for the application Y is as follows in table 4:
TABLE 4 configuration information Table of CPU cores in an exclusive resource pool allocated by application Y
Figure BDA0004078290200000141
4) The configuration information of the CPU cores in the shared resource pool is allocated to the application Z1 as shown in table 5 below:
TABLE 5 configuration information Table for CPU cores in shared resource pool with Z1 allocation
Figure BDA0004078290200000142
Figure BDA0004078290200000151
5) The configuration information of the CPU cores in the shared resource pool is allocated for the application Z2 as shown in table 6 below:
TABLE 6 configuration information Table for CPU cores in shared resource pool with Z2 allocation
Figure BDA0004078290200000152
After dividing the processing resources into three resource pools, annotating the POD nodes, and recording configuration information as follows: [ root@Master1 zhm ] #kubectl get node < node-name > -oyamal
annotations:
tc_isol_CPUs:3,4,5,6,27,28,29,30,15,16,17,18,39,40,41,42
tc_reservd_CPUs:0,12,24,36
tc_shared_CPUs:
1,2,7,8,9,10,11,25,26,31,32,33,34,35,13,14,19,20,21,22,23,37,38,43,44,45,46,47
And setting a starting parameter (cmdline parameter), and setting CPU cores in the exclusive resource pool as isolCPUs when restarting the node, so that the CPU cores are isolated and not scheduled for use. The specific arrangement is as follows: isolcpus= 3,4,5,6,27,28,29,30,15,16,17,18,39,40,41,42
nohz_full=3,4,5,6,27,28,29,30,15,16,17,18,39,40,41,42
In the various embodiments described above, by "isolating" a processing resource or a group of processing resources (e.g., CPU cores), a latency-sensitive workload processing thread may be pinned to executing on an isolated set of processing resources, providing exclusive access to the isolated set of processing resources for the latency-sensitive workload. Thus, the thread preemption can be reduced or eliminated, and the utilization rate of the CPU cache can be improved to the greatest extent. In the embodiment of the present application, the isolated processing resources also allow multiple virtual network functions to coexist on the same physical server.
The embodiment of the application further provides a resource management device, and the resource management device has a schematic composition structure, as shown in fig. 9, and the resource management device includes:
a selection module 501, configured to select a corresponding resource pool from a set of resource pools based on a class of an object to which a resource is to be allocated; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories;
an allocation module 502, configured to allocate processing resources for the object to be allocated resources based on the selected resource pool.
In some embodiments, the selecting module 501 is configured to select a first resource pool from the set of resource pools if the class of the object of the resource to be allocated is a first type;
if the class of the object of the resource to be allocated is the second type, selecting one resource pool from the resource pool set based on the attribute of the application;
wherein the first type is associated with a core component and the second type is associated with an application, and the processing resources in the first resource pool are reserved resources.
In some embodiments, the resource management device further comprises:
a partitioning module (not shown in fig. 9) for partitioning the processing resource into a set of resource pools of at least one resource pool for each node addressed by the non-physical address.
In some embodiments, the selecting module 501 is configured to select a second resource pool from the set of resource pools if the attribute of the application is a quality of service class of the application, and the application needs a certain amount of processing resources if the quality of service class of the application is a first class;
the processing resources in the second resource pool are only used for applications with the service quality class of the first class, the limit values of the processing resources corresponding to the applications of the first class are the same, and the request values of the processing resources corresponding to the applications of the first class are the same.
In some embodiments, the attribute of the application is a quality of service class of the application, and if the quality of service class of the application is a second class or a third class, selecting a third resource pool from the set of resource pools;
wherein, the processing resources in the third resource pool are only used for applications with the service quality class of the second class and the third class;
the plurality of applications with the service quality categories of the second class have different limiting values of the processing resources corresponding to at least one application or have different request values of the processing resources corresponding to at least one application;
the quality of service class does not set the limit value and the request value of the corresponding processing resource for the application of the third class.
In some embodiments, the object to be allocated with the resource runs in a container, and the resource management device further includes:
a processing module (not shown in fig. 9) for monitoring events for the container; updating the set of resource pools based on the events for the containers.
In some embodiments, the processing module is configured to divide the exclusive resource into a first resource pool of the container if the event for the container is adding the container and the event for the container carries information of the exclusive resource;
and if the event aiming at the container is deleting the container and the event aiming at the container carries the information of the exclusive resource, releasing the exclusive resource.
An embodiment of the present application provides an electronic device, including: a memory for storing executable instructions;
and the processor is used for realizing the resource management method provided by the embodiment of the application when executing the executable instructions stored in the memory.
Fig. 10 is a schematic diagram of a hardware composition structure of an electronic device according to an embodiment of the present application, and an electronic device 700 includes: at least one processor 701, memory 702, and at least one network interface 704. The various components in the electronic device 700 are coupled together by a bus system 705. It is appreciated that the bus system 705 is used to enable connected communications between these components. The bus system 705 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 705 in fig. 10.
It is to be appreciated that the memory 702 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Wherein the nonvolatile Memory may be ROM, programmable read-Only Memory (PROM, programmable Read-Only Memory), erasable programmable read-Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable read-Only Memory (EEPROM, electrically Erasable Programmable Read-Only Memory), magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk-Only (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (ddr SDRAM, double Data Rate Sy nchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Acces s Memory), direct memory bus random access memory (DRRAM, direct Rambus Rando m Access Memory). The memory 702 described in embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 702 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program for operating on the electronic device 700, such as application 7022. A program implementing the method of the embodiment of the present application may be contained in the application program 7022.
The method disclosed in the embodiments of the present application may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 may be a general purpose processor, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 701 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied in a hardware decoding processor or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium in a memory 702. The processor 701 reads information in the memory 702 and, in combination with its hardware, performs the steps of the method as described above.
In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSP, programmable logic device (PLD, programmable Logic Device), complex programmable logic device (CPLD, complex Programmable Logic Device), FPGA, general purpose processor, controller, MCU, MPU, or other electronic components for performing the aforementioned methods.
The embodiment of the application provides a computer readable storage medium, which stores executable instructions for implementing the resource management method provided by the embodiment of the application when being executed by a processor.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the resource management method according to the embodiment of the present application.
The present embodiments provide a computer readable storage medium having stored therein executable instructions that when executed by a processor will cause the processor to perform the resource management provided by the embodiments of the present application.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and scope of the present application are intended to be included within the scope of the present application.

Claims (10)

1. A method of resource management, the method comprising:
selecting a corresponding resource pool from the resource pool set based on the class of the object of the resource to be allocated; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories;
and allocating processing resources for the object of the resources to be allocated based on the selected resource pool.
2. The method of claim 1, the method further comprising:
and dividing the processing resources into a resource pool set formed by at least one resource pool for each node addressed by the non-physical address.
3. The method of claim 1, the selecting a corresponding resource pool from a set of resource pools based on a class of objects to which resources are to be allocated comprising:
if the class of the object of the resource to be allocated is a first type, selecting a first resource pool from the resource pool set;
wherein the first type is associated with a core component, and the processing resources in the first resource pool are reserved resources.
4. The method of claim 1, the selecting a corresponding resource pool from a set of resource pools based on a class of objects to which resources are to be allocated comprising:
if the class of the object of the resource to be allocated is the second type, selecting one resource pool from the resource pool set based on the attribute of the application;
wherein the second type is application dependent.
5. The method of claim 4, the selecting one resource pool from the set of resource pools based on attributes of the application comprising:
the attribute of the application is the service quality class of the application, and if the service quality class of the application is the first class and the application needs a certain amount of processing resources, a second resource pool is selected from the resource pool set;
the processing resources in the second resource pool are only used for applications with the service quality class of the first class, the limit values of the processing resources corresponding to the applications of the first class are the same, and the request values of the processing resources corresponding to the applications of the first class are the same.
6. The method of claim 4, the selecting one resource pool from the set of resource pools based on attributes of the application comprising:
the attribute of the application is the service quality class of the application, and if the service quality class of the application is the second class or the third class, a third resource pool is selected from the resource pool set;
wherein, the processing resources in the third resource pool are only used for the applications with the service quality class of the second class and the third class;
the plurality of applications with the service quality categories of the second class have different limiting values of the processing resources corresponding to at least one application or have different request values of the processing resources corresponding to at least one application;
the quality of service class does not set the limit value and the request value of the corresponding processing resource for the application of the third class.
7. The method of any one of claims 1 to 6, further comprising:
the object of the resource to be allocated runs in a container, and an event aiming at the container is monitored;
updating the set of resource pools based on the events for the containers.
8. The method of claim 7, the updating the resource pool set based on the events of the container comprising:
if the event aiming at the container is adding a container and the event aiming at the container carries information of exclusive resources, dividing the exclusive resources into a first resource pool of the container;
and if the event aiming at the container is deleting the container and the event aiming at the container carries the information of the exclusive resource, releasing the exclusive resource.
9. A resource management device, the resource management device comprising:
a selection module, configured to select a corresponding resource pool from a resource pool set based on a class of an object to be allocated resources; the resource pool is obtained by dividing processing resources aiming at nodes addressed by each non-physical address, and the processing resources in different resource pools are used for being distributed to objects of different categories;
and the allocation module is used for allocating processing resources for the objects to be allocated with the resources based on the selected resource pool.
10. The resource management device according to claim 8 or 9, the selection module being configured to select a first resource pool from the set of resource pools if the class of the object to be allocated resources is a first type;
if the class of the object of the resource to be allocated is the second type, selecting one resource pool from the resource pool set based on the attribute of the application;
wherein the first type is associated with a core component and the second type is associated with an application, and the processing resources in the first resource pool are reserved resources.
CN202310107325.9A 2023-01-19 2023-01-19 Resource management method and device Pending CN116089089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310107325.9A CN116089089A (en) 2023-01-19 2023-01-19 Resource management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310107325.9A CN116089089A (en) 2023-01-19 2023-01-19 Resource management method and device

Publications (1)

Publication Number Publication Date
CN116089089A true CN116089089A (en) 2023-05-09

Family

ID=86199061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310107325.9A Pending CN116089089A (en) 2023-01-19 2023-01-19 Resource management method and device

Country Status (1)

Country Link
CN (1) CN116089089A (en)

Similar Documents

Publication Publication Date Title
Chen et al. Enabling FPGAs in the cloud
US8996811B2 (en) Scheduler, multi-core processor system, and scheduling method
CN110120940B (en) File system resource isolation method for Docker container
US8060883B1 (en) System for managing and providing expandable resource reservations in a tree hierarchy
US9378069B2 (en) Lock spin wait operation for multi-threaded applications in a multi-core computing environment
US20070073993A1 (en) Memory allocation in a multi-node computer
CN104111897A (en) Data processing method, data processing device and computer system
CN111857993B (en) Method for calling user mode function in kernel mode
JP2008234191A (en) Hardware monitor management device and method of executing hardware monitor function
GB2473136A (en) Allocating resources to partitions in a data processing system at start up according to a configuration profile
US8943516B2 (en) Mechanism for optimized intra-die inter-nodelet messaging communication
CN113032101B (en) Resource allocation method of virtual machine, server and computer readable storage medium
CN114327777B (en) Method and device for determining global page directory, electronic equipment and storage medium
CN115185880B (en) Data storage method and device
CN114168271B (en) Task scheduling method, electronic device and storage medium
CN103049328A (en) Distribution method of internal memory resources in computer system
US11271895B1 (en) Implementing advanced networking capabilities using helm charts
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN112039963B (en) Processor binding method and device, computer equipment and storage medium
CN112330229B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
CN113535087A (en) Data processing method, server and storage system in data migration process
JP2690435B2 (en) Multiprocessor system having microprogram means for dispatching processing to a processor
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
CN116089089A (en) Resource management method and device
CN111737013B (en) Chip resource management method and device, storage medium and system chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination