CN111104219A - Binding method, device, equipment and storage medium of virtual core and physical core - Google Patents

Binding method, device, equipment and storage medium of virtual core and physical core Download PDF

Info

Publication number
CN111104219A
CN111104219A CN201911208779.5A CN201911208779A CN111104219A CN 111104219 A CN111104219 A CN 111104219A CN 201911208779 A CN201911208779 A CN 201911208779A CN 111104219 A CN111104219 A CN 111104219A
Authority
CN
China
Prior art keywords
cpu core
physical cpu
binding
physical
cloud host
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.)
Withdrawn
Application number
CN201911208779.5A
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.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology Co 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN201911208779.5A priority Critical patent/CN111104219A/en
Publication of CN111104219A publication Critical patent/CN111104219A/en
Withdrawn 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/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
    • 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/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • 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/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/503Resource availability

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Multi Processors (AREA)

Abstract

The invention discloses a binding method, a binding device, binding equipment and a binding storage medium of a cloud host virtual CPU core and a physical CPU core; in the method, the special physical CPU resource pool only binding the virtual CPU core is divided from the physical CPU resource of the server, so that after the binding request is received, the virtual CPU core and the physical CPU core in the special physical CPU resource pool can be bound, and then the distribution request of the physical CPU core is received, the virtual CPU core and the physical CPU core can be distributed from other resource pools.

Description

