A method and device for scheduling physical cores
By adjusting the corresponding physical core of the virtual processor, the problem of insufficient resources of the virtual processor in computing devices is solved, and the rationality of resource allocation and physical core load balancing are improved.
Patent Information
- Application Number
- CN202211602831.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-12-13
AI Technical Summary
Existing computing devices may cause insufficient resources when allocating virtual processors (vCPUs) to physical cores, causing vCPUs to run exceptions.
By determining the usage parameters of N virtual processors in the virtual machine, the computing device flexibly adjusts the corresponding physical cores of these virtual processors, so that the target virtual processor runs on a physical core that is more in line with its resource requirements.
It improves the reasonable allocation of computing device resources, reduces the possibility of vCPU running abnormalities due to insufficient resources, and realizes the balance of physical core load.
Smart Images

Figure CN116225685B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method and device for scheduling physical cores. Background Art
[0002] Applications (APPs) provided by application providers can be deployed on the cloud platform. Applications can be accessed by users and provide services to users. Applications include, for example, social media applications or e-commerce applications. The cloud platform can be implemented by a computing device. The computing device used to implement the cloud platform can deploy a virtual machine (VM), and applications can be deployed on the VM. The computing device can allocate one or more virtual processors (virtual centralized processing unit, vCPU) to the VM, and multiple vCPUs can provide processing power for the VM. Multiple vCPUs run on at least one physical core included in the computing device.
[0003] At present, general computing devices can randomly allocate physical cores to these multiple vCPUs, and one vCPU among the multiple vCPUs is correspondingly allocated to one physical core. In this way, multiple vCPUs may be concentrated on one physical core, which may cause some of the multiple vCPUs to run abnormally due to insufficient resources. Summary of the invention
[0004] The embodiments of the present application provide a method and apparatus for scheduling physical cores, which are used to improve the rationality of allocating resources of a computing device and reduce the possibility of abnormal operation of a vCPU.
[0005] In the first aspect, an embodiment of the present application provides a method for scheduling physical cores, which can be executed by a computing device, or can be executed by a software module or a hardware module in the computing device, or can be executed by a chip system having the function of a computing device. For ease of description, the following is an example of a computing device executing the method. The method includes: determining the usage parameters of N virtual processors included in the virtual machine, the usage parameters representing the usage parameters of the resources of the N virtual processors for the M physical cores of the computing device, the N virtual processors running on some or all of the physical cores of the M physical cores, one of the virtual processors running on one of the M physical cores, N is a positive integer, and M is an integer greater than 1; according to the usage parameters, the target virtual processor running on the first physical core is adjusted to run on the second physical core, the second physical core is a physical core of the M physical cores other than the first physical core, and the target virtual processor belongs to the N virtual processors. Optionally, the resources of the M physical cores include, for example, the computing power of the M physical cores.
[0006] In the embodiment of the present application, the computing device can flexibly adjust the physical cores corresponding to some or all of the N virtual processors according to the usage parameters of the N virtual processors for the M physical cores, so that the target virtual processor can run on the physical core that better meets the resource requirements of the target virtual processor, which is equivalent to coordinating the resources used by the virtual processor, which is conducive to the reasonable allocation of the physical cores of the computing device, thereby improving the rationality of the resource allocation of the computing device, and reducing the possibility of abnormal operation of the vCPU due to insufficient resources. In addition, since the embodiment of the present application can flexibly adjust the physical cores of the virtual processor distribution, to a certain extent, the virtual processor can be relatively dispersed to run on the M physical cores of the computing device, which is conducive to balancing the load of the physical core. In addition, the computing device adjusts the physical core corresponding to the target virtual processor, which depends on the usage parameters of the N virtual processors for the M physical cores. The usage parameters of the N virtual processors for the M physical cores are directly obtainable by the computing device, and there is no need to obtain the usage parameters from the application program running in the virtual machine of the computing device, so that the privacy data of the user using the application will not be violated, and the security of the user's data is guaranteed, which also makes the universality (or applicability) of the method provided in the embodiment of the present application better.
[0007] In one possible implementation, if the value of the usage parameter is less than a first threshold, the computing power of the first physical core is greater than the computing power of the second physical core; or, if the value of the usage parameter is greater than a second threshold, the computing power of the first physical core is less than the computing power of the second physical core; wherein the first threshold is less than the second threshold.
[0008] In the above implementation, when the usage parameters are small, the target virtual processor can be adjusted to run on a physical core with smaller computing power. While ensuring the normal operation of the target virtual processor, the physical core with larger computing power can be used to run a virtual processor with higher computing power requirements. In this way, the overall resource utilization of the computing device can be improved. When the usage parameters are large, the target virtual processor can be adjusted to run on a physical core with larger computing power, so that the target virtual processor can run smoothly and improve the reliability of the operation of the target virtual processor. In addition, the physical core running the target virtual processor is adjusted according to the flexibility of the usage parameters, so that the virtual processor can run on M physical cores in a relatively dispersed manner, which is conducive to achieving load balancing of the M physical cores.
[0009] In one possible implementation, the computing power of the first physical core is greater than the computing power of the second physical core, and the target virtual processor satisfies the following conditions: the serial number of the first performance parameter of the target virtual processor is less than or equal to P, and the serial number is obtained by sorting the first performance parameters of the N virtual processors in ascending order of the values of the first performance parameters of the N virtual processors, and P is a positive integer less than or equal to N; and / or the value of the first performance parameter of the target virtual processor is less than a third threshold; wherein the first performance parameter of the target virtual processor is a scheduling parameter of the target virtual processor for hardware resources in a first time period, and the hardware resources are hardware resources provided by the computing device.
[0010] In the above implementation, the computing device may use the virtual processor with the relatively small first performance parameter among the N virtual processors as the target virtual processor, and adjust the target virtual processor to run on the physical core with smaller computing power, so as to ensure the smooth operation of the target virtual processor and relatively improve the resource utilization of the physical core with smaller computing power. In addition, since the performance parameter of the target virtual processor itself is relatively small, even if the target virtual processor is adjusted to run on the physical core with smaller computing power, the probability of affecting the performance parameter of the target virtual processor is also low.
[0011] In one possible implementation, the computing power of the first physical core is less than the computing power of the second physical core, and the target virtual processor satisfies the following conditions: the serial number of the first performance parameter of the target virtual processor is greater than K, and the serial number is obtained by sorting the first performance parameters of the N virtual processors in ascending order of the values of the first performance parameters of the N virtual processors, and K is a positive integer less than or equal to N; and / or the value of the first performance parameter of the target virtual processor is greater than a third threshold; wherein the first performance parameter of the target virtual processor represents a scheduling parameter of the target virtual processor for hardware resources within a first time period, and the hardware resources are hardware resources provided by the computing device.
[0012] In the above implementation, the computing device may use the virtual processor with the relatively large first performance parameter among the N virtual processors as the target virtual processor, and adjust the target virtual processor to run on the physical core with greater computing power to ensure the smooth operation of the target virtual processor. In addition, since the performance parameter of the target virtual processor itself is relatively large, adjusting the target virtual processor to run on the physical core with greater computing power is conducive to improving the resource utilization of the physical core with greater computing power.
[0013] In one possible implementation, the method further includes: determining a second performance parameter of the target virtual processor, the second performance parameter of the target virtual processor representing a scheduling parameter of the target virtual processor for hardware resources within a second time period, the hardware resources being hardware resources provided by the computing device, and the start time of the second time period being after the target virtual processor running on the first physical core is adjusted to run on the second physical core; if the absolute value of the difference between the second performance parameter of the target virtual processor and the first performance parameter of the target virtual processor is greater than a fourth threshold, adjusting the target virtual processor running on the second physical core to run on the first physical core, wherein the first performance parameter of the target virtual processor represents a scheduling parameter of the target virtual processor for the hardware resources within the first time period.
[0014] In the above embodiment, after adjusting the physical core on which the target virtual processor runs, the change in the performance parameters of the target virtual processor can be determined. If the performance parameters of the target virtual processor change significantly compared to before, it means that adjusting the physical core on which the target virtual processor runs has a greater impact on the performance parameters of the target virtual processor. Therefore, the physical core on which the target virtual processor runs can be restored to the physical core on which it ran before, ensuring that the performance parameters of the target virtual processor are relatively stable, which is conducive to improving the stability of the operation of the target virtual processor.
[0015] In one possible implementation, the method further includes: determining a second performance parameter of the virtual machine, the second performance parameter of the virtual machine representing a scheduling parameter of the virtual machine for hardware resources within a second time period, the hardware resources being hardware resources provided by the computing device, the start time of the second time period being after the target virtual processor running on the first physical core is adjusted to run on the second physical core; if the absolute value of the difference between the second performance parameter of the virtual machine and the first performance parameter of the virtual machine is greater than a fourth threshold, adjusting the target virtual processor running on the second physical core to run on the first physical core, wherein the first performance parameter of the virtual machine represents the scheduling parameter of the virtual machine for the hardware resources within the first time period.
[0016] In the above implementation, after adjusting the physical core on which the target virtual processor runs, the change in the performance parameters of the virtual machine corresponding to the target virtual processor can be determined. If the performance parameters of the virtual machine change significantly compared to before, it means that adjusting the physical core on which the target virtual processor runs has a greater impact on the performance parameters of the virtual machine. Therefore, the physical core on which the target virtual processor runs can be restored to the physical core on which it ran before, so that the virtual machine can maintain a better operating condition, which is beneficial to improving the reliability of the target virtual processor.
[0017] In a possible implementation, before adjusting the target virtual processor running on the first physical core to run on the second physical core, the method further includes: determining that a value of a first performance parameter of the target virtual processor is less than a sixth threshold, the sixth threshold being determined based on a third performance parameter of the virtual processor running on the second physical core, the first performance parameter of the target virtual processor representing an indicator of the target virtual processor calling hardware resources within a first time period, the third performance parameter representing a calling parameter of the virtual processor for hardware resources when running on the second physical core, the hardware resources being hardware resources provided by the computing device; or, determining that a value of a first performance parameter of the virtual machine is less than a sixth threshold, the sixth threshold being determined based on the third performance parameter of the virtual machine satisfying a first condition, the first performance parameter of the virtual machine representing an indicator of the virtual machine calling hardware resources within the first time period, the third performance parameter representing a calling parameter of the virtual machine for hardware resources when the first condition is satisfied, the hardware resources being hardware resources provided by the computing device, the first condition including that the operating condition of the virtual machine is the same as the operating condition of the virtual machine after adjusting the target virtual processor running on the first physical core to run on the second physical core.
[0018] In the above implementation, before adjusting the physical core on which the target virtual processor runs, it can be determined that the performance parameter of the target virtual processor is less than the third performance parameter of the virtual processor on the second physical core, so that the target virtual processor can run smoothly on the second physical core, which is conducive to improving the reliability of the target virtual processor. Alternatively, before adjusting the physical core on which the target virtual processor runs, it can be determined that the performance parameter of the virtual machine is less than the sixth threshold, so that after adjusting the physical core on which the target virtual processor runs, the virtual machine can still run smoothly, ensuring the reliability of the virtual machine operation.
[0019] In one possible implementation, after adjusting the target virtual processor running on the first physical core to run on the second physical core, the method further includes: determining the number of times the physical core on which the target virtual processor runs is adjusted within a third time period; if the number is greater than or equal to a fifth threshold, performing any one of the following: adjusting the first threshold, wherein the difference between the second threshold and the first threshold after adjustment is greater than the difference between the second threshold and the first threshold before adjustment; adjusting the second threshold, wherein the difference between the second threshold after adjustment and the first threshold is greater than the difference between the second threshold and the first threshold before adjustment; or, adjusting the second threshold and the first threshold, wherein the difference between the second threshold after adjustment and the first threshold after adjustment is greater than the difference between the second threshold and the first threshold before adjustment.
[0020] In the above embodiment, when the computing device determines that the number of times the physical core on which the virtual processor runs is adjusted is large, the first threshold and / or the second threshold can be adjusted to make the values of the first threshold and the second threshold more reasonable, so that the physical core on which the virtual processor runs can be adjusted relatively more accurately.
[0021] In a second aspect, an embodiment of the present application provides a device for scheduling a physical core, which may be the computing device in the first aspect, or a chip system. The device for scheduling a physical core includes corresponding means or modules for executing the first aspect or any possible implementation method.
[0022] For example, the device for scheduling physical cores includes a collection module (also called a collection unit) and a scheduling module (also called an adjustment unit).
[0023] Exemplarily, the acquisition module is used to determine usage parameters of N virtual processors included in the virtual machine, the usage parameters represent usage parameters of the N virtual processors for the computing power of M physical cores of the computing device, the N virtual processors run on some or all of the M physical cores, one of the virtual processors runs on one of the M physical cores, N is a positive integer, and M is an integer greater than 1; the scheduling module is used to adjust the target virtual processor running on the first physical core to run on the second physical core according to the usage parameters, the second physical core is a physical core of the M physical cores excluding the first physical core, and the target virtual processor belongs to the N virtual processors.
[0024] Optionally, the device for scheduling physical cores further includes a performance judgment module (also referred to as a performance judgment unit) and an anti-shake module (also referred to as an anti-shake unit).
[0025] For example, the performance judgment module is used to determine the second performance parameter of the virtual machine, the second performance parameter of the virtual machine represents the scheduling parameter of the virtual machine for hardware resources within a second time period, the hardware resources are hardware resources provided by the computing device, and the start time of the second time period is after the target virtual processor running on the first physical core is adjusted to run on the second physical core; if the absolute value of the difference between the second performance parameter of the virtual machine and the first performance parameter of the virtual machine is greater than a fourth threshold, the scheduling module is also used to adjust the target virtual processor running on the second physical core to run on the first physical core, wherein the first performance parameter of the virtual machine represents the scheduling parameter of the virtual machine for the hardware resources within the first time period.
[0026] The anti-shake module is also used to determine the number of times the physical core running the target virtual processor is adjusted within a third time period; if the number is greater than or equal to a fifth threshold, perform any one of the following: adjust the first threshold, wherein the difference between the second threshold and the first threshold after adjustment is greater than the difference between the second threshold and the first threshold before adjustment; adjust the second threshold, wherein the difference between the second threshold after adjustment and the first threshold is greater than the difference between the second threshold and the first threshold before adjustment; or adjust the second threshold and the first threshold, wherein the difference between the second threshold after adjustment and the first threshold after adjustment is greater than the difference between the second threshold and the first threshold before adjustment.
[0027] In a third aspect, an embodiment of the present application provides an apparatus for scheduling a physical core, and the apparatus for scheduling a physical core may be the computing device in the first aspect, or an electronic device (e.g., a chip system) configured in the computing device. The apparatus for scheduling a physical core includes corresponding means or modules for executing the first aspect or any possible implementation method.
[0028] For example, the device for scheduling physical cores includes a processing module (also referred to as a processing unit). Optionally, the processing module can be used to implement the functions of the acquisition module and the scheduling module in the second aspect. Optionally, the processing module can also be used to implement the functions of the performance judgment module and the anti-shake module in the second aspect.
[0029] Exemplarily, the processing module is used to determine usage parameters of N virtual processors included in the virtual machine, the usage parameters represent usage parameters of the computing power of the N virtual processors for M physical cores of the computing device, the N virtual processors run on some or all of the M physical cores, one of the virtual processors runs on one of the M physical cores, N is a positive integer, M is an integer greater than 1, and based on the usage parameters, the target virtual processor running on the first physical core is adjusted to run on the second physical core, the second physical core is a physical core of the M physical cores excluding the first physical core, and the target virtual processor belongs to the N virtual processors.
[0030] In one possible implementation, the communication device includes a storage module (also referred to as a storage unit), the processing module can be coupled to the storage module, and execute the program or instructions in the storage module, so that the device for scheduling the physical core can perform the functions of the above-mentioned computing device.
[0031] In a fourth aspect, an embodiment of the present application provides a device for scheduling a physical core. The device includes: a processor and a memory; the memory is used to store one or more computer programs, the one or more computer programs include computer execution instructions, and when the computing device is running, the processor executes the one or more computer programs stored in the memory, so that the computing device performs any of the methods described in the first aspect and any possible implementation.
[0032] The device includes a processor and a memory; the memory is used to store one or more computer programs, and the one or more computer programs include computer execution instructions. When the device for scheduling physical cores is running, the processor executes the one or more computer programs stored in the memory, so that the device for scheduling physical cores implements the method described in the first aspect and any possible implementation method.
[0033] Optionally, the device for scheduling physical cores further includes other components, such as antennas, input / output modules, interfaces, etc. These components may be hardware, software, or a combination of software and hardware.
[0034] In a fifth aspect, an embodiment of the present application provides a chip system, the chip system comprising: a processor and an interface. The processor is used to call and run instructions from the interface, and when the processor executes the instructions, the method described in the first aspect and any possible implementation is implemented.
[0035] In a sixth aspect, an embodiment of the present application provides a computing device cluster, which includes at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster implements any method described in the first aspect and any possible implementation.
[0036] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store computer programs or instructions. When the computer-readable storage medium is executed, it implements the method described in the first aspect and any possible implementation method.
[0037] In an eighth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, implements the method described in the first aspect and any possible implementation manner.
[0038] Regarding the beneficial effects of the second to eighth aspects, reference may be made to the beneficial effects discussed in the first aspect and will not be listed here again. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a scenario applicable to an embodiment of the present application;
[0040] Figure 2 A schematic diagram of another scenario applicable to the embodiments of the present application;
[0041] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a CPU provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of a method for scheduling physical cores provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the usage parameters of N vCPUs collected in two cycles provided in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of a method for adjusting the physical core running on a target virtual processor provided in an embodiment of the present application;
[0046] Figure 8 A schematic diagram of a method for determining and adjusting a physical core on which a target virtual processor runs provided by an embodiment of the present application;
[0047] Fig. 9A schematic diagram of a method for calling back the physical core running the target vCPU provided in an embodiment of the present application;
[0048] Fig.10 A schematic diagram of a method for calling back the physical core running the target vCPU provided in an embodiment of the present application;
[0049] Fig.11 A schematic diagram of the structure of a device for scheduling physical cores provided in an embodiment of the present application;
[0050] Fig.12 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0051] Fig.13 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0053] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0054] 1. Terminal equipment is a device with wireless transceiver function, which can be a fixed device, mobile device, handheld device, wearable device, vehicle-mounted device, or a wireless device built into the above device (for example, a communication module or chip system, etc.). The terminal equipment is used to connect people, objects, machines, etc., and can be widely used in various scenarios, such as but not limited to the following scenarios: cellular communication, device-to-device communication (D2D), vehicle to everything (V2X), machine-to-machine / machine-type communication (M2M / MTC), Internet of Things (IoT), virtual reality (VR), augmented reality (AR), industrial control, self-driving, remote medical, smart grid, smart furniture, smart office, smart wear, smart transportation, smart city, drone, robot and other scenarios. The terminal device may sometimes be referred to as user equipment (UE), terminal, access station, UE station, remote station, wireless communication device, or user device, etc.
[0055] 2. Computing device refers to a device with computing capabilities, such as a terminal device or a server. A server is generally a device that can be used to provide services to users. For example, a server can provide storage services and / or computing services to users.
[0056] 3. Processor: A component of a computing device that is used to execute instructions and process data in the computing device. A processor is, for example, a central processing unit (CPU).
[0057] 4. Physical core, also known as CPU core or CPU core, is one of the components of a CPU. A CPU may include at least one physical core. Each of the at least one physical core can independently execute instructions in a computing device. A physical core can be considered a hardware-based processing unit in a CPU.
[0058] 5. VM refers to a computer system simulated by software. VM can be deployed (or run) in a computing device. For a computing device, VM is equivalent to an application (APP) program running in the computing device. An application program can be referred to as an application.
[0059] 6. Hypervisor, also known as VM manager, VM controller or monitor. A hypervisor is software used to create and manage VMs. In addition, a hypervisor allows a computing device to deploy multiple VMs through virtual memory and computing resources. An example of a hypervisor is a VM monitor.
[0060] 7. Virtual centralized processing unit (vCPU) represents a portion or share of the CPU assigned to a VM. vCPU can be understood as a software implementation of the CPU. vCPU does not really exist like a CPU. The hypervisor can assign vCPUs to VMs. Each vCPU can be regarded by the VM as a real physical core. The vCPU can be mapped (or bound) to the resources of the physical core in the CPU for a period of time. The VM can request the vCPU to execute instructions, but the instructions are actually executed by the physical core mapped (or bound) to the vCPU.
[0061] In the embodiments of the present application, the number of nouns, unless otherwise specified, means "singular noun or plural noun", that is, "one or more". "At least one" means one or more, and "plural" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. For example, A / B means: A or B. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c means: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0062] Please refer to Figure 1 , is a schematic diagram of a scenario applicable to the embodiment of the present application. Or, Figure 1 It can also be understood as a schematic diagram of the architecture of a system for scheduling physical cores. Figure 1As shown, the scenario includes a cloud platform and at least one terminal device. The cloud platform may also be referred to as a cloud platform, or simply referred to as a cloud. The cloud platform may correspond to a cloud provider, in other words, the cloud provider may manage the cloud platform. At least one terminal device corresponds to a user, in other words, the user may operate at least one terminal device.
[0063] For example, an application provider may deploy an application on a cloud platform. In other words, the application may rely on the resources of the cloud platform to run. A user may access the application through at least one terminal device to use the services provided by the application.
[0064] In the case where the cloud platform does not provide services to the outside, the cloud platform may be a private cloud platform, and the private cloud platform may be called a private cloud. External refers to businesses other than the cloud provider. In this case, the application provider and the cloud provider are the same. Alternatively, in the case where the cloud platform provides services to the outside, the cloud platform may be a public cloud platform, and the public cloud platform may be called a public cloud. In this case, the application provider and the cloud provider may be the same or different. The cloud platform involved in the embodiments of the present application may be a private cloud platform or a public cloud platform, and the embodiments of the present application do not specifically limit this.
[0065] The cloud platform may include at least one computing device. Any two computing devices in the at least one computing device may communicate with each other. Some or all computing devices in the at least one computing device may include at least two physical cores with different computing powers. For example, each computing device in the at least one computing device includes at least two physical cores with different computing powers.
[0066] exist Figure 1 In the example, the number of at least one terminal device is 2, but the number of terminal devices included in the at least one terminal device is not actually limited. Figure 1 In the example, the number of computing devices included in the cloud platform is 2, but the number of computing devices included in the cloud platform is not actually limited.
[0067] Please refer to Figure 2 , is a schematic diagram of another scenario applicable to the embodiment of the present application. Or, Figure 2 It can also be understood as a structural diagram of a system for scheduling physical cores. Figure 2 As shown, the scenario includes a computing device corresponding to a user, and the computing device includes at least two physical cores with different computing powers.
[0068] Please refer to Figure 3 , which is a structural diagram of a computing device provided in an embodiment of the present application. Figure 3 The computing device involved is, for example, Figure 1 Any computing device involved, or Figure 2 The computing devices involved.
[0069] like Figure 3 As shown, the computing device includes a CPU. The CPU includes M physical cores, where M is an integer greater than 1. Figure 3 In the description, M physical cores including physical core 1, physical core 2, physical core 3 and physical core 4 are taken as an example. The computing power of any two physical cores among physical core 1, physical core 2, physical core 3 and physical core 4 is different. For example, the computing power of physical core 4 is greater than the computing power of physical core 2, the computing power of physical core 2 is greater than the computing power of physical core 1, and the computing power of physical core 1 is greater than the computing power of physical core 3.
[0070] The computing device may run (or deploy) at least one VM. Figure 3 In the example, at least one VM includes a VM. The VM can run (or deploy) an application, for example, the VM can run application 1. In addition, the VM may include N vCPUs, where N is a positive integer. Figure 3 The example is taken as N vCPUs including vCPU1, vCPU2 and vCPU3.
[0071] vCPU1 can run on physical core 1, which can also be described as vCPU1 is bound to physical core 1. vCPU2 can run on physical core 2, which can also be described as CPU2 is bound to physical core 2. vCPU3 can run on physical core 3, which can also be described as vCPU3 is bound to physical core 3.
[0072] The computing device also includes a device for scheduling physical cores. For example, the device for scheduling physical cores may be a hardware module in the computing device. Alternatively, the device for scheduling physical cores may be a software module in the computing device, and the device for scheduling physical cores may be, for example, an APP running in the computing device, or a software module integrated in the operating system of the computing device. The software module integrated in the operating system of the computing device may be, for example, an operating system kernel, which is part of the operating system.
[0073] The device for scheduling physical cores can adjust the physical core on which any vCPU included in the VM runs. For example, the device for scheduling physical cores can adjust the vCPU running on physical core 1 to run on physical core 2. The specific content of adjusting the physical core on which any vCPU runs will be introduced below.
[0074] Please refer to Figure 4 , is a schematic diagram of the structure of a CPU provided in an embodiment of the present application. Figure 4 The CPU involved is, for example, Figure 3 The CPUs involved. In addition, Figure 4In the description, a CPU including four physical cores, namely, physical core 1, physical core 2, physical core 3, and physical core 4, is taken as an example. Any two physical cores among physical core 1, physical core 2, physical core 3, and physical core 4 can be connected through a bus interface.
[0075] like Figure 4 As shown, the structures of the four physical cores, namely, physical core 1, physical core 2, physical core 3 and physical core 4, can be the same. The following is an introduction taking physical core 1 as an example.
[0076] The physical core 1 includes an arithmetic logic unit (ALU). The ALU may be implemented by a logic digital circuit. The ALU may be used to perform arithmetic operations or bit operations on binary numbers. The number of ALUs that the physical core 0 may include may be greater than or equal to 1.
[0077] Optionally, the physical core 1 may further include a performance monitoring unit (PMU). The PMU may be used to detect at least one performance parameter of a vCPU (such as vCPU1) running on the physical core 1. The at least one performance parameter of vCPU1 represents a calling parameter (or calling condition) of the hardware resources of the computing device by vCPU1.
[0078] Among them, at least one performance parameter of vCPU1 includes, for example, at least one of instructions per second (IPS), memory accesses per second, or cache accesses per second. The IPS of vCPU1 can be understood as the number of instructions executed by physical core 1 per second. The memory accesses per second of vCPU1 can be understood as the number of times vCPU1 accesses the memory of the computing device per second. The cache accesses per second of vCPU1 can be understood as the number of times vCPU1 accesses the cache of physical core 1 per second.
[0079] The following describes the method provided by the embodiments of the present application in conjunction with the accompanying drawings. The computing device involved in each embodiment of the present application is, for example, Figures 1 to 3 Any computing device involved, and a device for scheduling physical cores, such as Figure 3 The device involved in scheduling physical cores, such as CPU, is Figure 3 or Figure 4 The CPUs and VMs involved are, for example, Figure 3 The VM involved has M physical cores, for example Figure 3 For example, physical core 1, physical core 2, physical core 3, and physical core 4, and N vCPUs are Figure 3 The involved vCPUs are vCPU1, vCPU2, and vCPU3.
[0080] Please refer to Figure 5 , is a schematic diagram of a method for scheduling physical cores provided in an embodiment of the present application. Figure 5 The method is described by taking a computing device executing the method as an example.
[0081] S501. A computing device determines usage parameters of N vCPUs included in a VM.
[0082] The N vCPUs are vCPUs included in the VM, for example, all vCPUs included in the VM. Alternatively, the N vCPUs can be understood as vCPUs allocated by the computing device to the VM, and N is a positive integer.
[0083] The usage parameters of N vCPUs refer to the usage parameters of the resources of M physical cores by N vCPUs, reflecting the overall situation of the resources of M physical cores used by N vCPUs. Among them, the M physical cores are the physical cores included in the computing device, for example, all the physical cores included in the computing device. The resources of the M physical cores include, for example, the computing power of the M physical cores, and optionally, the resources of the M physical cores may also include, for example, the storage of the M physical cores. In order to simplify the description, the usage parameters of N vCPUs are referred to as the first usage parameters below.
[0084] The first usage parameter may be a first usage parameter at a certain moment (such as the current moment), or may be a first usage parameter for a certain time period (such as a fourth time period). The duration value of the fourth time period may be configured in the computing device, for example, the duration value of the fourth time period may be manually configured in the computing device by a user.
[0085] The meaning of the first usage parameter is different, and the method of determining the first usage parameter is different, which is introduced below respectively.
[0086] Case 1: The first usage parameter is the first usage parameter at the current moment.
[0087] Exemplarily, the computing device may collect the second usage parameter of each vCPU in the N vCPUs at the current moment, and determine the average value of the second usage parameter of each vCPU in the N vCPUs at the current moment as the first usage parameter.
[0088] In a possible implementation, the second usage parameter of each vCPU in the N vCPUs at the current moment is, for example, the usage of each vCPU for the M physical cores at the current moment. Accordingly, the computing device may determine the first usage parameter according to the usage of each vCPU in the N vCPUs for the M physical cores at the current moment.
[0089] Exemplarily, the computing device may collect the usage of M physical cores by each vCPU in N vCPUs at the current moment, obtain N usages in total, and determine an average value of the N usages as the first usage parameter.
[0090] In another possible implementation, the second usage parameter of each vCPU in the N vCPUs at the current moment is, for example, the usage rate of each vCPU for the M physical cores at the current moment. Accordingly, the computing device may determine the first usage parameter according to the usage rate of each vCPU in the N vCPUs for the M physical cores at the current moment.
[0091] Exemplarily, the computing device may collect the usage rate of each vCPU in the N vCPUs for the M physical cores at the current moment, obtain a total of N usage rates, and determine an average value of the N usage rates as the first usage parameter.
[0092] One of the N utilization rates may be the ratio of the average utilization of M physical cores by one vCPU among N vCPUs to the allocated amount corresponding to the vCPU; or, the ratio of the utilization of M physical cores by one vCPU among N vCPUs to the total amount of resources provided by the M physical cores; or, the ratio of the number of M physical cores used by one vCPU among N vCPUs to the total number of M physical cores.
[0093] For example, N vCPUs include vCPU1, vCPU2, and vCPU3, and the computing device collects a usage rate of 3% for M physical cores of vCPU1 at the current moment, a usage rate of 2% for M physical cores of vCPU2 at the current moment, and a usage rate of 10% for M physical cores of vCPU32 at the current moment. The computing device may determine the first usage parameter as: [(3%+2%+10%) / 3]=7.5%.
[0094] Case 2: the first usage parameter is the first usage parameter of the fourth time period.
[0095] The computing device determines the first usage parameter according to the second usage parameter of each vCPU of the N vCPUs in a fourth time period.
[0096] Exemplarily, the computing device may collect the second usage parameters of each vCPU in the N vCPUs at S moments, and may obtain a total of S second usage parameters corresponding to each vCPU in the N vCPUs, and determine the first usage parameter according to the S second usage parameters corresponding to each vCPU in the N vCPUs. S is an integer greater than 1, and the S moments are multiple moments in the fourth time period.
[0097] For example, the computing device determines the average value of the S second usage parameters of each vCPU in the fourth time period based on the S second usage parameters corresponding to each vCPU in the N vCPUs. Similarly, N average values corresponding to the N vCPUs can be obtained, and the weighted sum of the N average values corresponding to the N vCPUs is determined as the first usage parameter.
[0098] Optionally, the computing device may use the value corresponding to the fourth time period as a period to periodically determine the usage parameters of the N vCPUs in each period. In this case, the fourth time period may be the Tth period, where T is a positive integer.
[0099] For example, see Figure 6 , which is a schematic diagram of the second usage parameters of N vCPUs in the (T-1)th cycle and the second usage parameters in the Tth cycle provided in an embodiment of the present application.
[0100] like Figure 6 As shown, the computing device may determine the first usage parameters of the N vCPUs in the (T-1)th cycle according to the second usage parameters of each vCPU in the N vCPUs in the (T-1)th cycle, and may obtain the first usage parameters of the N vCPUs in the Tth cycle according to the second usage parameters of each vCPU in the N vCPUs in the Tth cycle. Figure 6 As shown, the second usage parameters of vCPU1 in the (T-1)th cycle include U 10 toU 1T-1 ,like Figure 6 As shown, the second usage parameter of vCPU2 in the (T-1)th cycle includes U 20 to U 2T-1 The second usage parameters of vCPUN in the (T-1)th cycle include U N0 to U NT-1 .like Figure 6 As shown, the second usage parameters of vCPU1 in the Tth cycle include U 11 toU 1T ,like Figure 6 As shown, the second usage parameters of vCPU2 in the Tth cycle include U 21 toU 2T The second usage parameters of vCPUN in the Tth cycle include U N1 toU NT .
[0101] Optionally, the calculation formula of the first usage parameter in the Tth period may refer to the following formula (1).
[0102]
[0103] in, Indicates the first usage parameter of N vCPUs in the Tth cycle. represents the average value of the second usage parameter of the m-th vCPU among N vCPUs in the T-th cycle, where m is an integer greater than or equal to 1 and less than or equal to N. The calculation formula can be referred to as shown in the following formula (2).
[0104]
[0105] Wherein, s represents the number of moments for collecting the second usage parameter of the m-th vCPU in the T-th period, or can be referred to as the size of the sliding window for collecting the second usage parameter, It represents the second usage parameter of the mth vCPU at the time (Ti) in the Tth cycle. The value of can correspond to Figure 6 The value of the second usage parameter of the m-th vCPU in the T-th cycle.
[0106] Among them, the content of the first usage parameter is different, and the method of determining the first usage parameter is also different, which is explained below respectively.
[0107] In a possible implementation, the second usage parameter of each vCPU in the N vCPUs in the fourth time period is, for example, the usage of the M physical cores by each vCPU in the fourth time period. Accordingly, the computing device may determine the first usage parameter according to the usage of the M physical cores by each vCPU in the N vCPUs in the fourth time period.
[0108] In another possible implementation, the second usage parameter of each vCPU in the N vCPUs in the fourth time period is, for example, the usage rate of each vCPU for the M physical cores at the current moment. Accordingly, the computing device may determine the first usage parameter according to the usage rate of each vCPU in the N vCPUs for the M physical cores in the fourth time period.
[0109] S502: The computing device adjusts the target vCPU running on the first physical core to run on the second physical core according to the usage parameters of the N vCPUs (ie, the first usage parameters). The target vCPU belongs to the M vCPUs.
[0110] The following describes how a computing device determines a target vCPU.
[0111] Method 1: The computing device can randomly determine the target vCPU from M physical cores.
[0112] Method 2: The computing device may determine the target vCPU according to the first performance parameters of the N vCPUs.
[0113] The first performance parameter is a scheduling parameter of the vCPU for hardware resources in the first time period. The length of the first time period and the fourth time period can be arbitrary, for example, the length of the first time period is greater than the length of the fourth time period, the length of the first time period is less than the length of the fourth time period, or the length of the first time period is equal to the length of the fourth time period. In the case where the length of the first time period is equal to the length of the fourth time period, the fourth time period and the first time period are the same time period.
[0114] The manner in which the computing device determines the first performance parameters of any two vCPUs among N vCPUs may be the same, and the following is introduced by taking the computing device determining the first performance parameter of one vCPU as an example.
[0115] The computing device may collect the value of at least one performance parameter of a vCPU in a first time period. The at least one performance parameter may include at least one of IPS, memory accesses per second, or cache accesses per second. For example, the computing device may collect the value of at least one performance parameter of a vCPU through a first PMU. The first PMU is a PMU included in a physical core for running the vCPU.
[0116] If at least one performance parameter is a performance parameter, the computing device may use an average value of a performance parameter of a vCPU in the first time period as a first performance parameter of a vCPU. Similarly, the computing device may obtain the first performance parameter of each vCPU in the N vCPUs.
[0117] If at least one performance parameter is a plurality of performance parameters, the computing device may obtain a plurality of average values according to the average value of each performance parameter in the plurality of performance parameters of a vCPU in the first time period. The computing device may perform weighted summation on the plurality of average values according to the weight of each performance parameter in the plurality of performance parameters to obtain a weighted summation result. The computing device determines the weighted summation result as the first performance parameter of a vCPU. By analogy, the computing device may obtain the first performance parameter of each vCPU in N vCPUs. The weight of each performance parameter in the plurality of performance parameters may be preconfigured in the computing device, for example, manually configured in the computing device by a user.
[0118] Optionally, the weight of each performance parameter in the multiple performance parameters may be 1. Alternatively, the weights of at least two performance parameters in the multiple performance parameters are different. For example, the multiple performance parameters include IPS and memory accesses per second, the weight corresponding to IPS is 0.9, and the weight corresponding to memory accesses per second is 0.8.
[0119] For example, the computing device collects multiple performance parameters of the mth vCPU among N vCPUs in the first time period and expresses them as follows: is the value of the gth performance parameter among multiple performance parameters.
[0120] The computing device determines the g-th performance parameter, and the calculation formula for the average value within the first time period can refer to the following calculation formula (3).
[0121]
[0122] The meaning of s can be found in the previous text. Represents the average value of the g-th performance parameter.
[0123] By analogy, the computing device can obtain the average value of each performance parameter of at least one performance parameter of the mth vCPU.
[0124] The computing device may perform a weighted summation on the average value of each performance parameter of at least one performance parameter of the mth vCPU to obtain a first performance parameter corresponding to the mth vCPU. The calculation formula of the first performance parameter may refer to the following formula (4).
[0125]
[0126] Among them, α g represents the weight corresponding to the g-th performance parameter, represents the first performance parameter corresponding to the mth vCPU, and R represents the number of multiple performance parameters.
[0127] In the first sub-method of determining the target vCPU under the second method, the computing device may determine the vCPU having a relatively smaller value of the first performance parameter of the M physical cores as the target vCPU.
[0128] For example, the computing device determines the vCPU whose serial number of the first performance parameter among the M physical cores is less than or equal to P as the target vCPU, where P is a positive integer less than or equal to N. For example, the value of P may be 1.
[0129] Exemplarily, the computing device sorts the first performance parameters of N vCPUs in ascending order according to their values. In this way, the serial number of the first performance parameter of each vCPU in the N vCPUs can be obtained, and the vCPU corresponding to the first performance parameter with a serial number less than or equal to P is taken as the target vCPU.
[0130] Alternatively, the computing device determines a vCPU among the M physical cores whose value of the first performance parameter is less than a third threshold as a target vCPU.
[0131] Alternatively, the computing device may determine as the target vCPU a vCPU whose sequence number of the first performance parameter among the M physical cores is less than or equal to P and whose value of the first performance parameter is less than a third threshold. The third threshold may be preconfigured in the computing device.
[0132] In the second sub-method of determining the target vCPU under the second method, the computing device may also determine the vCPU having a relatively larger value of the first performance parameter of the M physical cores as the target vCPU.
[0133] Exemplarily, the computing device may determine the vCPU whose serial number of the first performance parameter among the M physical cores is greater than K as the target vCPU, where K is a positive integer less than or equal to N. The manner in which the computing device obtains the serial number of the first performance parameter among the M physical cores may refer to the content discussed above. For example, the value of K may be (N-1).
[0134] Alternatively, the computing device may determine a vCPU among the M physical cores whose value of the first performance parameter is greater than a third threshold as the target vCPU.
[0135] Alternatively, the computing device may determine, as the target vCPU, a vCPU whose sequence number of the first performance parameter among the M physical cores is greater than or equal to K and whose value of the first performance parameter is greater than a third threshold.
[0136] Please refer to Figure 7 , is a schematic diagram of a method for adjusting the second physical core on which the target vCPU runs provided by an embodiment of the present application. Or, Figure 7 It can also be understood as a schematic diagram of a possible implementation of S502.
[0137] S701: The computing device determines whether the value of a first usage parameter is less than a first threshold.
[0138] If the value of the first usage parameter is less than the first threshold, the computing device may execute S702, i.e., adjust the target vCPU to run on a physical core with less computing power. If the value of the first usage parameter is not less than the first threshold (i.e., greater than or equal to the first threshold), the computing device may execute S703, i.e., determine whether the value of the first usage parameter is greater than the second threshold. If the value of the first usage parameter is greater than the second threshold, the computing device may execute S704, i.e., adjust the target vCPU to run on a physical core with greater computing power. If the value of the first usage parameter is not greater than the second threshold (i.e., less than or equal to the second threshold), the process may end, which is equivalent to the computing device not performing any processing. Among them, both the first threshold and the second threshold may be configured in the computing device. The first threshold is less than the second threshold.
[0139] In an embodiment of the present application, if the value of the first usage parameter is less than the first threshold, it means that the VM has less computing power requirements for M physical cores. In this case, the target vCPU can be increased to run on a physical core with less computing power.
[0140] For example, the target vCPU previously ran on the first physical core, and the computing device can run the target vCPU on the second physical core, and the second physical core and the first physical core both belong to M physical cores. In this case, the computing power of the second physical core is less than that of the first physical core. For example, the target vCPU is vCPU1, and vCPU1 runs on physical core 1. The computing device can adjust vCPU1 to run on physical core 3, and the computing power of physical core 3 is less than that of physical core 1. Among them, vCPU1 is, for example, Figure 3 The vCPU1 involved, physical core 1 is for example Figure 3 The physical core 1 and the physical core 3 involved are, for example, Figure 3 The physical cores involved are 3.
[0141] If the value of the first usage parameter is greater than or equal to the first threshold value and less than or equal to the second threshold value, it means that the VM's computing power requirements for the M physical cores are moderate, so it can be terminated, which is equivalent to the computing device not performing any processing. In other words, the target vCPU can continue to run on the first physical core.
[0142] If the value of the first usage parameter is greater than the second threshold, it means that the VM has a high demand for the computing power of M physical cores. Therefore, the computing device can adjust the target vCPU to run on a physical core with greater computing power, so that the physical core with greater computing power provides more computing power for the target vCPU. For example, if the target vCPU is vCPU1 and vCPU1 runs on physical core 1, the computing device can adjust vCPU1 to run on physical core 2, and the computing power of physical core 2 is greater than that of physical core 1. Figure 3 The vCPU1 involved, physical core 1 is for example Figure 3 The physical core 1 and the physical core 2 involved are, for example, Figure 3 The physical cores involved are 2.
[0143] For example, the target vCPU previously runs on the first physical core, and the computing device may run the target vCPU on the second physical core, and the second physical core and the first physical core both belong to the M physical cores. In this case, the computing power of the second physical core is greater than the computing power of the first physical core.
[0144] Optionally, before executing S702 or S704, the computing device may determine the target vCPU using any one of the above-mentioned methods 1 or 2.
[0145] For example, before executing S702, the computing device may determine the target vCPU using the first sub-method of determining the target vCPU under method 2. In this way, since the value of the first performance parameter of the target vCPU is small, the target vCPU is adjusted to run on a physical core with a smaller computing power, which can ensure that the target vCPU can run smoothly on the physical core with a smaller computing power to the greatest extent.
[0146] Alternatively, before executing S704, the computing device may determine the target vCPU using the second sub-method of determining the target vCPU under method 2. In this way, since the value of the first performance parameter of the target vCPU is relatively large, the target vCPU is adjusted to run on a physical core with greater computing power, which can ensure that the target vCPU can run smoothly on the physical core with greater computing power to the greatest extent, and can also improve the utilization rate of the physical core with greater computing power.
[0147] Optionally, the execution order of S701 and S703 may be arbitrary, for example, S701 may be executed first, and then S703; or, S701 and S703 may be executed simultaneously; or, S703 may be executed first, and then S701.
[0148] In the above implementation, the computing device determines that the VM has a small demand for the computing power of the physical core, and can adjust the target vCPU in the VM to run on a physical core with a smaller computing power, so that the physical core with a larger computing power can provide resources for the VM with a greater demand, which is conducive to improving the resource utilization of the computing device. The computing device determines that the VM has a large demand for the resources of the physical core, and can adjust the target vCPU in the VM to run on a physical core with a larger computing power, ensuring that the VM can run smoothly, which is conducive to improving the reliability of the VM operation.
[0149] In a possible implementation, after the computing device determines to adjust the physical core for running the target vCPU, it may send a first notification message to the VM. The first notification message is used to indicate the adjusted physical core for running the target vCPU.
[0150] In order to ensure that the second physical core with smaller computing power can support the operation of the target vCPU, in a possible implementation, the computing device may also determine that the value of the first performance parameter of the target vCPU is less than the sixth threshold value during the execution of S502 or S702, so as to ensure that the second physical core can support the operation of the target vCPU.
[0151] Please refer to Figure 8 , is a schematic diagram of a method for adjusting a target vCPU to run on a second physical core with smaller computing power provided in an embodiment of the present application. Or, Figure 8 It can be understood as a schematic diagram of an implementation method of S502 or S702.
[0152] S801. The computing device determines whether the value of the first performance parameter of the target vCPU is less than a sixth threshold.
[0153] If the value of the first performance parameter of the target vCPU is less than the sixth threshold, S802 is executed, that is, the target vCPU running on the first physical core is adjusted to run on the second physical core with smaller computing power. If the value of the first performance parameter of the target vCPU is not less than the sixth threshold (i.e., greater than or equal to the sixth threshold), the process can be terminated, which is equivalent to the computing device not performing any processing. In other words, the target vCPU can continue to run on the first physical core.
[0154] In this embodiment, the value of the first performance parameter of the target vCPU is greater than or equal to the sixth threshold, indicating that the second physical core may not be able to support the operation of the target vCPU. Therefore, the target vCPU running on the first physical core will not be adjusted to run on the second physical core with smaller computing power, thereby ensuring that the target vCPU can operate normally.
[0155] The sixth threshold is determined according to the third performance parameter of the vCPU (such as referred to as the reference vCPU) running on the second physical core. In order to simplify the description, the third performance parameter of the vCPU (such as referred to as the reference vCPU) running on the second physical core is referred to as the third performance parameter of the reference vCPU below.
[0156] The first performance parameter of the target virtual processor represents an indicator of the target vCPU calling hardware resources in the first time period. The third performance parameter represents the calling parameter of the hardware resources when the vCPU runs on the second physical core in the fifth time period. The meaning of the hardware resources can be referred to in the previous text. Optionally, the duration of the fifth time period can be equal to the duration of the first time period. In addition, the end time of the fifth time period can be equal to the end time of the first time period, or the end time of the fifth time period is before the start time of the first time period.
[0157] In a possible implementation, the third performance parameter or the sixth threshold of the reference vCPU may be preconfigured in the computing device, for example, manually configured in the computing device by a user.
[0158] Exemplarily, the computing device may collect the third performance parameters of the multiple vCPUs in the fifth time period, and may obtain multiple third performance parameters. The multiple vCPUs are all running on the second physical core. The computing device may use the third performance parameter with the largest value among the multiple third performance parameters as the third performance parameter of the reference vCPU.
[0159] Optionally, the sixth threshold is the product of the third performance parameter of the reference vCPU and a preset weight. The preset weight may be, for example, 0.8 or 0.9.
[0160] In order to ensure that the VM can still run smoothly when the target vCPU is adjusted to run on the second physical core with smaller computing power, in a possible implementation, the computing device may also determine whether the value of the first performance parameter of the VM is less than a sixth threshold before adjusting the target vCPU to run on the second physical core with smaller computing power. The sixth threshold is determined based on the third performance parameter of the VM that meets the first condition. The first condition includes that the operating condition of the VM is the same as the operating condition of the VM after the target vCPU is adjusted to run on the second physical core with smaller computing power.
[0161] If the value of the first performance parameter of the VM is less than the sixth threshold, the target vCPU running on the first physical core may be adjusted to run on the second physical core with less computing power. If the value of the first performance parameter of the target vCPU is not less than the sixth threshold (i.e., greater than or equal to the sixth threshold), the computing device does not process. In other words, the target vCPU may continue to run on the first physical core.
[0162] The first performance parameter of the VM may be, for example, the sum of the first performance parameters of the N vCPUs. For example, the calculation formula of the first performance parameter of the VM may refer to the following formula (5).
[0163]
[0164] Among them, E base represents the first performance parameter of the VM, Indicates the first performance parameter of the m-th vCPU among N vCPUs.
[0165] In this case, the third performance parameter represents the calling parameter of the hardware resource by the VM that meets the first condition in the fifth time period. The content of the fifth time period can be referred to above.
[0166] Exemplarily, the computing device may collect the third performance parameter of the VM that meets the first condition in the fifth time period, and may obtain multiple third performance parameters. The computing device may use the third performance parameter with the largest value among the multiple third performance parameters as the third performance parameter of the VM.
[0167] Optionally, the third performance parameter or the sixth threshold of the VM that meets the first condition may be preconfigured in the computing device, for example, manually configured in the computing device by a user.
[0168] For example, the sixth threshold may be the product of the third performance parameter of the VM that meets the first condition and a preset weight. The preset weight may be, for example, 0.8 or 0.9.
[0169] In a possible implementation, after the computing device executes S502 or S702, the computing device may record the second performance parameter of the target vCPU in the second time period, and determine whether to call back (or switch back) the target vCPU running on the second physical core to run on the first physical core according to the absolute value of the difference between the second performance parameter of the target vCPU and the first performance parameter. Fig. 9 The flowchart of the callback target vCPU running on the physical core is introduced as shown.
[0170] S901. The computing device determines a second performance parameter of a target vCPU within a second time period.
[0171] The start time of the second time period is a time after the computing device adjusts the target vCPU running on the first physical core to run on the second physical core with smaller computing power. For example, the start time of the second time period may be the time when the first physical core starts to run on the second physical core. Accordingly, the start time of the second time period may be equal to the end time of the first time period, or the start time of the second time period may be after the end time of the first time period. The duration of the second time period and the first time period may be the same.
[0172] The manner in which the computing device determines the second performance parameter of the target vCPU in the second time period may refer to the content of the computing device determining the first performance parameter of the target vCPU in the first time period as described above.
[0173] S902: The computing device determines whether the absolute value of the difference between the second usage parameter and the first usage parameter of the target vCPU is greater than a fourth threshold. The fourth threshold may be preconfigured in the computing device.
[0174] If the absolute value of the difference between the second usage parameter and the first usage parameter of the target vCPU is greater than the fourth threshold, the computing device may execute S903, i.e., adjust the target vCPU running on the second physical core to run on the first physical core. If the absolute value of the difference between the second usage parameter and the first usage parameter is not greater than the fourth threshold (i.e., less than or equal to the fourth threshold), it may end, i.e., the computing device does not perform any processing. That is, in this case, the target vCPU continues to run on the second physical core.
[0175] In this embodiment, the absolute value of the difference between the second usage parameter and the first usage parameter of the target vCPU is greater than the fourth threshold, indicating that the adjustment of the physical core on which the target vCPU runs may have a significant impact on the performance parameters of the target vCPU, and therefore the physical core on which the target vCPU runs may be considered to be called back. If the absolute value of the difference between the second usage parameter and the first usage parameter is less than or equal to the fourth threshold, indicating that the adjustment of the physical core on which the target vCPU runs may have a small impact on the performance parameters of the target vCPU, and therefore the computing device may not need to process.
[0176] In another possible implementation, after the computing device executes S502 or S702, the computing device may record the second performance parameter of the VM in the second time period, and determine whether to call back (or switch back) the target vCPU running on the second physical core to run on the first physical core according to the absolute value of the difference between the second performance parameter of the VM and the first performance parameter. Fig.10 The flowchart of the callback target vCPU running on the physical core is introduced as shown.
[0177] S1001. A computing device determines a second performance parameter of a VM in a second time period.
[0178] The meaning of the second time period can be found in the previous text.
[0179] Exemplarily, the computing device may take the sum of the second performance parameters of each vCPU in the N vCPUs included in the VM as the second performance parameter of the VM. A formula for determining the second performance parameter of the VM may refer to the following formula (6).
[0180]
[0181] in, Indicates a second performance parameter of the mth vCPU among the N vCPUs in the second time period.
[0182] S1002: The computing device determines whether the absolute value of the difference between the second usage parameter and the first usage parameter of the VM is greater than a seventh threshold.
[0183] If the absolute value of the difference between the second usage parameter of the VM and the first usage parameter is greater than the seventh threshold value T ac, the computing device may execute S1003, i.e., adjust the target vCPU running on the second physical core to run on the first physical core. If the absolute value of the difference between the second usage parameter and the first usage parameter is less than or equal to the seventh threshold, the process may be terminated, i.e., the computing device does not perform any processing. In other words, in this case, the target vCPU continues to run on the second physical core. The seventh threshold may be the same as or different from the fourth threshold in the foregoing text, and the seventh threshold may also be preconfigured in the computing device.
[0184] In the embodiment of the present application, if the absolute value of the difference between the second usage parameter and the first usage parameter of the VM is greater than the seventh threshold, it means that after adjusting the physical core on which the target vCPU runs, the performance parameters of the VM may be greatly affected, so the computing device may adjust the target vCPU running on the second physical core to run on the first physical core. If the absolute value of the difference between the second usage parameter and the first usage parameter is less than or equal to the seventh threshold, it means that after adjusting the physical core on which the target vCPU runs, the impact on the performance parameters of the VM is small, so the computing device does not need to process.
[0185] Optionally, the computing device may use the sum of the first performance parameters of each vCPU in the N vCPUs as the first performance parameter of the VM. The method for determining the first performance parameter of each vCPU may refer to the content of determining the first performance parameter of the target vCPU in the previous text. The calculation formula for determining the first performance parameter of the VM by the computing device may refer to the following formula (5) in the previous text.
[0186] After the computing device executes S502 or S702, the computing device may determine the number of times the physical core on which the target vCPU runs is adjusted within the third time period. The computing device adjusting the physical core on which the target vCPU runs once may be regarded as a scheduling event occurring. Accordingly, the number of times the physical core on which the target vCPU runs is adjusted within the third time period may also be referred to as the number of times the scheduling event occurs.
[0187] If the computing device determines that the number of times is greater than the fifth threshold, it means that the computing device adjusts the physical core running the target vCPU at a high frequency, and it can be considered that there is jitter, which may be due to the unreasonable values of the first threshold and the second threshold. Therefore, in a possible implementation, the computing device may also adjust the first threshold and / or the second threshold. The fifth threshold may be preconfigured in the computing device.
[0188] Exemplarily, if the number of times is greater than the fifth threshold, the computing device may adjust the first threshold, for example, the computing device may reduce the first fixed value based on the first threshold, so that the difference between the second threshold and the adjusted first threshold is greater than the difference between the second threshold and the first threshold before adjustment. The first fixed value may be preconfigured in the computing device.
[0189] Alternatively, the computing device may adjust the second threshold, for example, the computing device may add the second fixed value based on the second threshold, so that the difference between the second threshold and the adjusted first threshold is greater than the difference between the second threshold and the first threshold before adjustment. The second fixed value may be the same as the first fixed value, and the second fixed value may be preconfigured in the computing device.
[0190] Alternatively, the computing device may adjust the first threshold and the second threshold, for example, the computing device may reduce the third fixed value based on the first threshold, and increase the fourth fixed value based on the second threshold, so that the difference between the adjusted second threshold and the adjusted first threshold is greater than the difference between the second threshold before adjustment and the first threshold before adjustment. The third fixed value and the fourth fixed value may both be the same as the first fixed value, and the third fixed value or the fourth fixed value may be preconfigured in the computing device.
[0191] In an embodiment of the present application, the physical cores of some or all vCPUs running in the VM can be adjusted according to the usage of the physical core by the VM, so that the vCPU can run on a more suitable physical core, making the distribution of the vCPU more reasonable, which is also conducive to improving the rationality of resource allocation of the computing device. In addition, the first usage parameter can be determined according to the underlying parameters of the computing device running from the computing device, so the first usage parameter does not need to be obtained from the application running in the VM, so it will not infringe the privacy of the user using the application, making the applicability of this implementation method better. In addition, after adjusting the physical core running the vCPU, the performance parameters of the vCPU can also be monitored, and according to the changes in the performance parameters of the vCPU, the physical core running the vCPU can be selectively called back, so as to ensure the smooth operation of the vCPU. In addition, the adjustment of the physical core running the vCPU is imperceptible to the user who uses the application deployed in the VM, so it will not affect the user's experience of using the application.
[0192] In the embodiment of the present application, adjusting the physical core of the target vCPU is used as an example for introduction. In fact, the computing device can also adjust the physical cores of other vCPUs. For example, the computing device can simultaneously adjust the physical cores of the target vCPU and other target vCPUs. The other vCPUs belong to the vCPUs other than the target vCPU in the N vCPUs. The method of adjusting the physical core of other vCPUs can refer to the method of adjusting the physical core of the target vCPU discussed above (such as the method of adjusting the physical core of the target vCPU discussed above). Figure 5 ) are not listed here.
[0193] The previous article introduces the method of scheduling physical cores by executing a computing device as an example. In fact, the method can also be executed by a device for scheduling physical cores. The content of the method executed by the device for scheduling physical cores can refer to the process of the computing device executing the method for scheduling physical cores in the previous article, which will not be repeated here.
[0194] The present application embodiment provides a device for scheduling physical cores. Fig.11 , is a schematic diagram of a physical core scheduling device provided in an embodiment of the present application. The physical core scheduling device 1100 can be used to implement the functions of any of the computing devices described above, and accordingly, can also execute the steps performed by the computing devices described above.
[0195] like Fig.11 As shown, the device 1100 for scheduling physical cores includes a collection module 1101 and a scheduling module 1102. Optionally, the device 1100 for scheduling physical cores also includes a performance determination module 1103 and an anti-shake module 1104.
[0196] Among them, the acquisition module 1101, the scheduling module 1102, the performance judgment module 1103 and the anti-shake module 1104 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the scheduling module 1102 is introduced below by taking the scheduling module 1102 as an example. Similarly, the implementation of the acquisition module 1101, the performance judgment module 1103 and the anti-shake module 1104 can refer to the implementation of the entire scheduling module 1102.
[0197] As an example of a software functional unit, the scheduling module 1102 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the scheduling module 1102 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0198] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0199] As an example of a hardware functional unit, the scheduling module 1102 may include at least one computing device, such as a server, etc. Alternatively, the scheduling module 1102 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0200] The multiple computing devices included in the scheduling module 1102 can be distributed in the same region or in different regions. The multiple computing devices included in the scheduling module 1102 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the scheduling module 1102 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0201] Exemplarily, the acquisition module 1101 may be used to execute step S501, and the scheduling module 1102 may be used to execute step S502. For example, the scheduling module 1102 may be used to execute steps S701 to S704.
[0202] Optionally, the performance judgment module 1103 is used to execute the step of S801, and the scheduling module 1102 can also be used to execute the step of S802. Optionally, the performance judgment module 1103 is used to execute the steps of S901-S902. The scheduling module 1102 can also be used to execute the step of S903. Optionally, the performance judgment module 1103 is used to execute the steps of S1001-S1002, and the scheduling module 1102 can also be used to execute the step of S1003. The specific contents of each step involved can be referred to the previous text and will not be repeated here.
[0203] Optionally, the anti-shake module 1104 may be used to adjust the first threshold and / or the second threshold. The contents of the first threshold and the second threshold, and the manner of adjusting the first threshold and / or the second threshold may all be referred to above.
[0204] The present application embodiment provides a device for scheduling physical cores. Fig.12 , is a schematic diagram of a computing device 1200 provided in an embodiment of the present application. Fig.12 As shown, the computing device 1200 includes a processor 1201 and a memory 1202. Optionally, the computing device 1200 also includes a communication interface 1203. The processor 1201 may include multiple physical cores with different computing power, such as the first physical core and the second physical core mentioned above.
[0205] The processor 1201, the memory 1202 and the communication interface 1203 can communicate with each other via the bus 1204. The computing device 1200 can be a server or a terminal device. It should be understood that the embodiment of the present application does not limit the number of processors and memories in the computing device 1200.
[0206] The bus 1204 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 The bus 1204 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 1204 may include a path for transmitting information between various components of the computing device 1200 (for example, the processor 1201, the memory 1202, and the communication interface 1203).
[0207] The processor 1201 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0208] The memory 1202 may include a volatile memory, such as a random access memory (RAM). The memory 1202 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0209] The memory 1202 stores executable program codes, and the processor 1201 executes the executable program codes to respectively implement the aforementioned Fig.11 The functions of the acquisition module 1101, the scheduling module 1102, the performance judgment module 1103 and the anti-shake module 1104 in the above-mentioned method for scheduling physical cores are implemented. That is, the memory 1202 stores instructions for executing any method for scheduling physical cores. The functions of the acquisition module 1101, the scheduling module 1102, the performance judgment module 1103 and the anti-shake module 1104 can be referred to in the above-mentioned method. Fig.11 The content of the discussion.
[0210] Alternatively, the memory 1202 stores executable codes, and the processor 1201 executes the executable codes to respectively implement the functions of the aforementioned computing devices, thereby implementing any of the aforementioned methods for scheduling physical cores. That is, the memory 1202 stores instructions for executing any of the aforementioned methods for scheduling physical cores.
[0211] The communication interface 1203 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1200 and other devices or a communication network.
[0212] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. Each computing device in the at least one computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop, a laptop, or a smart phone.
[0213] Please refer to Fig.13 , is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. Fig.13 As shown, the computing device cluster includes at least one computing device 1300. Each computing device 1300 in the computing device cluster may include a processor 1301 and a memory 1302. Optionally, each computing device 1300 in the computing device cluster also includes a communication interface 1303. The processor 1301, the memory 1302, and the communication interface 1303 may be connected via a bus. The implementation of the processor 1301 may refer to the above Fig.12 The implementation of the processor 1201 and the implementation of the memory 1302 can refer to the above Fig.12 The implementation of the memory 1202 and the implementation of the communication interface 1303 can refer to the above Fig.12 The implementation method of the communication interface 1303 in.
[0214] In a possible implementation, the memory 1302 in each computing device 1300 in the computing device cluster may store the same instructions for executing any of the methods for scheduling physical cores described above. For example, each computing device 1300 in some or all of the computing devices 1300 in the computing device cluster may include multiple physical cores with different computing power, such as a first physical core and a second physical core, and each computing device 1300 may deploy a VM, and each computing device 1300 may adjust the physical core on which the target vCPU included in the VM runs. The method for adjusting the physical core on which the target vCPU runs may refer to the content of the above text.
[0215] In another possible implementation, the memory 1302 of at least one computing device 1300 in the computing device cluster may also respectively store partial instructions for executing any of the methods for scheduling physical cores described above. In other words, a combination of at least one computing device 1300 may jointly execute instructions for executing any of the methods for scheduling physical cores described above. For example, each of the computing devices 1300 in some or all of the computing devices 1300 in the computing device cluster may include multiple physical cores with different computing power, such as a first physical core and a second physical core, and each of the computing devices 1300 may deploy a VM, and some or all of the computing devices 1300 in the computing device cluster may jointly adjust the physical cores on which the target vCPUs included in the VMs of each computing device 1300 run. The manner of adjusting the physical cores on which the target vCPUs run may refer to the contents of the previous text.
[0216] Optionally, the memory 1302 in different computing devices 1300 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the apparatus 1100 for scheduling physical cores. That is, the instructions stored in the memory 1302 in different computing devices 1300 may implement the functions of one or more modules among the acquisition module 1101, the scheduling module 1102, the performance judgment module 1103 and the anti-shake module 1104. The functions of the acquisition module 1101, the scheduling module 1102, the performance judgment module 1103 and the anti-shake module 1104 may refer to the above description. Fig.11 The content of the discussion.
[0217] In some possible implementations, at least one computing device 1300 in the computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. Specifically, the network is connected via a communication interface 1303 in each computing device 1300. In this type of possible implementation, at least one computing device 1300 in the computing device cluster may jointly execute the method for executing any of the above-mentioned scheduling physical cores.
[0218] The embodiment of the present application provides a chip system, which includes: a processor and an interface. The processor is used to call and run instructions from the interface, and when the processor executes the instructions, the method for scheduling physical cores described in any of the above items is implemented.
[0219] The embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program or instruction, and when it is executed, it implements any of the above-mentioned methods for scheduling physical cores. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state hard disk), etc.
[0220] The embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, implements any of the above methods for scheduling physical cores. The computer program product may be a software or program product including instructions that can be executed on a computing device or stored in any available medium.
[0221] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a base station or a terminal. Of course, the processor and the storage medium can also be present in a base station or a terminal as discrete components.
[0222] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc; it may also be a semiconductor medium, for example, a solid-state hard disk. The computer-readable storage medium may be a volatile or nonvolatile storage medium, or may include both volatile and nonvolatile types of storage media.
[0223] In the various embodiments of the present application, unless otherwise specified or provided in a logical conflict, the terms and / or descriptions between the different embodiments are consistent and may be referenced to each other, and the technical features in the different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0224] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
Claims
1. A method for scheduling physical cores, characterized in that: include: Determine usage parameters of N virtual processors included in the virtual machine, the usage parameters are used to indicate usage information of the N virtual processors on resources of M physical cores of the computing device, the N virtual processors run on some or all of the M physical cores, one of the virtual processors runs on one of the M physical cores, N is a positive integer, and M is an integer greater than 1; If the value of the usage parameter is less than a first threshold value, and the computing power of the first physical core is greater than the computing power of the second physical core, the target virtual processor running on the first physical core is adjusted to run on the second physical core, wherein the target virtual processor meets the following conditions: the sequence number of the first performance parameter of the target virtual processor is less than or equal to P, and / or the value of the first performance parameter of the target virtual processor is less than a third threshold value; If the value of the usage parameter is greater than a second threshold value, and the computing power of the first physical core is less than the computing power of the second physical core, the target virtual processor running on the first physical core is adjusted to run on the second physical core, wherein the target virtual processor meets the following conditions: the sequence number of the first performance parameter of the target virtual processor is greater than K, and / or the value of the first performance parameter of the target virtual processor is greater than a third threshold value; Among them, the first threshold is less than the second threshold, the second physical core is a physical core of the M physical cores except the first physical core, the target virtual processor belongs to the N virtual processors, the first performance parameter of the target virtual processor is a scheduling parameter of the target virtual processor for hardware resources in a first time period, the hardware resources are hardware resources provided by the computing device, the serial number is obtained by sorting the first performance parameters of the N virtual processors in ascending order of their values, and P and K are both positive integers less than or equal to N.
2. The method according to claim 1, characterized in that The method further comprises: Determine a second performance parameter of the target virtual processor, the second performance parameter of the target virtual processor represents a scheduling parameter of the target virtual processor for hardware resources in a second time period, the hardware resources are hardware resources provided by the computing device, and the start time of the second time period is after the target virtual processor running on the first physical core is adjusted to run on the second physical core; If the absolute value of the difference between the second performance parameter of the target virtual processor and the first performance parameter of the target virtual processor is greater than a fourth threshold, the target virtual processor running on the second physical core is adjusted to run on the first physical core, wherein the first performance parameter of the target virtual processor represents a scheduling parameter of the target virtual processor for the hardware resources within a first time period.
3. The method according to claim 1, characterized in that The method further comprises: Determine a second performance parameter of the virtual machine, the second performance parameter of the virtual machine represents a scheduling parameter of the virtual machine for hardware resources in a second time period, the hardware resources are hardware resources provided by the computing device, and the start time of the second time period is after the target virtual processor running on the first physical core is adjusted to run on the second physical core; If the absolute value of the difference between the second performance parameter of the virtual machine and the first performance parameter of the virtual machine is greater than a fourth threshold, the target virtual processor running on the second physical core is adjusted to run on the first physical core, wherein the first performance parameter of the virtual machine represents the scheduling parameter of the virtual machine for the hardware resources within the first time period.
4. The method according to any one of claims 1 to 3, characterized in that: Before adjusting the target virtual processor running on the first physical core to run on the second physical core, the method further includes: Determine that a value of a first performance parameter of the target virtual processor is less than a sixth threshold, the sixth threshold being determined based on a third performance parameter of the virtual processor running on the second physical core, the first performance parameter of the target virtual processor representing an indicator of a hardware resource called by the target virtual processor within a first time period, the third performance parameter representing a calling parameter of a hardware resource when the virtual processor runs on the second physical core, the hardware resource being a hardware resource provided by the computing device; or, Determine that the value of the first performance parameter of the virtual machine is less than a sixth threshold, the sixth threshold is determined based on the third performance parameter of the virtual machine that satisfies the first condition, the first performance parameter of the virtual machine represents an indicator of the virtual machine calling hardware resources within a first time period, the third performance parameter represents a calling parameter of the virtual machine for the hardware resources when the first condition is met, the hardware resources are hardware resources provided by the computing device, and the first condition includes that the operating condition of the virtual machine is the same as the operating condition of the virtual machine after adjusting the target virtual processor running on the first physical core to run on the second physical core.
5. The method according to any one of claims 1 to 3, characterized in that: After adjusting the target virtual processor running on the first physical core to run on the second physical core, the method further includes: Determining the number of times the physical core on which the target virtual processor runs is adjusted within a third time period; If the number of times is greater than or equal to the fifth threshold, any one of the following actions is performed: adjusting the first threshold, wherein a difference between the second threshold and the first threshold after adjustment is greater than a difference between the second threshold and the first threshold before adjustment; adjusting the second threshold, wherein the difference between the adjusted second threshold and the first threshold is greater than the difference between the second threshold and the first threshold before the adjustment; or, The second threshold and the first threshold are adjusted, wherein a difference between the adjusted second threshold and the adjusted first threshold is greater than a difference between the adjusted second threshold and the adjusted first threshold.
6. A device for scheduling physical cores, characterized in that: include: a collection module, used to determine usage parameters of N virtual processors included in the virtual machine, wherein the usage parameters are used to indicate usage information of the N virtual processors on resources of M physical cores of the computing device, wherein the N virtual processors run on some or all of the M physical cores, wherein one of the virtual processors runs on one of the M physical cores, wherein N is a positive integer, and M is an integer greater than 1; a scheduling module, configured to adjust a target virtual processor running on the first physical core to run on the second physical core if the value of the usage parameter is less than a first threshold value and the computing power of the first physical core is greater than the computing power of the second physical core, wherein the target virtual processor satisfies the following conditions: a sequence number of a first performance parameter of the target virtual processor is less than or equal to P, and / or a value of the first performance parameter of the target virtual processor is less than a third threshold value; The scheduling module is configured to adjust the target virtual processor running on the first physical core to run on the second physical core if the value of the usage parameter is greater than a second threshold and the computing power of the first physical core is less than the computing power of the second physical core, wherein the target virtual processor satisfies the following conditions: the sequence number of the first performance parameter of the target virtual processor is greater than K, and / or the value of the first performance parameter of the target virtual processor is greater than a third threshold; Among them, the second physical core is a physical core of the M physical cores other than the first physical core, the target virtual processor belongs to the N virtual processors, the first performance parameter of the target virtual processor is a scheduling parameter of the target virtual processor for hardware resources in a first time period, the hardware resources are hardware resources provided by the computing device, the serial number is obtained by sorting the first performance parameters of the N virtual processors in ascending order of their values, and P and K are both positive integers less than or equal to N.
7. The device according to claim 6, characterized in that The device also includes a performance determination module; The performance judgment module is used to determine a second performance parameter of the target virtual processor, where the second performance parameter of the target virtual processor represents a scheduling parameter of the target virtual processor for hardware resources in a second time period, where the hardware resources are hardware resources provided by the computing device, and the start time of the second time period is after the target virtual processor running on the first physical core is adjusted to run on the second physical core; If the absolute value of the difference between the second performance parameter of the target virtual processor and the first performance parameter of the target virtual processor is greater than a fourth threshold, the scheduling module is further used to adjust the target virtual processor running on the second physical core to run on the first physical core, wherein the first performance parameter of the target virtual processor represents the scheduling parameter of the target virtual processor for the hardware resources within a first time period.
8. The device according to claim 6, characterized in that The device also includes a performance determination module; The performance judgment module is used to determine a second performance parameter of the virtual machine, where the second performance parameter of the virtual machine represents a scheduling parameter of the virtual machine for hardware resources in a second time period, where the hardware resources are hardware resources provided by the computing device, and where the start time of the second time period is after the target virtual processor running on the first physical core is adjusted to run on the second physical core; If the absolute value of the difference between the second performance parameter of the virtual machine and the first performance parameter of the virtual machine is greater than a fourth threshold, the scheduling module is also used to adjust the target virtual processor running on the second physical core to run on the first physical core, wherein the first performance parameter of the virtual machine represents the scheduling parameter of the virtual machine for the hardware resources within the first time period.
9. The device according to any one of claims 6 to 8, characterized in that: The scheduling module is also used for: Before adjusting the target virtual processor running on the first physical core to run on the second physical core, determine that the value of the first performance parameter of the target virtual processor is less than a sixth threshold, the sixth threshold is determined according to the third performance parameter of the virtual processor running on the second physical core, the first performance parameter of the target virtual processor represents an indicator of the target virtual processor calling hardware resources within a first time period, the third performance parameter represents a calling parameter of the virtual processor to the hardware resource when the virtual processor runs on the second physical core, and the hardware resource is a hardware resource provided by the computing device; or, determine that the value of the first performance parameter of the virtual machine is less than a sixth threshold, the sixth threshold is determined according to the third performance parameter of the virtual machine that meets the first condition, the first performance parameter of the virtual machine represents an indicator of the virtual machine calling hardware resources within the first time period, the third performance parameter represents a calling parameter of the virtual machine to the hardware resource when the first condition is met, and the hardware resource is a hardware resource provided by the computing device, and the first condition includes that the operating condition of the virtual machine is the same as the operating condition of the virtual machine after adjusting the target virtual processor running on the first physical core to run on the second physical core.
10. The device according to any one of claims 6 to 8, characterized in that: The device further comprises an anti-shake module, and the anti-shake module is further used for: Determining the number of times the physical core on which the target virtual processor runs is adjusted within a third time period; If the number of times is greater than or equal to the fifth threshold, perform any of the following: adjusting the first threshold, wherein a difference between the second threshold and the first threshold after adjustment is greater than a difference between the second threshold and the first threshold before adjustment; adjusting the second threshold, wherein the difference between the adjusted second threshold and the first threshold is greater than the difference between the second threshold and the first threshold before the adjustment; or, The second threshold and the first threshold are adjusted, wherein a difference between the adjusted second threshold and the adjusted first threshold is greater than a difference between the adjusted second threshold and the adjusted first threshold.
11. A computing device, characterized in that: include: Processor and memory; The memory is used to store one or more computer programs, and the one or more computer programs include computer execution instructions. When the computing device is running, the processor executes the one or more computer programs stored in the memory, so that the computing device performs the method according to any one of claims 1 to 5.
12. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 5.
13. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 5.
14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by a computing device, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device based on maximum load and used for load balancing scheduling
CN103106112A