Binding method, device, equipment and storage medium of virtual core and physical core
Technical Field
The invention relates to the technical field of resource management, in particular to a method, a device and equipment for binding a virtual CPU core and a physical CPU core of a cloud host and a computer-readable storage medium.
Background
The cloud host is an important component of cloud computing in infrastructure application, is located at the bottom layer of a pyramid of a cloud computing industry chain, and originates from a cloud computing platform. At present, when a cloud host is created, a virtual Central Processing Unit (CPU) core of the cloud host needs to be bound with a physical CPU core, but when the physical CPU core is bound, the physical CPU core can only be bound in a resource pool at random, and the physical CPU core cannot be specified, which may cause that the physical CPU core cannot be fully utilized, for example:
assuming that there are 0-6 cores on NUMA node0 of Server A, core 4 core is bound when creating core cloud host a specifies a physical CPU core, then NUMA node0 has {0-3, 5-6} cores left that can be allocated by cloud host requests. At this time, if a request is made to create a cloud host b of 4 cores, NUMA node0 is excluded and is considered to be not satisfied with the cloud host creation condition. However, the number of physical CPU cores of the cloud host b meets the creation condition, and only because the cloud host a occupies the number of physical cores of 4, other cores are scattered, so that the request condition of the cloud host b cannot be met, and the physical CPU resource waste is caused.
Therefore, how to effectively manage physical CPU resources, improve the high availability of physical resources of the cloud platform, and improve the resource utilization rate is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for binding a virtual CPU core and a physical CPU core of a cloud host and a computer readable storage medium, so as to effectively manage physical CPU resources, improve the high availability of the physical resources of a cloud platform and improve the utilization rate of the resources.
In order to achieve the above object, the present invention provides a method for binding a virtual CPU core and a physical CPU core of a cloud host, including:
receiving a binding request, wherein the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host;
determining a physical CPU core to be bound from a special physical CPU resource pool; the special physical CPU resource pool is a resource pool only bound by a virtual CPU core;
and binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
Wherein, this scheme still includes:
receiving an allocation request, wherein the allocation request is as follows: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine;
determining a physical CPU core to be allocated from a shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation;
and distributing the physical CPU core to be distributed to a virtual CPU core of the cloud host.
After the virtual CPU core of the cloud host is bound to the physical CPU core to be bound, the method further includes:
and writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into a configuration file of the cloud host.
Wherein the determining of the physical CPU core to be bound from the dedicated physical CPU resource pool includes:
judging whether the binding request carries specified binding information or not; the specified binding information is information for binding a virtual CPU core CPUx of the cloud host to a physical CPU core CPUy, and the physical CPU core CPUy is a core in a special physical CPU resource pool;
if the CPUy exists, the physical CPU core CPUy is used as a physical CPU core to be bound;
and if not, randomly determining the physical CPU core to be bound from the special physical CPU resource pool.
If the NUMA number of the physical CPUs of the host is greater than one, the physical CPU core CPUy in the designated binding information is: the host computer comprises a same NUMA physical CPU core of the host computer physical CPU or a combination of different NUMA physical CPU cores of the host computer physical CPU.
In order to achieve the above object, the present invention further provides a device for binding a virtual CPU core and a physical CPU core of a cloud host, including:
the cloud host comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a binding request, and the binding request is a request for binding a virtual CPU core of the cloud host to a physical CPU core of a host;
the first determining module is used for determining a physical CPU core to be bound from the special physical CPU resource pool; the special physical CPU resource pool is a resource pool only bound by a virtual CPU core;
and the binding module is used for binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
Wherein, this scheme still includes:
a second receiving module, configured to receive an allocation request, where the allocation request is: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine;
the second determining module is used for determining a physical CPU core to be allocated from the shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation;
and the distribution module is used for distributing the physical CPU core to be distributed to the virtual CPU core of the cloud host.
Wherein, this scheme still includes:
and the binding relationship writing module is used for writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into the configuration file of the cloud host.
In order to achieve the above object, the present invention further provides a device for binding a virtual CPU core and a physical CPU core of a cloud host, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the binding method of the cloud host virtual CPU core and the physical CPU core when executing the computer program.
To achieve the above object, the present invention further provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the binding method between the cloud host virtual CPU core and the physical CPU core.
According to the scheme, the method for binding the virtual CPU core and the physical CPU core of the cloud host provided by the embodiment of the invention comprises the following steps: receiving a binding request, wherein the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host; determining a physical CPU core to be bound from a special physical CPU resource pool; the special physical CPU resource pool is a resource pool only binding the virtual CPU core; and binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
Therefore, in the application, the special physical CPU resource pool only binding the virtual CPU core is divided from the physical CPU resource of the server, so that after the binding request is received, the virtual CPU core can be bound with the physical CPU core in the special physical CPU resource pool, and when the allocation request of the physical CPU core is received again, the virtual CPU core and the physical CPU core can be allocated from other resource pools, and the bound physical CPU does not influence the allocation of the physical CPU, so that an effective physical CPU resource management mode is provided, the performance of a cloud host is improved, and the high availability and the utilization rate of the physical resource of a cloud platform are improved.
The invention also discloses a binding device, equipment and a computer readable storage medium of the cloud host virtual CPU core and the physical CPU core, and the technical effects can be realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a binding method between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another specific binding method between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a binding apparatus for a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a binding device between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Before discussing the present solution, it is noted that the terms used in the present application are explained to help understand the present solution:
cloud platform: the cloud management platform developed based on the OpenStack open source project comprises a computing module, a storage module, a network module and the like;
physical CPU: CPU hardware installed on the server;
physical CPU core: a physical CPU has multiple cores, and physical CPU core exposure information can be viewed on a physical host, for example, NUMA information on a physical server a is as follows:
NUMA node0 CPU(s): 0-6
NUMA node1 CPU(s): 7-12
explanation: one physical CPU that illustrates physical server a has two NUMAs: NUMA node0 and NUMA node1, both NUMA nodes sharing 12 cores, with 0-6 cores on NUMA node0 and 7-12 cores on NUAM node 1.
Core or number of cores: english is called Core;
physical CPU core resources: the method comprises the steps that a cloud host establishes the number of physical CPU cores to be bound;
virtual machine CPU core resources: the number of virtual CPU cores allocated during the creation of the cloud host;
available fields: a set of hosts.
The embodiment of the invention discloses a method, a device and equipment for binding a virtual CPU core and a physical CPU core of a cloud host and a computer readable storage medium, which are used for effectively managing physical CPU resources, improving the high availability of the physical resources of a cloud platform and improving the utilization rate of the resources.
Referring to fig. 1, a flow diagram of a binding method between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention is provided; the method comprises the following steps:
s101, receiving a binding request, wherein the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host;
it should be noted that, in the present application, it is necessary to manage, in advance, physical hosts existing in the same available domain on the cloud platform, and divide physical CPU resources in the available domain into a dedicated physical CPU resource pool and a shared physical CPU resource pool; the special physical CPU resource pool is selected when a physical CPU core is required to be bound when the cloud host is created; and the requirement on the performance of the CPU is not high, namely, the cloud host which only needs to be allocated with the physical CPU is not required to be bound, and the cloud host is selected from the shared physical CPU resource pool.
Here, the binding and allocation of physical CPU cores is explained in detail: binding means that when a cloud host is created, special CPU resources are required to be allocated to the cloud host, and CPU monopolization is performed, so that the computing capacity of the cloud host is improved. Distribution, a general CPU usage mode refers to that a cloud host uses a physical CPU of the host, the CPU may be occupied by a process (used in a time slice) at a certain time point or within a certain time period, and the process may need to use the CPU next time, but the CPU is occupied by other processes, and at this time, a desired effect cannot be achieved, that is, the performance of the cloud host cannot be improved. That is to say, the purpose of binding is that the CPU monopolizes, the performance of the cloud host is improved, the CPU core binding is not performed, it cannot be guaranteed that the CPU always provides service for the cloud host, and the requirement cannot be met when the cloud host needs to use high-performance CPU resources next time. Therefore, the present application separately sets the dedicated physical CPU resource pool for responding to the binding request, which is exemplified here:
assuming that the physical CPU cores are 0 to 10, if the cloud host a is bound with the host physical CPU and three cores of 0 to 2 are bound, the three cores are used by the cloud host a all the time. If the virtual CPU and the physical CPU core are not bound, the cloud host occupies 0-2CPU cores of the physical host within a certain time period, 3-5 physical CPU cores can be used next time, the cost is paid for the load balance among the CPU cores, and in addition, the physical CPUs share all memories in the system and have independent caches. For example, if load balancing is performed between processes in two different physical CPUs, the Cache will be disabled, which causes a decrease in efficiency, and frequent loading of resources (including CPU resources) will occupy a large amount of CPU resources, thereby reducing performance.
Further, when the dedicated physical CPU resource pool and the shared physical CPU resource pool are divided, the number of the divided resource pools of the dedicated physical CPU resource pool and the shared physical CPU resource pool can be set by self, and no mandatory limiting condition exists. However, only a CPU on one server can be selected when the cloud host is created, and the selection across hosts cannot be performed. Here, the following two examples are given to describe the division method of this embodiment:
1) if the number of the CPU cores on one server is 0-12, 0-7 can be set as a special CPU resource pool, 8-12 can be set as a shared CPU resource pool, and if the CPU resources of the current server are sufficient, a part of the created cloud host can occupy the special CPU resource pool, and the other part occupies the shared resource pool (combined with physical CPU binding of the cloud host).
2) There are 10 servers in the cluster, and the CPU resources on two of the servers can be set as dedicated CPU resources, and the other 8 servers are set as shared CPU resources, and it is only necessary to select whether to create a dedicated or shared resource pool when creating the cloud host.
It should be noted that the binding request in the present application is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host, the host is a host bearing the cloud host, and the host meeting conditions is selected according to resource requirements when the cloud host is created, for example: when the basic resources of the cloud host required to be created are { "vcpu": 5, "ram": 512, "disk": 10} (vcpu: virtual CPU, ram: memory, disk: hard disk), the cloud host scheduling program selects a host meeting the requirement from the existing hosts as a host for creating the cloud host, namely: and judging that the number of the available physical CPU cores of the host is larger than the vcpu number of the request, the size of the available memory of the host is larger than the ram size of the request, and the host with the hard disk size larger than the disk number of the request can be used as the host for creating the cloud host.
S102, determining a physical CPU core to be bound from a special physical CPU resource pool; wherein, the special physical CPU resource pool is a resource pool only binding the virtual CPU core;
it should be noted that the dedicated physical CPU resource pool in the present application is a resource pool only bound to a virtual CPU core, and then when an allocation request is received, a physical CPU core (for example, a shared physical CPU resource pool) needs to be allocated from a resource pool other than the dedicated physical CPU resource pool, and since the bound and allocated physical CPU core is not in the same physical CPU resource pool, the allocation request is not affected by the bound physical CPU core, thereby implementing effective management of the physical CPU resource, improving high availability of the physical resource of the cloud platform, and improving resource utilization rate.
Therefore, after receiving the binding request, the application needs to determine the physical CPU core to be bound from the dedicated physical CPU resource pool, and when determining the physical CPU core to be bound, the application may determine in multiple ways, for example: the determination may be performed in a specific manner, may be performed in a randomly allocated manner, may be performed in a predetermined order, and the like, and is not particularly limited herein.
S103, binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
After the physical CPU core to be bound is determined, the virtual CPU core of the cloud host and the physical CPU core to be bound can be bound.
Therefore, the method and the device have the advantages that the special physical CPU resource pool only binding the virtual CPU core is divided from the physical CPU resource of the server, so that after the binding request is received, the virtual CPU core can be bound with the physical CPU core in the special physical CPU resource pool, and when the distribution request of the physical CPU core is received, the virtual CPU core can be distributed from other resource pools, the bound physical CPU does not influence the distribution of the physical CPU, so that an effective physical CPU resource management mode is provided, the performance of a cloud host is improved, and the high availability and the utilization rate of the physical resource of the cloud platform are improved.
Referring to fig. 2, a flowchart of another specific binding method between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention is shown; the method comprises the following steps:
s201, receiving a binding request, wherein the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host;
s202, judging whether the binding request carries specified binding information or not; if yes, executing S203; if not, executing S204;
the designated binding information is information for binding a virtual CPU core CPUx of the cloud host to a physical CPU core CPUy, and the physical CPU core CPUy is a core in a special physical CPU resource pool; the special physical CPU resource pool is a resource pool only binding the virtual CPU core; if the NUMA number of the physical CPUs of the host is greater than one, the physical CPU core CPUy in the designated binding information is: the physical CPU cores of the same NUMA of the physical CPU of the host machine, or the combination of the physical CPU cores of different NUMA of the physical CPU of the host machine;
s203, taking the physical CPU core CPUy as a physical CPU core to be bound;
s204, randomly determining a physical CPU core to be bound from the special physical CPU resource pool;
s205, binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
Wherein, this scheme still includes: receiving an allocation request, wherein the allocation request is as follows: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine; determining a physical CPU core to be allocated from a shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation; and distributing the physical CPU core to be distributed to the virtual CPU core of the cloud host.
It should be noted that, if the application receives an allocation request, the allocation request does not specify a mapping relationship between a virtual CPU core of a cloud host and a host physical CPU core, that is: the physical CPU resources of the host which are automatically scheduled and allocated in the cloud host creating process are not bound, so that the created virtual CPU of the cloud host is allocated from the shared CPU resource pool.
It can be understood that, when determining the physical CPU core to be bound from the dedicated physical CPU resource pool, the CPU core to be bound may be determined in a specified manner, that is: the virtual CPUx of the cloud host can be bound to the physical CPUy; of course, the physical CPU core to be bound may also be determined from the dedicated physical CPU resource pool by a random selection method, and this is specifically described in terms of the number of virtual CPU cores of the cloud host and different conditions of the NUMA architecture of the physical CPU:
1) when the number of the virtual CPU cores of the cloud host required to be created is 1: because only 1 virtual CPU core needs to be bound, only the cloud host needs to be established in a special CPU resource pool or a shared CPU resource pool, and the physical CPU core of the host is automatically allocated to the cloud host through a cloud host scheduling program. In this embodiment, a virtual CPU core is specifically assigned to a physical CPU core in a dedicated physical CPU resource pool; of course, the number of physical CPU cores may also be automatically selected from the dedicated physical CPU resource pool to create, and when a physical CPU core is automatically selected, the selection may be performed according to the current state and pressure condition of the physical CPU, that is: since basic resources such as a virtual CPU, a memory, and a hard disk need to be specified when a cloud host is created, when automatically selecting, an appropriate physical host in the host cluster is selected according to the resource specified by the request to create, and therefore, when selecting a physical CPU core, the cloud host can be created by selecting a physical CPU core that satisfies the condition specified by the request.
2) When the number of virtual CPU cores of the cloud host which is requested to be created is 1, the configuration is related to whether the cloud host sets 'numa _ node ═ xx' or not; it should be noted that NUMA _ NODE refers to a NUMA architecture of physical CPUs, and NUMA NODEs of one CPU of a new server are generally 2 or more, for example: the NUMA architecture of a server is:
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
if there is only one NUMA node then only:
NUMA node0 CPU(s): 0-7,16-23
at this point, the NUMA node may be used as a dedicated CPU resource pool with available physical CPU cores of 0-7, 16-23.
Here, according to the configuration of "numa _ node ═ xx", there are mainly two cases:
a) if the physical CPU binding is not required, the created cloud host virtual CPU is distributed from the shared CPU resource pool;
b) if physical CPU binding is required and numa _ node is 1, the cloud host is dispatched to a special CPU resource pool, if a user specifies the number of physical CPU cores, the cloud host is created to the specified physical CPU cores, otherwise, the number of physical CPU cores is automatically selected as the creation resources of the cloud host, and if the satisfiable condition cannot be found, the cloud host is failed to create;
c) if physical CPU binding is required and "NUMA _ NODE ═ X (X > 1)", the cloud host will select a eligible physical CPU NUMA NODE for matching, and may combine physical CPU cores using different NUMA NODEs of the same physical CPU to match the creation condition, if the user specifies the number of physical CPU cores (which may be one or a combination, for example: 0-3, 5; 6-7,9-10), the cloud host is created to a specified physical CPU core, otherwise, the number of the physical CPU cores is automatically selected as the creation resource of the cloud host;
it should be noted that the purpose of dividing the dedicated resource pool is to effectively improve the management of the physical CPU resources of the host and effectively improve the performance of the cloud host. In the embodiment, by combining NUMA NODE bindings, physical CPU resources can be used to a greater extent,
d) part of the resources of the virtual CPU core of the cloud host may also be bound to the physical CPU core, that is, the cloud host virtual CPU core (virtual core >1) requested to be created may use the dedicated physical CPU resource pool and the shared physical CPU resource pool at the same time, and support of the configuration of "numa _ node ═ X (X > 1)" is required at this time.
It should be noted that, in the form of the server NUMA NODE architecture described above, there may be a plurality of NUMA NODEs on one server. Only if NUMA _ NODE >1, i.e., a server CPU has multiple NUMA NODEs, can the cloud host be built on different NUMA NODEs of the same CPU. Namely: one cloud host cannot be created across two CPUs, but two NUMA NODEs across one CPU are possible.
It should be noted that, at present when the cloud computing technology is prevalent, a high-efficiency and easy-to-use cloud platform is a foundation for standing heels, and at that time, because the current cloud platform does not support division of physical CPU resources, a physical CPU core cannot be specified to create a cloud host, physical server resources cannot be fully utilized, a demand scene of high availability of user resources cannot be met, and the usability of the cloud platform is greatly reduced. Therefore, the method and the device can solve the problems that the physical CPU resource of the cloud platform cannot be fully utilized and the virtual CPU of the cloud host is bound with the physical CPU and greatly improve the usability of the cloud platform by dividing the host resource pool into the special physical CPU resource pool and the shared physical CPU resource pool and supporting the creation of the specified physical CPU core number during the creation of the cloud host.
Based on any of the above method embodiments, in this embodiment, after the binding the virtual CPU core of the cloud host and the physical CPU core to be bound, the method further includes: and writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into a configuration file of the cloud host.
After the method for creating the cloud host physical CPU binding is added, the binding relationship between the virtual CPUx core and the physical CPUy core requested by the user needs to be injected into a cloud host configuration file, and the mapping relationship between the virtual CPUx core and the physical CPUy core is generated. Wherein, the step of injecting the binding relationship into the cloud host configuration file may be understood as: and writing the binding relationship into an XML file of the cloud host, wherein the XML file of the cloud host needs to bind the designated virtual CPU and the physical CPU of the host so as to know whether the CPU core number on the host is used or not, in addition, the host can mark the used CPU core number, and the occupied physical CPU cores on the host are not provided for the cloud host for scheduling when the cloud host is created next time.
It should be noted that the XML file of the cloud host is generated according to the configuration of the cloud host and some configurations in the current environment after the cloud host is successfully created, and the XML file is generated whether the CPU is used for binding or not. Therefore, in the present application, the CPUx/CPUy core number needs to be injected into the cloud host configuration file when the cloud host is created. The CPU mapping relation in the configuration file records whether the virtual CPU of the cloud host is bound to the physical CPU core of the host, if the virtual CPU is bound, the core number of the bound physical CPU core is recorded in the XML file, if the virtual CPU is not bound, only distribution is performed, the core number of the physical CPU core is not recorded in the XML file, only the number of virtual CPUs distributed to the cloud host is recorded, and the physical CPU information of the host is not reflected.
In summary, the improvement scheme of the policy that the virtual CPU core of the cloud platform cloud host is bound to the physical CPU core provided by the application is mainly improved in terms of binding the virtual CPU core to the physical CPU core when the cloud platform cloud host is created and a selection mode of the physical CPU core, and a specific implementation scheme is provided herein, and the main process is as follows:
1) setting physical servers in the same available domain on a cloud platform, and dividing a special physical CPU resource pool and a shared physical CPU resource pool;
2) setting the core number of a virtual CPU (central processing unit) allocated by a cloud host creation request, and determining whether the cloud host has a certain requirement on computing capacity and whether physical CPU binding is required;
it should be noted that the computing power may be a processing power for data, that is: if certain computing power is required, the virtual CPU and the physical CPU core can be bound at the moment, the exclusive use of the CPU is realized, the high-performance operation of the CPU can be ensured at the moment, and the CPU resource loss caused by frequently switching the physical CPU core and refreshing the CPU Cache is avoided.
3) Scheduling physical resources (including CPU, memory and hard disk resources) in an available domain according to the request resources of the cloud host, and judging whether the establishment conditions of the cloud host are met; and if the condition is met, selecting the host machine, and binding the virtual CPU core and the physical CPU core of the cloud host machine on the host machine by the binding method.
4) Successfully creating a cloud host, generating a cloud host XML file, and if a physical CPU binding request is set, acquiring a mapping relation between a cloud host virtual CPU core and a physical CPU core in the XML file or acquiring the mapping relation through a cloud platform;
it should be noted that, if the virtual machine XML information is not obtained from the cloud platform, the mapping relationship between the cloud host virtual CPU and the host physical CPU can be seen only by obtaining the virtual machine XML information through the underlying operation linux command. The mapping relation is obtained from the cloud platform, so that the use and the checking are convenient, and the usability of the cloud platform is improved.
5) And if the cloud host is failed to be established, giving out reasonable error prompt.
In conclusion, the management on the physical CPU resources of the host can be effectively improved by dividing the special resource pool, and the performance of the cloud host is effectively improved. The cloud platform cloud host is improved by establishing a virtual CPU core and physical CPU core binding strategy, and the designated physical CPU core is allowed to be bound, so that the utilization rate of the physical CPU can be effectively improved, and the usability of the cloud platform is greatly improved.
In the following, the binding apparatus provided by the embodiment of the present invention is introduced, and the binding apparatus described below and the binding method described above may be referred to each other.
Referring to fig. 3, a schematic structural diagram of a binding apparatus between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention is provided; the device includes:
a first receiving module 100, configured to receive a binding request, where the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host;
a first determining module 200, configured to determine a physical CPU core to be bound from a dedicated physical CPU resource pool; the special physical CPU resource pool is a resource pool only bound by a virtual CPU core;
a binding module 300, configured to bind the virtual CPU core of the cloud host with a physical CPU core to be bound.
Wherein, this scheme still includes:
a second receiving module, configured to receive an allocation request, where the allocation request is: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine;
the second determining module is used for determining a physical CPU core to be allocated from the shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation;
and the distribution module is used for distributing the physical CPU core to be distributed to the virtual CPU core of the cloud host.
Wherein, this scheme still includes:
and the binding relationship writing module is used for writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into the configuration file of the cloud host.
Wherein the first determining module comprises:
the judging unit is used for judging whether the binding request carries the specified binding information; the specified binding information is information for binding a virtual CPU core CPUx of the cloud host to a physical CPU core CPUy, and the physical CPU core CPUy is a core in a special physical CPU resource pool;
a first determining unit, configured to use the physical CPU core CPUy as a physical CPU core to be bound when the binding request carries specified binding information;
and the second determining unit is used for randomly determining the physical CPU core to be bound from the special physical CPU resource pool when the binding request does not carry the specified binding information.
If the NUMA number of the physical CPUs of the host is greater than one, the physical CPU core CPUy in the designated binding information is: the host computer comprises a same NUMA physical CPU core of the host computer physical CPU or a combination of different NUMA physical CPU cores of the host computer physical CPU.
The embodiment of the invention also discloses a binding device of the cloud host virtual CPU core and the physical CPU core, which comprises the following steps:
a memory for storing a computer program;
a processor, configured to implement the steps of the method for binding a cloud host virtual CPU core and a physical CPU core according to any of the method embodiments described above when executing the computer program.
In this embodiment, the device may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet Computer, a palmtop Computer, or a portable Computer.
Fig. 4 is a schematic structural diagram of a binding device between a virtual CPU core and a physical CPU core of a cloud host according to an embodiment of the present invention; the device may include, among other things, a memory 11, a processor 12, and a bus 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the device, for example a hard disk of the device. The memory 11 may also be an external storage device of the device in other embodiments, such as a plug-in hard disk provided on the device, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit of the device and an external storage device. The memory 11 may be used not only to store application software installed in the device and various kinds of data such as program codes for performing a binding method, etc., but also to temporarily store data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program codes stored in the memory 11 or Processing data, such as program codes for executing binding methods.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
Further, the device may further include a network interface 14, and the network interface 14 may optionally include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are generally used to establish a communication connection between the device and other electronic devices.
Optionally, the device may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the device and for displaying a visualized user interface.
Fig. 4 shows only the device with the components 11-14, and it will be understood by those skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the device, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when being executed by a processor, the computer program realizes the steps of the binding method of the cloud host virtual CPU core and the physical CPU core according to any method embodiment.
Wherein the storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A binding method of a cloud host virtual CPU core and a physical CPU core is characterized by comprising the following steps:
receiving a binding request, wherein the binding request is a request for binding a virtual CPU core of a cloud host to a physical CPU core of a host;
determining a physical CPU core to be bound from a special physical CPU resource pool; the special physical CPU resource pool is a resource pool only bound by a virtual CPU core;
and binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
2. The binding method according to claim 1, further comprising:
receiving an allocation request, wherein the allocation request is as follows: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine;
determining a physical CPU core to be allocated from a shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation;
and distributing the physical CPU core to be distributed to a virtual CPU core of the cloud host.
3. The binding method according to claim 1, wherein after binding the virtual CPU core of the cloud host with the physical CPU core to be bound, the method further comprises:
and writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into a configuration file of the cloud host.
4. The binding method according to any one of claims 1 to 3, wherein the determining the physical CPU core to be bound from the dedicated physical CPU resource pool comprises:
judging whether the binding request carries specified binding information or not; the specified binding information is information for binding a virtual CPU core CPUx of the cloud host to a physical CPU core CPUy, and the physical CPU core CPUy is a core in a special physical CPU resource pool;
if the CPUy exists, the physical CPU core CPUy is used as a physical CPU core to be bound;
and if not, randomly determining the physical CPU core to be bound from the special physical CPU resource pool.
5. The binding method according to claim 4,
if the NUMA number of the physical CPUs of the host is greater than one, the physical CPU core CPUy in the designated binding information is: the host computer comprises a same NUMA physical CPU core of the host computer physical CPU or a combination of different NUMA physical CPU cores of the host computer physical CPU.
6. A binding device of a cloud host virtual CPU core and a physical CPU core is characterized by comprising:
the cloud host comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a binding request, and the binding request is a request for binding a virtual CPU core of the cloud host to a physical CPU core of a host;
the first determining module is used for determining a physical CPU core to be bound from the special physical CPU resource pool; the special physical CPU resource pool is a resource pool only bound by a virtual CPU core;
and the binding module is used for binding the virtual CPU core of the cloud host with the physical CPU core to be bound.
7. The binding apparatus of claim 6, further comprising:
a second receiving module, configured to receive an allocation request, where the allocation request is: allocating a request of a physical CPU core of a host machine for a virtual CPU core of a cloud host machine;
the second determining module is used for determining a physical CPU core to be allocated from the shared physical CPU resource pool; the shared physical CPU resource pool is a resource pool for performing virtual CPU core allocation;
and the distribution module is used for distributing the physical CPU core to be distributed to the virtual CPU core of the cloud host.
8. The binding apparatus of claim 7, further comprising:
and the binding relationship writing module is used for writing the binding relationship between the virtual CPU core and the physical CPU core of the cloud host into the configuration file of the cloud host.
9. A binding device of a cloud host virtual CPU core and a physical CPU core is characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for binding a cloud host virtual CPU core to a physical CPU core according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps of the method for binding cloud host virtual CPU cores to physical CPU cores according to any one of claims 1 to 5.
CN201911208779.5A 2019-11-30 2019-11-30 Binding method, device, equipment and storage medium of virtual core and physical core Withdrawn CN111104219A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911208779.5A CN111104219A (en) 2019-11-30 2019-11-30 Binding method, device, equipment and storage medium of virtual core and physical core

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911208779.5A CN111104219A (en) 2019-11-30 2019-11-30 Binding method, device, equipment and storage medium of virtual core and physical core

Publications (1)

Publication Number Publication Date
CN111104219A true CN111104219A (en) 2020-05-05

Family

ID=70421204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911208779.5A Withdrawn CN111104219A (en) 2019-11-30 2019-11-30 Binding method, device, equipment and storage medium of virtual core and physical core

Country Status (1)

Country Link
CN (1) CN111104219A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831398A (en) * 2020-07-20 2020-10-27 平安科技(深圳)有限公司 Virtual machine creation and CPU resource allocation method, device and equipment
CN112052068A (en) * 2020-08-17 2020-12-08 烽火通信科技股份有限公司 Method and device for binding CPU (central processing unit) of Kubernetes container platform
CN112231058A (en) * 2020-10-16 2021-01-15 苏州浪潮智能科技有限公司 Method and device for creating cloud host by breaking NUMA topological limitation
CN116820687A (en) * 2023-08-29 2023-09-29 银河麒麟软件(长沙)有限公司 NUMA architecture resource allocation method and system based on kubelet

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180830A (en) * 2012-08-31 2013-06-26 华为技术有限公司 Cpu resource distribution method and calculating node
US9274823B1 (en) * 2014-12-24 2016-03-01 Parallels IP Holdings GmbH Thin hypervisor for native execution of unsafe code
CN109144706A (en) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 A kind of dynamic allocation method of cpu resource, device and physical machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180830A (en) * 2012-08-31 2013-06-26 华为技术有限公司 Cpu resource distribution method and calculating node
US9274823B1 (en) * 2014-12-24 2016-03-01 Parallels IP Holdings GmbH Thin hypervisor for native execution of unsafe code
CN109144706A (en) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 A kind of dynamic allocation method of cpu resource, device and physical machine

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831398A (en) * 2020-07-20 2020-10-27 平安科技(深圳)有限公司 Virtual machine creation and CPU resource allocation method, device and equipment
CN112052068A (en) * 2020-08-17 2020-12-08 烽火通信科技股份有限公司 Method and device for binding CPU (central processing unit) of Kubernetes container platform
CN112231058A (en) * 2020-10-16 2021-01-15 苏州浪潮智能科技有限公司 Method and device for creating cloud host by breaking NUMA topological limitation
CN116820687A (en) * 2023-08-29 2023-09-29 银河麒麟软件(长沙)有限公司 NUMA architecture resource allocation method and system based on kubelet
CN116820687B (en) * 2023-08-29 2023-12-05 银河麒麟软件(长沙)有限公司 NUMA architecture resource allocation method and system based on kubelet

Similar Documents

Publication Publication Date Title
CN108984264B (en) Virtual GPU (graphics processing Unit) implementation method, device and system
JP5510556B2 (en) Method and system for managing virtual machine storage space and physical hosts
CN111104219A (en) Binding method, device, equipment and storage medium of virtual core and physical core
EP3073374B1 (en) Thread creation method, service request processing method and related device
CN112825042A (en) Resource management method and device, electronic equipment and storage medium
WO2021135263A1 (en) Cpu resource reservation method and apparatus, and related device
CN109960569B (en) Virtualization processing method and device
CN110750336B (en) OpenStack virtual machine memory hot-expanding method
CN107209716B (en) Memory management device and method
US9697047B2 (en) Cooperation of hoarding memory allocators in a multi-process system
US20220229701A1 (en) Dynamic allocation of computing resources
CN113535087B (en) Data processing method, server and storage system in data migration process
CN105677481A (en) Method and system for processing data and electronic equipment
CN112162818B (en) Virtual memory allocation method and device, electronic equipment and storage medium
CN111831451A (en) Cloud host memory allocation method, cloud host, cloud device and storage medium
US9405470B2 (en) Data processing system and data processing method
CN114327862B (en) Memory allocation method and device, electronic equipment and storage medium
CN110447019B (en) Memory allocation manager and method for managing memory allocation performed thereby
CN110750330A (en) Virtual machine creating method, system, electronic equipment and storage medium
CN114281516A (en) Resource allocation method and device based on NUMA attribute
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
CN111949414B (en) Method, system, terminal and storage medium for optimizing performance of storage controller
CN109144231B (en) Virtualized power management method and device
CN113918283A (en) Data storage method, device, system and medium
CN113268346A (en) Dynamic resource allocation method and allocation device for edge nodes

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200505

WW01 Invention patent application withdrawn after publication