Resource allocation method and device and computer storage medium

By analyzing the changes in the IPC and LLC capacity of the virtual machine and dynamically adjusting the LLC resources, the problem of difficult to measure the virtual machine's demand for LLC resources is solved, and efficient utilization of LLC resources and improvement of virtual machine performance is achieved.

CN119645613AActive Publication Date: 2025-03-18HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311211170.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-03-18
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

In the field of cloud computing, the relationship between the virtual machine's requirement for the number of computational cores and the demand for the lowest cache (LLC) resources cannot be measured by simple positive or negative correlation, making it difficult to further improve the efficiency of LLC resources by allocating LLC resources to the virtual machine to meet the actual needs.

Method used

By collecting the number of instructions per beat (IPC) and the changes in LLC capacity during the operation of the virtual machine, it is analyzed that when the LLC capacity of the virtual machine is significantly reduced and there is no significant change in the IPC, it is believed that the LLC capacity is too large, and some of the LLC capacity is divided and shared with other virtual machines for use, and the actual use of the LLC is combined with the virtual machine to perform secondary allocation.

Benefits of technology

By dynamically adjusting the LLC resources of the virtual machine, the efficiency of the use of LLC resources is improved, resource waste is avoided, and the efficiency of the utilization of LLC resources by the virtual machines in the target server group is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645613A_ABST
    Figure CN119645613A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource allocation method and device and a computer storage medium, which are used for improving the use efficiency of LLC (Logical Link Control) resources. The method comprises the steps that IPC changes of a target server group and LLC capacity changes of the VMs in the running process of the VMs are collected, the changes are analyzed, when the LLC capacity corresponding to the VMs is remarkably reduced, and the IPC of the first VM does not remarkably change, it is considered that the LLC capacity corresponding to the first VM is too large, part of the LLC capacity can be divided and shared to other VMs for use, and therefore the LLC capacity corresponding to the first VM can be shared to other VMs for use. In the operation process of the first VM, the actual use condition of the LLC is analyzed in combination with the first VM, and secondary allocation is performed on the LLC corresponding to the first VM in operation, so that the use efficiency of LLC resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of cloud computing, and in particular to a method, device and computer storage medium for resource allocation. Background Art

[0002] In the field of cloud computing, virtualization technology is usually used to provide hardware resources on the same set of servers to different users through different virtual machines. Users can adjust the use of computing resources and storage resources at any time according to their needs without having to purchase hardware equipment.

[0003] When virtualization technology allocates hardware resources, different computing cores and different memories are allocated to different virtual machines through the operating system. However, since the computing core and the last level cache (LLC) are different hardware areas, the LLC is not allocated when allocating computing cores and memory resources.

[0004] In order to realize the allocation of LLC resources, an LLC allocation optimization component is added to the operating system, and LLC resources are allocated to virtual machines using the basic specification information of virtual machines. For example, LLC resources are allocated to any online virtual machine according to the number of computing cores of the online virtual machine. The number of computing cores of the virtual machine is proportional to the LLC capacity of the virtual machine, and when the number of online virtual machines or the running stage changes, the LLC capacity is reallocated to the online virtual machine. Although the allocation of LLC resources is realized, the relationship between the demand of virtual machines for the number of computing cores and the demand for LLC resources cannot be measured by a simple positive or negative correlation. How to further improve the efficiency of LLC resource use by allocating LLC resources that meet actual needs to virtual machines has become a problem that needs to be solved now. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus and computer storage medium for resource allocation. By combining the running status of the virtual machine on the server group, the virtual machine is allocated appropriate LLC resources, thereby improving the utilization efficiency of LLC resources.

[0006] The first aspect of the present application provides a method for resource allocation, comprising:

[0007] Get the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC, and the second LLC. The first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, and the second LLC is the LLC of the first VM at the second moment. Before the first moment and the second moment, the first VM runs on the target server group.

[0008] If the difference between the capacity of the first LLC and the capacity of the second LLC is greater than the first threshold, and the difference between the first IPC and the second IPC is less than the second threshold, a correspondence between the third LLC and the first identifier is generated, and the first identifier indicates that the LLC can be used by the second VM, and the second VM is any VM running in the target server group except the first VM, and the first LLC is composed of the third LLC and the second LLC.

[0009] In an embodiment of the present application, the IPC changes of the first VM and the changes of the LLC capacity corresponding to the first VM during the operation of the VM are collected, and these changes are analyzed. When the LLC capacity corresponding to the first VM is significantly reduced and the IPC of the first VM has no significant change, it is considered that the LLC capacity corresponding to the first VM is too large, and part of the LLC capacity can be divided out to share with other virtual machines. During the operation of the VM, the actual use of the LLC is analyzed in combination with the first VM, and the LLC corresponding to the running first VM is redistributed, thereby improving the utilization efficiency of LLC resources.

[0010] In a possible implementation of the first aspect, the method further includes:

[0011] Obtain a third IPC, a fourth IPC, a fourth LLC, and a fifth LLC, where the third IPC is the IPC of the second VM at the third moment, the fourth IPC is the IPC of the second VM at the fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, a ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment;

[0012] If the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is greater than the third threshold, a correspondence between the second VM and the sixth LLC is generated, and the sixth LLC carries the first identifier.

[0013] In the embodiment of the present application, by obtaining the IPC of the second VM and the LLC of the second VM during the operation of the second VM, when the IPC of the second VM increases with the growth of the LLC of the second VM, it is determined that the performance of the second VM can be improved by increasing the LLC capacity. The allocatable LLC is allocated to the second VM for use, and the performance of the VM running on the target server group is improved by reasonably re-allocating LLC resources.

[0014] In a possible implementation of the first aspect, before obtaining the first instruction per beat IPC, the second IPC, the first bottom-level cache LLC, and the second LLC, the method further includes:

[0015] Obtain the number of first VMs running on the target server group and the first IDs of the VMs running on the target server group at a sixth moment;

[0016] Obtain the number of second VMs running on the target server group and the second ID of the VMs running on the target server group at the seventh moment, where the sixth moment and the seventh moment are before the first moment;

[0017] Get the first IPC, the second IPC, the first bottom cache LLC, and the second LLC, including:

[0018] If the number of the first VMs is the same as the number of the second VMs, and the first ID is the same as the second ID, the first IPC, the second IPC, the LLC, and the second LLC are obtained.

[0019] In the implementation of this application, by detecting the VMs running in the target server group, when the number of VMs running in the target server group and the IDs of the VMs running in the target server group remain unchanged, the demand analysis and reallocation of LLC resources of the VMs running in the target server group are triggered. During the process of the VMs running on the target server group, the LLC resources are dynamically adjusted to the LLC resources of the VMs running on the target server group, thereby improving the utilization efficiency of LLC resources by the VMs in the target server group.

[0020] In a possible implementation of the first aspect, the first VM runs on the target server group at the seventh moment;

[0021] The method also includes:

[0022] If the number of the first VMs is different from the number of the second VMs, and at least one of the first ID and the second ID is different is true, the correspondence between the first VM and the LLC corresponding to the first VM is deleted;

[0023] Obtain a first capacity, a memory capacity of a target server group, and a capacity of an LLC of the target server group, wherein the first capacity is a size of a memory of the first VM;

[0024] A correspondence relationship between the first VM and the first LLC is generated according to the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group.

[0025] In an embodiment of the present application, by detecting the VMs running in the target server group, when the VMs running in the target server group change, LLC resources are reallocated to the VMs in the target server group, thereby avoiding the situation where, after the LLC resources of the VMs are adjusted and the operation of the VMs with smaller LLC requirements on the target server group is terminated, there is no LLC resources to be allocated to the newly added VMs.

[0026] In a possible implementation of the first aspect, obtaining a first instruction per beat IPC, a second IPC, a first bottom-level cache LLC, and a second LLC includes:

[0027] Obtain a first IPC and a first LLC at a first moment;

[0028] The third LLC is removed from the first LLC to obtain a second LLC, wherein the ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value;

[0029] A second IPC is obtained at a second time.

[0030] In the embodiment of the present application, by adjusting the LLC capacity of the first VM and verifying whether there is redundancy in the LLC capacity of the first VM, the immediate reaction of the VM to the change in LLC capacity can be flexibly known, and the LLC capacity of the first VM can be adjusted according to the reaction, thereby improving the flexibility and initiative of the solution.

[0031] In a possible implementation of the first aspect, before obtaining the first instruction per beat IPC, the second IPC, the first bottom-level cache LLC, and the second LLC, the method further includes:

[0032] Obtaining a first VM creation request and a second VM creation request, the first VM creation request indicating that the memory size of the first VM is a first capacity, and the second VM creation request indicating that the memory size of the second VM is a second capacity;

[0033] Creating a correspondence between the first VM and the first LLC, where the ratio of the first capacity to the capacity of the target server group is equal to the ratio of the capacity of the first LLC to the capacity of the LLC of the target server group;

[0034] A correspondence relationship between the second VM and the second LLC is created, and the ratio of the second capacity to the capacity of the target server group is equal to the ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

[0035] In the embodiment of the present application, when the target server group is just started, when creating a VM, the ratio of the capacity of the LLC corresponding to the VM and the capacity of the LLC that the target server group can provide is determined based on the ratio of the memory capacity required to create the VM and the memory capacity that the target server group can provide, and then the capacity of the LLC corresponding to the VM is obtained, and the LLC is allocated to the VM. This avoids the situation where there is not enough data support to allocate LLC to the VM during the startup phase of the target server group, and improves the execution efficiency of the solution.

[0036] In a possible implementation of the first aspect, the method further includes:

[0037] The first IPC, the second IPC, the first LLC and the second LLC are deleted at the fifth moment, the fifth moment is after the second moment, and the duration from the second moment to the fifth moment is equal to the preset duration.

[0038] In the embodiment of the present application, in order to fully utilize the storage resources in the information cache module, a preset duration can be set as the usage period of the data in the information cache module. When the duration of data being written into the information cache module reaches the preset duration, the information cache module automatically clears this part of data. This improves the utilization efficiency of the storage resources in the information cache module.

[0039] In a possible implementation of the first aspect, the method further includes:

[0040] If the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is smaller than or equal to the third threshold, a correspondence between the second VM and the second identifier is generated, and the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

[0041] In an embodiment of the present application, when the IPC of the second VM does not increase significantly as the capacity of the LLC of the second VM increases, the second VM does not need to increase the corresponding LLC capacity, and a correspondence between the second VM and the second identifier is generated, wherein the second identifier indicates that the VM does not need to increase its corresponding LLC capacity, thereby avoiding repeated analysis of the second VM and improving work efficiency.

[0042] A second aspect of the present application provides a resource allocation device, including:

[0043] The state monitoring submodule is used to obtain the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC, and the second LLC. The first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, and the second LLC is the LLC of the first VM at the second moment. Before the first moment and the second moment, the first VM runs on the target server group;

[0044] The performance and demand analysis submodule is used to generate a correspondence between the third LLC and the first identifier if the difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold, and the difference between the first IPC and the second IPC is less than a second threshold. The first identifier indicates that the LLC can be used by the second VM, and the second VM is any VM running in the target server group except the first VM. The first LLC is composed of the third LLC and the second LLC.

[0045] In a possible implementation of the second aspect, the state monitoring submodule is further used to obtain a third IPC, a fourth IPC, a fourth LLC, and a fifth LLC, the third IPC is the IPC of the second VM at a third moment, the fourth IPC is the IPC of the second VM at a fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, the ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment;

[0046] The device also includes:

[0047] The LLC allocation decision submodule is used to generate a correspondence between the second VM and the sixth LLC if the capacity of the fourth LLC is less than the capacity of the fifth LLC and the difference between the fourth IPC and the third IPC is greater than a third threshold, and the sixth LLC carries the first identifier.

[0048] In a possible implementation of the second aspect, the state monitoring submodule is further used to obtain the number of first VMs running on the target server group and the first ID of the VM running on the target server group at a sixth moment;

[0049] The state monitoring submodule is further used to obtain the number of second VMs running on the target server group and the second ID of the VMs running on the target server group at the seventh moment, the sixth moment and the seventh moment being before the first moment;

[0050] The status monitoring submodule is specifically used to obtain the first IPC, the second IPC, the LLC, and the second LLC if the number of the first VMs is the same as the number of the second VMs, and the first ID is the same as the second ID.

[0051] In a possible implementation of the second aspect, the first VM runs on the target server group at the seventh moment;

[0052] The LLC allocation decision submodule is also used to:

[0053] If the number of the first VMs is different from the number of the second VMs, and at least one of the first ID and the second ID is different is true, the correspondence between the first VM and the LLC corresponding to the first VM is deleted;

[0054] Obtain a first capacity, a memory capacity of a target server group, and a capacity of an LLC of the target server group, wherein the first capacity is a size of a memory of the first VM;

[0055] A correspondence relationship between the first VM and the first LLC is generated according to the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group.

[0056] In a possible implementation of the second aspect, the status monitoring submodule is specifically configured to:

[0057] Obtain a first IPC and a first LLC at a first moment;

[0058] The third LLC is removed from the first LLC to obtain a second LLC, wherein the ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value;

[0059] A second IPC is obtained at a second time.

[0060] In a possible implementation manner of the second aspect, the device further includes:

[0061] A request acquisition submodule, used to acquire a first VM creation request and a second VM creation request, the first VM creation request indicating that the memory size of the first VM is a first capacity, and the second VM creation request indicating that the memory size of the second VM is a second capacity;

[0062] The LLC allocation decision submodule is specifically used to create a corresponding relationship between the first VM and the first LLC, and the ratio of the first capacity to the capacity of the target server group is equal to the ratio of the capacity of the first LLC to the capacity of the LLC of the target server group;

[0063] The LLC allocation decision submodule is specifically used to create a corresponding relationship between the second VM and the second LLC, and the ratio of the second capacity to the capacity of the target server group is equal to the ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

[0064] In a possible implementation of the second aspect, the device also includes an information cache module for deleting the first IPC, the second IPC, the first LLC and the second LLC at a fifth moment, the fifth moment being after the second moment, and the duration from the second moment to the fifth moment is equal to a preset duration.

[0065] In a possible implementation manner of the second aspect, the device further includes:

[0066] The LLC capacity analysis submodule is used to generate a correspondence between the second VM and the second identifier if the capacity of the fourth LLC is less than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is less than or equal to a third threshold, and the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

[0067] A third aspect of an embodiment of the present application provides a resource allocation device, including a processor and a memory, the memory being used to store instructions, and the processor being used to execute instructions. When the processor executes the instructions, it executes the method as described in the first aspect or any one of the implementations of the first aspect.

[0068] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, characterized in that it includes a program, which, when executed on a computer, enables the computer to execute a method as described in the first aspect or any one of the embodiments of the first aspect.

[0069] A fifth aspect of an embodiment of the present application provides a computing device cluster, characterized in that it includes at least one computing device, each computing device includes a processor and a memory;

[0070] The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method as described in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 A schematic diagram of a structure of a resource allocation device provided in an embodiment of the present application;

[0072] Figure 2 A schematic diagram of a resource allocation method provided in an embodiment of the present application;

[0073] Figure 3 Another schematic diagram of a resource allocation method provided in an embodiment of the present application;

[0074] Figure 4 Another schematic diagram of a resource allocation method provided in an embodiment of the present application;

[0075] Figure 5 Another structural schematic diagram of a resource allocation device provided in an embodiment of the present application;

[0076] Figure 6 Another structural schematic diagram of a resource allocation device provided in an embodiment of the present application;

[0077] Figure 7 A schematic diagram of a structure of a computing device cluster provided in an embodiment of the present application;

[0078] Figure 8 Another structural diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The embodiments of the present application provide a method, apparatus and computer storage medium for resource allocation. By combining the running status of the virtual machine on the server group, the virtual machine is allocated appropriate LLC resources, thereby improving the utilization efficiency of LLC resources.

[0080] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0081] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0082] In the field of cloud computing, virtualization technology is usually used to provide hardware resources on the same set of servers to different users through different virtual machines. Users can adjust the use of computing resources and storage resources at any time according to their needs without having to purchase hardware equipment.

[0083] When virtualization technology allocates hardware resources, different computing cores and different memories are allocated to different virtual machines through the operating system. However, since the computing core and the last level cache (LLC) are different hardware areas, the LLC is not allocated when allocating computing cores and memory resources.

[0084] In order to realize the allocation of LLC resources, an LLC allocation optimization component is added to the operating system, and LLC resources are allocated to virtual machines using the basic specification information of virtual machines. For example, LLC resources are allocated to any online virtual machine according to the number of computing cores of the online virtual machine. The number of computing cores of the virtual machine is proportional to the LLC capacity of the virtual machine, and when the number of online virtual machines or the running stage changes, the LLC capacity is reallocated to the online virtual machine. Although the allocation of LLC resources is realized, the relationship between the demand of virtual machines for the number of computing cores and the demand for LLC resources cannot be measured by a simple positive or negative correlation. How to further improve the efficiency of LLC resource use by allocating LLC resources that meet actual needs to virtual machines has become a problem that needs to be solved now.

[0085] Based on the above problems, the present application proposes that the changes in instruction per cycle (IPC) and LLC capacity during the operation of a virtual machine (VM) can be collected and analyzed. When the LLC capacity corresponding to the VM decreases significantly and there is no significant change in the IPC, it is considered that the LLC capacity corresponding to the VM is too large, and part of the LLC capacity can be allocated to share with other virtual machines. During the operation of the VM, the actual use of the LLC is analyzed in combination with the VM, and the LLC corresponding to the running VM is redistributed, thereby improving the utilization efficiency of LLC resources.

[0086] In order to facilitate understanding of the specific implementation process and data flow of the solution proposed in this application, firstly, the functional units involved in the solution provided in this application are introduced. Figure 1 , Figure 1 A schematic diagram of the structure of a resource allocation device provided in an embodiment of the present application.

[0087] The resource allocation device 10 includes an information acquisition module 101 , an analysis and decision module 102 , an adjustment and execution module 103 and an information cache module 104 .

[0088] The information acquisition module 101 specifically includes a specification information acquisition submodule 1011 , a status monitoring submodule 1012 and a performance data acquisition submodule 1013 .

[0089] The analysis and decision module 102 specifically includes a performance and demand analysis submodule 1021 , an LLC capacity analysis submodule 1022 , an LLC sharing analysis submodule 1023 and an LLC allocation decision submodule 1024 .

[0090] The regulation execution module 103 specifically includes an LLC regulation submodule 1031 .

[0091] Based on the aforementioned Figure 1 The structural diagram of the resource allocation device provided introduces the solution proposed in the present application. In view of the fact that the solution proposed in the present application is divided into different stages in its specific implementation, when introducing the solution proposed in the present application, the LLC resource release or sharing stage of the running virtual machine A, the stage in which the running virtual machine B occupies or shares the LLC resources of virtual machine A, and the target server group startup stage will be introduced in sequence, wherein both virtual machine A and virtual machine B are running on the target server group.

[0092] First, the specific operations performed during the LLC resource release or sharing phase of the running virtual machine A are introduced. Figure 2 , Figure 2 A schematic diagram of a resource allocation method provided in an embodiment of the present application.

[0093] 201. Obtain a first IPC, a second IPC, a first LLC, and a second LLC;

[0094] When multiple VMs are running on the target server group, some LLC resources are released from the multiple VMs for use by other VMs, or LLC resources allocated to the multiple VMs are shared among the VMs.

[0095] Specifically, any VM among multiple VMs can be randomly selected as the first VM, and the first IPC, the second IPC, the first LLC, and the second LLC can be obtained, wherein the first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, and the second LLC is the LLC of the first VM at the second moment. The first moment is before the second moment, and the first VM runs in the target server group.

[0096] In some possible situations, the collection of IPC and LLC of the first VM may be performed during the normal operation of the first VM, and may also be performed when verifying whether the current LLC capacity of the first VM is redundant, which is not limited here.

[0097] Exemplarily, here, the case of collecting the IPC of the first VM and the LLC of the first VM when verifying whether the current LLC capacity of the first VM is redundant is taken as an example:

[0098] In some scenarios where IPC cannot be collected directly during operation, the performance monitoring submodule is used to collect statistical information of the first VM at the first moment, for example, the number of executed instructions of the first VM in a preset time period before and after the first moment and the preset time period. Furthermore, the number of cache accesses, the number of cache hits, the memory bandwidth occupancy rate and the real-time IO bandwidth, etc. can also be collected, and there is no limitation here.

[0099] After collecting the statistical information of the first VM, the IPC of the first VM at the first moment is calculated using the number of executed instructions of the first VM group in a preset period before and after the first moment and the preset period to obtain the first IPC.

[0100] For example, the first IPC is calculated according to the following formula:

[0101] First

[0102] Wherein, A is the number of instructions executed by the first VM in a preset period before and after the first moment, and t is the preset period.

[0103] At the same time, the LLC resources most recently updated by the first VM are collected from the information cache module to obtain the first LLC.

[0104] Reduce the capacity of the LLC corresponding to the first VM, that is, remove the third LLC from the first LLC to obtain the second LLC, wherein the ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value, for example, the capacity of the third LLC is half of the capacity of the first LLC, that is, the first preset value is 50%.

[0105] Furthermore, at the second moment, the performance monitoring submodule is used to collect the statistical information of the first VM again to obtain the number of executed instructions and the preset time period of the first VM in the preset time period before and after the second moment. The method of calculating the second IPC is similar to the method of calculating the first IPC, and is not limited here.

[0106] The third LLC is removed from the first LLC to obtain a second LLC, wherein the ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value;

[0107] The second IPC and the second LLC are obtained at the second moment. The specific means are similar to the aforementioned means of obtaining the first IPC and the first LLC, and are not limited here.

[0108] It can be understood that the description of the means and methods for obtaining the first IPC, the second IPC, the first LLC and the second LLC here is only an example. In actual application, they should be set in combination with specific application scenarios and are not limited here.

[0109] In the embodiment of the present application, by adjusting the LLC capacity of the first VM and verifying whether there is redundancy in the LLC capacity of the first VM, the immediate reaction of the first VM to the change in LLC capacity can be flexibly known, and the LLC capacity of the first VM can be adjusted according to the reaction, thereby improving the flexibility and initiative of the solution.

[0110] Furthermore, the status monitoring submodule may also store the first IPC, the second IPC, the first LLC, and the second LLC in the information cache module, which is not limited here.

[0111] 202. Determine whether a difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold;

[0112] After the first IPC, the second IPC, the first LLC, and the second LLC are collected, it is determined whether a difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold.

[0113] Specifically, the first threshold here is usually set according to the capacity of the first LLC. The specific value of the first threshold can be 10% of the capacity of the first LLC, that is, the capacity of the first LLC is 10% greater than the capacity of the second LLC. There is no limitation here.

[0114] If yes, execute step 203;

[0115] If not, execute step 201.

[0116] 203. Determine whether the difference between the first IPC and the second IPC is less than a second threshold;

[0117] When the difference between the capacity of the first LLC and the capacity of the second LLC is greater than the first threshold, it is further determined whether the difference between the first IPC and the second IPC is less than the second threshold.

[0118] Specifically, the second threshold here can be 3% or 5% of the first IPC, that is, when the LLC capacity of the first VM drops significantly, if the IPC of the first VM drops within 3% or 5%, it can be considered that the performance of the first VM has no obvious decline. The specific value of the second threshold is not limited here.

[0119] If yes, execute step 204;

[0120] If not, execute step 205.

[0121] 204. Generate a correspondence between the third LLC and the first identifier.

[0122] When the difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold, and the difference between the first IPC and the second IPC is less than a second threshold, a correspondence between the third LLC and the first identifier is generated, wherein the first identifier indicates that the LLC can be used by the second VM, and the second VM is any VM running in the target server group except the first VM.

[0123] Exemplarily, a bit may be added after the identification document (ID) of the third LLC to identify whether the LLC can still be used by the second VM after being allocated to the first VM;

[0124] If the LLC can be allocated to a second VM after being allocated to the first VM, the bit is set to 1;

[0125] If the LLC cannot be used by other VMs after being allocated to the first VM, the bit is set to 0.

[0126] It should be noted that the description of the specific content and form of expression of the first identifier here is only an example, and the description of the first VM and the second VM here is not limited to a specific VM. In actual application, they should be set in combination with specific application scenarios, and no restrictions are made here.

[0127] Furthermore, the correspondence between the generated third LLC and the first identifier may be stored in an information cache module, which stores all data obtained and generated by the device for allocating resources on the target server group, and the specific content is not limited here.

[0128] 205. Generate a correspondence between the first VM and the third identifier;

[0129] When the difference between the capacity of the first LLC and the capacity of the second LLC is greater than the first threshold, and the difference between the first IPC and the second IPC is greater than or equal to the second threshold, it is considered that the third LLC should not be removed from the first LLC and cannot be used by other VMs. Therefore, a correspondence between the first VM and the third identifier is generated, and the third identifier indicates that the LLC cannot be released or shared.

[0130] Exemplarily, a bit may be added after the ID of the third LLC to identify whether the LLC can still be used by the second VM after being allocated to the first VM;

[0131] If LLC can be allocated to the second VM after being allocated to the first VM, the bit is set to 1. When LLC can be allocated to the second VM after being allocated to the first VM, there are two specific cases:

[0132] Case 1: The LLC is released by the first VM and can be used exclusively by the second VM.

[0133] Case 2: The LLC is marked as a sharable LLC by the first VM and can be shared by the second VM and the first VM.

[0134] If the LLC cannot be used by other VMs after being allocated to the first VM, the bit is set to 0.

[0135] It should be noted that the description of the specific content and form of expression of the first identifier here is only an example, and the description of the first VM and the second VM here is not limited to a specific VM. In actual application, they should be set in combination with specific application scenarios, and no restrictions are made here.

[0136] 206. At a fifth moment, the first IPC, the second IPC, the first LLC, and the second LLC are deleted.

[0137] In some possible implementations, the information cache module deletes the first IPC, the second IPC, the first LLC, and the second LLC at a fifth moment, wherein the fifth moment is after the second moment, and a duration between the second moment and the fifth moment is equal to a preset duration.

[0138] Specifically, in order to fully utilize the storage resources in the information cache module, a preset time can be set as the lifespan of the data in the information cache module. When the time when the data is written into the information cache module reaches the preset time, the information cache module automatically clears the data. The preset time can be five minutes or half an hour, etc., and there is no restriction here. In actual applications, it can be set in combination with specific usage scenarios.

[0139] In an embodiment of the present application, the IPC changes of the first VM and the LLC capacity changes of the VM are collected during the operation of the VM, and these changes are analyzed. When the LLC capacity corresponding to the first VM is significantly reduced and the IPC of the first VM has no significant change, it is considered that the LLC capacity corresponding to the first VM is too large, and part of the LLC capacity can be divided out to share with other virtual machines. During the operation of the first VM, the actual use of the LLC is analyzed in combination with the first VM, and the LLC corresponding to the running first VM is redistributed, thereby improving the utilization efficiency of LLC resources.

[0140] based on Figure 2 In the solution shown in , there are a variety of different means in some specific implementation scenarios to ensure that appropriate shared LLC resources can be acquired.

[0141] In one possible case, after selecting to release or share the LLC resources of the running virtual machine A, if the first attempt to release or share the LLC resources of virtual machine A fails, another attempt will be made until a preset number of attempts have been made and the LLC resources of virtual machine A still cannot be released or shared, at which time the attempt to release or share the LLC resources of virtual machine A will be abandoned.

[0142] by Figure 2 Taking the scheme shown as an example, if the difference between the first IPC and the second IPC is greater than or equal to the second threshold, step 205 is not performed, but the capacity of the third LLC is adjusted, and steps 201 to 204 are repeated. For example, the capacity of the third LLC is adjusted to 25% of the capacity of the first LLC, 12.5% ​​of the capacity of the first LLC, etc. If the capacity of the third LLC is less than 10% of the capacity of the first LLC, and the decrease of the IPC of the first VM is still greater than 5%, the attempt on the first VM can be abandoned.

[0143] It is understandable that the description of the method for performing multiple LLC capacity adjustments on the first VM here is only an example. In actual applications, it should be set in combination with specific application scenarios and is not limited here.

[0144] In some other possible ways, when the first release or sharing of the LLC resources of the running virtual machine A fails, the operation performed on the virtual machine A can be directly performed on other virtual machines, which will not be described in detail here.

[0145] In some other possible methods, similar operations performed on virtual machine A can be performed on all virtual machines on the target server group by traversal, and these virtual machines can be sorted according to the releasable or shareable LLC capacity of the virtual machines. The specific implementation means are not limited here.

[0146] Next, the stage in which the running virtual machine B occupies or shares the LLC resources of virtual machine A is introduced. Figure 3 , Figure 3 Another schematic diagram of the resource allocation method provided in an embodiment of the present application.

[0147] 301. Obtain the first VM number, the second VM number, the first ID, and the second ID;

[0148] During the operation of the target server group, the status monitoring submodule detects the number of VMs running on the target server group and the IDs of the VMs running on the target server group in real time. For example, the number of the first VMs running on the target server group and the first IDs of the VMs running on the target server group are obtained at the sixth moment, and the number of the second VMs running on the target server group and the second IDs of the VMs running on the target server are obtained at the seventh moment.

[0149] Specifically, the status monitoring submodule periodically obtains from the kernel the number of VMs running on the target server group and the ID of the VM running on the target server group.

[0150] For example, the status monitoring submodule obtains from the kernel that at the sixth moment, three VMs are running on the target server group, and the three VMs are the first VM, the second VM and the third VM. Therefore, the number of first VMs is 3, and the first IDs are 001, 002 and 003.

[0151] At the seventh moment, the status monitoring submodule obtains from the kernel that four VMs are running on the target server group, and these four VMs are the first VM, the second VM, the third VM and the fourth VM. Therefore, the number of second VMs is 4, and the second IDs are 001, 002, 003 and 004.

[0152] It can be understood that the instructions here for obtaining the first VM number, the second VM entry, the first ID and the second ID are only examples. In actual use, there may be a situation where a VM running on the target server group completes all tasks and a new VM is added to the target server group, resulting in the same number of VMs but different VM IDs. When using it specifically, it should be set in combination with the specific application scenario and is not restricted here.

[0153] 302. Determine whether the number of first VMs is the same as the number of second VMs, and the first ID is the same as the second ID;

[0154] After obtaining the first VM number, the second VM number, the first ID and the second ID, determine whether the first VM number, the second VM number, the first ID and the second ID satisfy that the first VM number is the same as the second VM number, and the first ID is the same as the second ID.

[0155] If yes, execute step 303;

[0156] If not, execute step 308.

[0157] 303. Obtain the third IPC, the fourth IPC, the fourth LLC, and the fifth LLC;

[0158] When the first process number is the same as the second process number, and the first ID is the same as the second ID, the status monitoring submodule obtains the third IPC, the third IPC, the fourth LLC, and the fifth LLC. Among them, the third IPC is the IPC of the second VM at the third moment, the fourth IPC is the IPC of the second VM at the fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, the ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment. The second VM runs on the target server group.

[0159] When the number of VMs on the target server group and the IDs of the VMs running on the target server group are stable, it means that the VMs on the target server group can already run stably, and the status monitoring submodule is triggered to start acquiring the statistical information of the VMs running on the target server group, and the specification information acquisition submodule acquires the specification information of the VMs running on the target server group, so as to analyze whether LLC resources can be optimized for the multiple VMs running on the target server group. Among them, the statistical information of the VMs running on the target server group may specifically include the third IPC and the fourth IPC. The specification information of the VMs running on the target server group may specifically include the fourth LLC and the fifth LLC, which are not limited here.

[0160] Furthermore, the statistical information of the VMs running on the target server group may also include the number of instructions executed in a preset period before and after the third moment on the target server group, and the number of instructions executed in a preset period and in a preset period before and after the fourth moment on the target server group. Furthermore, the number of cache accesses at the third moment, the number of cache hits at the third moment, the memory bandwidth occupancy at the third moment, and the real-time IO bandwidth at the third moment may also be collected, which are not limited here.

[0161] In some possible situations, the collection of the IPC of the second VM and the LLC of the second VM may be performed during the normal operation of the second VM, and may also be performed while adaptively adjusting the LLC capacity of the second VM, which is not limited here.

[0162] Furthermore, the status monitoring submodule may also store the third IPC, the fourth IPC, the fourth LLC and the fifth LLC into the information cache module, which is not limited here.

[0163] 304. Determine whether the capacity of the fourth LLC is less than the capacity of the fifth LLC;

[0164] After obtaining the third IPC, the fourth IPC, the fourth LLC, and the fifth LLC, it is determined whether the capacity of the fourth LLC is less than the capacity of the fifth LLC.

[0165] If yes, execute step 305;

[0166] If not, execute step 301.

[0167] 305. Determine whether the difference between the fourth IPC and the third IPC is greater than a third threshold;

[0168] When the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, it is determined whether the difference between the fourth IPC and the third IPC is greater than a third threshold.

[0169] Specifically, the third threshold here may be 5% of the fourth IPC, or the third threshold may also be 0.

[0170] That is, if the IPC of the second VM increases with the capacity of the LLC of the second VM, it can be considered that the IPC of the second VM is positively correlated with the capacity of the LLC of the second VM, and the computing performance of the second VM can be improved by increasing the capacity of the LLC of the second VM. There is no limitation here.

[0171] If the IPC of the second VM does not change with the increase in the capacity of the LLC of the second VM, or has a negative increase, it means that the computing performance of the second VM cannot be improved by increasing the capacity of the LLC of the second VM.

[0172] It can be understood that the description of the specific value of the third threshold here is only an example. In actual application, it should be set in combination with specific scenarios and is not limited here.

[0173] If yes, execute step 306;

[0174] If not, execute step 307.

[0175] 306. Generate a correspondence relationship between the second VM and the sixth LLC;

[0176] When the capacity of the fourth LLC is less than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is greater than a third threshold, the LLC allocation decision submodule generates a correspondence between the second VM and the sixth LLC, wherein the sixth LLC carries a first identifier indicating that the LLC can be used by the second VM.

[0177] Furthermore, the LLC allocation decision submodule may also store the corresponding relationship between the second VM and the sixth LLC in the information cache module, which is not limited here.

[0178] Specifically, when the sixth LLC has no corresponding VM, the second VM may directly occupy the sixth LLC.

[0179] However, if the sixth LLC is the LLC allocated to the third VM when the correspondence relationship between the second VM and the sixth LLC is generated, then the sixth LLC is an LLC resource shared by the second VM and the third VM.

[0180] Exemplarily, in a specific application scenario, when the resources of the sixth LLC are not fully used, the instructions of the second VM and the third VM may be executed in sequence according to the order in which the tasks of the second VM and the third VM are initiated.

[0181] When all resources of the sixth LLC are used, when the second VM and the third VM initiate tasks at the same time, the tasks of the second VM and the third VM can be executed at the same time after releasing the data in the sixth LLC according to the preset window duration.

[0182] It can be understood that the description of the specific usage scenarios of the sixth LLC here is only an example. In actual applications, the resources in the sixth LLC can be released periodically, and the resource mode in the sixth LLC does not need to be limited by whether the resources in the sixth LLC are sufficient. The specific implementation method should be set in combination with the specific application scenario and is not restricted here.

[0183] 307. Generate a correspondence between the second VM and the second identifier;

[0184] When the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is smaller than or equal to the third threshold, a correspondence between the second VM and the second identifier is generated, wherein the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

[0185] 308. Delete the correspondence between the first VM and the LLC corresponding to the first VM;

[0186] When at least one of the number of the first VMs is different from the number of the second VMs and the first ID is different from the second ID, the correspondence between the first VM and the LLC corresponding to the first VM is deleted.

[0187] Exemplarily, after the status monitoring submodule obtains the first VM number, the first ID, the second VM number and the second ID, it determines whether the first VM and the second VM are the same and whether the first ID and the second ID are the same. When at least one of the first VM number and the second VM number is different and the first ID and the second ID are different is established, the correspondence between the first VM and the LLC corresponding to the first VM stored in the information cache submodule is deleted.

[0188] Specifically, if the first VM, the second VM, and the third VM are running on the target server group at the sixth moment;

[0189] At the seventh moment, the first VM, the second VM, the third VM, and the fourth VM are running on the target server group;

[0190] Delete the correspondence between the first VM and the LLC corresponding to the first VM, the correspondence between the second VM and the LLC corresponding to the second VM, the correspondence between the third VM and the LLC corresponding to the third VM, and the correspondence between the fourth VM and the LLC corresponding to the fourth VM.

[0191] That is, the LLC resource allocation results corresponding to all VMs running on the current target server group are cleared.

[0192] It is understandable that there is no clear order between step 308 and step 309. The description here is only an example. In actual application, the settings should be made in combination with specific application scenarios, and no limitation is made here.

[0193] 309. Obtain specification information of the VM running on the target server group;

[0194] When the relationship between the first process number, the second process number, the first ID and the second ID does not satisfy that the first process number is the same as the second process number, and the first ID is the same as the second ID, the specification information of the VM running on the target server group is obtained. The specification information running on the target server group includes the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group, and the first capacity is the size of the memory of the first VM.

[0195] Specifically, the specification information acquisition submodule obtains the specification information of the VM running on the target server group from the kernel, for example, the number of the computer core corresponding to the VM running on the target server group, the memory size corresponding to the VM running on the target server group, etc., which are not limited here.

[0196] Furthermore, the specification information acquisition submodule may also store the acquired specification information of the VM running on the target server group in the information cache module, which is not limited here.

[0197] It can be understood that the description here of obtaining the specification information of the VM running on the target server group is only an example. In actual applications, the specification information of the VM running on the target server group may also include the number of first computing cores, the number of computing cores of the target server group and the capacity of the LLC of the target server group. The first number of computing cores is the number of computing cores of the first VM. The specific usage should be set in combination with the specific application scenario and is not restricted here.

[0198] It is understandable that there is no clear order between step 308 and step 309. The description here is only an example. In actual application, the settings should be made in combination with specific application scenarios, and no limitation is made here.

[0199] 310. Generate a correspondence between the first VM and the first LLC according to specification information of the VM running on the target server group.

[0200] After obtaining the specification information of the VM, a correspondence between the first VM and the first LLC is generated according to the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group, wherein the first capacity is the memory capacity of the first VM.

[0201] Exemplarily, first, the ratio between the first capacity and the capacity of the memory of the target server group is calculated to obtain the first ratio. Secondly, the product of the capacity of the LLC of the target server group and the first ratio is calculated to obtain the third capacity. A first LLC is selected from the LLC resources of the target server group, the capacity of the first LLC is the same as the third capacity, and a corresponding relationship between the first VM and the first LLC is generated.

[0202] In actual applications, LLC resources are allocated to each VM in the target server group. The specific allocation method is similar to that of allocating the first LLC to the first VM, which will not be repeated here.

[0203] It can be understood that when the specification information of the VM running on the target server group includes the number of first computing cores, the number of computing cores of the target server group and the capacity of the LLC of the target server group, an operation similar to step 310 is also performed, first calculating the ratio of the number of first computing cores to the computing cores of the target server group, then calculating the product of the capacity of the LLC of the target server group and the ratio, obtaining the LLC capacity, selecting the first LLC of the LLC capacity from the target server group as the LLC of the first VM, and generating a correspondence between the first VM and the first LLC.

[0204] In an embodiment of the present application, by detecting the VMs running in the target server group, when the VMs running in the target server group change, LLC resources are reallocated to the VMs in the target server group, thereby avoiding the situation where, after the LLC resources of the VMs are adjusted and the operation of the VMs with smaller LLC requirements on the target server group is terminated, there is no LLC resources to be allocated to the newly added VMs.

[0205] In an embodiment of the present application, by detecting the VMs running in the target server group, when the number of VMs running in the target server group and the IDs of the VMs running in the target server group remain unchanged, a demand analysis and reallocation of LLC resources of the VMs running in the target server group are triggered, and during the process of the VMs running on the target server group, the LLC resources of the VMs running on the target server group are dynamically adjusted, thereby improving the utilization efficiency of LLC resources by the VMs in the target server group and improving the performance of the VMs running on the target server group.

[0206] The foregoing Figure 2 and Figure 3 The LLC resource release or sharing phase of the running virtual machine A and the LLC resource occupation or sharing phase of the running virtual machine B are introduced respectively. It should be noted that: Figure 2 and Figure 3 In the embodiment, the release and sharing of LLC resources of the running virtual machine A, and the occupation or sharing of LLC resources of the running virtual machine B can be implemented in the same embodiment, which is not limited here.

[0207] In addition, Figure 2 The triggering condition of step 201 can be Figure 3 The triggering condition of step 303 is the same as that of step 304. When the VMs on the target server group are running stably, the LLC resources between the VMs on the target server group are adjusted.

[0208] In one possible scenario, Figure 2 Step 201 and Figure 3 The trigger condition of step 303 may also be that the target server group is periodically checked.

[0209] In one possible scenario, Figure 2 Step 201 and Figure 3 The trigger condition of step 303 may also be triggered by the target server group obtaining a VM creation request, which is not limited here.

[0210] Finally, the operations performed during the target server group startup phase are described in conjunction with the attached figure. Figure 4 , Figure 4 Another schematic diagram of the resource allocation method provided in an embodiment of the present application.

[0211] 401. Obtain a first VM creation request and a second VM creation request;

[0212] When the target server group is just started, the target server obtains a first VM creation request and a second VM creation request, wherein the first VM creation request indicates that the memory size of the first VM is a first capacity, and the second VM creation request indicates that the memory size of the second VM is a second capacity.

[0213] It is understandable that the order of obtaining the first VM creation request and the second VM creation request is not clearly limited here, and the example of obtaining the first VM creation request and the second VM creation request at the same time is used here for explanation.

[0214] 402. Create a correspondence relationship between the first VM and the first LLC;

[0215] After obtaining the first VM creation request, a correspondence between the first VM and the first LLC is created according to the first VM creation request, wherein the ratio of the first capacity to the capacity of the target server group is equal to the ratio of the capacity of the first LLC to the capacity of the LLC of the target server group.

[0216] That is, after obtaining the first VM creation request, the ratio between the first capacity and the storage resources that the target server group can provide is calculated to obtain the first ratio, and the product of the first ratio and the LLC capacity that the target server group can provide is calculated to obtain the capacity of the first LLC.

[0217] It can be understood that the description of the method for creating the corresponding relationship between the first VM and the first LLC here is only an example. In actual application, it should be set in combination with specific application scenarios and is not limited here.

[0218] It should be noted that there is no clear order between step 402 and step 403. The description in this embodiment is only an example. In actual application, it should be set in combination with the specific application scenario, and no limitation is made here.

[0219] 403. Create a correspondence between the second VM and the second LLC.

[0220] After obtaining the second VM creation request, a correspondence between the second VM and the second LLC is created according to the second VM creation request, wherein the ratio of the second capacity to the capacity of the target server group is equal to the ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

[0221] That is, after obtaining the second VM creation request, the ratio between the second capacity and the storage resources that the target server group can provide is calculated to obtain the second ratio, and the product of the second ratio and the LLC capacity that the target server group can provide is calculated to obtain the capacity of the second LLC.

[0222] It can be understood that the description of the method for creating the corresponding relationship between the first VM and the first LLC here is only an example. In actual application, it should be set in combination with specific application scenarios and is not limited here.

[0223] It should be noted that there is no clear order between step 402 and step 403. The description in the embodiment of the present application is only an example. In actual application, it should be set in combination with the specific application scenario, and no limitation is made here.

[0224] In the embodiment of the present application, when the target server group is just started, when creating a VM, the ratio of the capacity of the LLC corresponding to the VM and the capacity of the LLC that the target server group can provide is determined based on the ratio of the memory capacity required to create the VM and the memory capacity that the target server group can provide, and then the capacity of the LLC corresponding to the VM is obtained, and the LLC is allocated to the VM. This avoids the situation where there is not enough data support to allocate LLC to the VM during the startup phase of the target server group, and improves the execution efficiency of the solution.

[0225] It should be noted that the allocation of resources to all VMs planned to run in the target server group may occur not only when the target server group is just started, but also when a large number of VM creation requests suddenly come in. For example, within ten minutes, more than five VM creation requests are suddenly received, and there are three VMs running in the target server group. The target server group clears the resource allocation to the three VMs in the target server group and uniformly allocates resources to all eight VMs planned to run in the target server group. The resource allocation method is the same as the above Figure 4 The above is similar to what is introduced in , so I will not repeat it here.

[0226] It is understandable that the description here of allocating resources to all VMs planned to run in the target server group is only an example. In actual application, it should be set in combination with specific application scenarios, and no limitation is made here.

[0227] The resource allocation method proposed in this application is introduced above. The resource allocation device provided in this application is introduced below in conjunction with the accompanying drawings. Figure 5 , Figure 5 Another structural schematic diagram of the resource allocation device provided in an embodiment of the present application.

[0228] A resource allocation device 50, comprising:

[0229] The state monitoring submodule 501 is used to obtain a first instruction per beat IPC, a second IPC, a first bottom cache LLC, and a second LLC, wherein the first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, and the second LLC is the LLC of the first VM at the second moment. Before the first moment and the second moment, the first VM runs on the target server group;

[0230] The performance and demand analysis submodule 502 is used to generate a correspondence between the third LLC and the first identifier if the difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold, and the difference between the first IPC and the second IPC is less than a second threshold. The first identifier indicates that the LLC can be used by the second VM, and the second VM is any VM running in the target server group except the first VM, and the first LLC is composed of the third LLC and the second LLC.

[0231] Optionally, the status monitoring submodule 501 is further used to obtain a third IPC, a fourth IPC, a fourth LLC, and a fifth LLC, where the third IPC is the IPC of the second VM at a third moment, the fourth IPC is the IPC of the second VM at a fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, the ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment;

[0232] The device also includes:

[0233] The LLC allocation decision submodule 503 is used to generate a correspondence between the second VM and the sixth LLC if the capacity of the fourth LLC is less than the capacity of the fifth LLC and the difference between the fourth IPC and the third IPC is greater than a third threshold, and the sixth LLC carries the first identifier.

[0234] Optionally, the state monitoring submodule 501 is further configured to obtain the number of first VMs running on the target server group and the first IDs of the VMs running on the target server group at a sixth moment;

[0235] The state monitoring submodule 501 is further used to obtain the number of second VMs running on the target server group and the second ID of the VMs running on the target server group at the seventh moment, the sixth moment and the seventh moment being before the first moment;

[0236] The status monitoring submodule 501 is specifically configured to obtain the first IPC, the second IPC, the LLC, and the second LLC if the number of the first VMs is the same as the number of the second VMs, and the first ID is the same as the second ID.

[0237] Optionally, the first VM runs on the target server group at moment 7;

[0238] The LLC allocation decision submodule 503 is further used to:

[0239] If the number of the first VMs is different from the number of the second VMs, and at least one of the first ID and the second ID is different is true, the correspondence between the first VM and the LLC corresponding to the first VM is deleted;

[0240] Obtain a first capacity, a memory capacity of a target server group, and a capacity of an LLC of the target server group, wherein the first capacity is a size of a memory of the first VM;

[0241] A correspondence relationship between the first VM and the first LLC is generated according to the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group.

[0242] Optionally, the status monitoring submodule 501 is specifically used for:

[0243] Obtain a first IPC and a first LLC at a first moment;

[0244] The third LLC is removed from the first LLC to obtain a second LLC, wherein the ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value;

[0245] A second IPC is obtained at a second time.

[0246] Optionally, the device further comprises:

[0247] A request acquisition submodule 504 is used to acquire a first VM creation request and a second VM creation request, wherein the first VM creation request indicates that the memory size of the first VM is a first capacity, and the second VM creation request indicates that the memory size of the second VM is a second capacity;

[0248] LLC allocation decision submodule 503, specifically used to create a correspondence between the first VM and the first LLC, the ratio of the first capacity to the capacity of the target server group is equal to the ratio of the capacity of the first LLC to the capacity of the LLC of the target server group;

[0249] The LLC allocation decision submodule 503 is specifically used to create a correspondence between the second VM and the second LLC, and the ratio of the second capacity to the capacity of the target server group is equal to the ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

[0250] Optionally, the device further includes an information cache submodule 505, which is used to delete the first IPC, the second IPC, the first LLC and the second LLC at a fifth moment, the fifth moment being after the second moment, and the duration from the second moment to the fifth moment is equal to a preset duration.

[0251] Optionally, the device further comprises:

[0252] The LLC capacity analysis submodule 506 is used to generate a correspondence between the second VM and the second identifier if the capacity of the fourth LLC is less than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is less than or equal to a third threshold, and the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

[0253] It should be noted that Figure 5 The specific structure and working content of the resource allocation device described in is only a possible situation. In actual application, the functional modules should be set in combination with the specific application scenarios to implement specific steps and functions, and no limitation is made here.

[0254] See also Figure 6 , Figure 6 Another structural schematic diagram of the resource allocation device provided in an embodiment of the present application.

[0255] The apparatus 600 for data analysis includes: a bus 602, a processor 604, a memory 606, and a communication interface 608. The processor 604, the memory 606, and the communication interface 608 communicate with each other through the bus 602. The apparatus 900 for resource allocation can be a server or a terminal device. It should be understood that the present application does not limit the number of processors 604 and memories 606 in the apparatus 600 for resource allocation.

[0256] The bus 602 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, Figure 6 The bus 602 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 602 may include a path for transmitting information between various components of the resource allocation device 600 (eg, the memory 606, the processor 604, and the communication interface 608).

[0257] The processor 604 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).

[0258] The memory 606 may include a volatile memory, such as a random access memory (RAM). The processor 604 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).

[0259] The memory 606 stores executable program codes, and the processor 604 executes the executable program codes to respectively implement the functions of the aforementioned status monitoring submodule 501, performance and demand analysis submodule 502, LLC allocation decision submodule 503, request acquisition submodule 504, information cache submodule 505, and LLC capacity analysis submodule 506, thereby implementing any one of the data storage methods. That is, the memory 606 stores instructions for executing any one of the resource allocation methods.

[0260] Alternatively, the memory 606 stores executable codes, and the processor 604 executes the executable codes to respectively implement the functions of the aforementioned access points, thereby implementing any of the data storage methods. That is, the memory 606 stores instructions for executing any of the data storage methods.

[0261] The communication interface 608 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the resource allocation apparatus 600 and other devices or a communication network.

[0262] See also Figure 7 , Figure 7 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application.

[0263] The computing device cluster includes at least one resource allocation device. The resource allocation device 600 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 computer, a laptop computer, or a smart phone.

[0264] like Figure 7 As shown, the computing device cluster includes at least one resource allocation apparatus 600. The memory 606 in one or more resource allocation apparatuses 600 in the computing device cluster may store the same instructions for executing any one of the resource allocation methods.

[0265] In some possible implementations, the memory 606 of one or more resource allocation devices 600 in the computing device cluster may also store partial instructions for executing any one of the resource allocation methods. In other words, a combination of one or more resource allocation devices 600 may jointly execute instructions for executing any one of the data storage methods.

[0266] It should be noted that the memory 606 in different resource allocation devices 600 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the cloud management platform. That is, the instructions stored in the memory 606 in different resource allocation devices 600 can realize the functions of one or more units in the status monitoring submodule 501, the performance and demand analysis submodule 502, the LLC allocation decision submodule 503, the request acquisition submodule 504, the information cache submodule 505 and the LLC capacity analysis submodule 506.

[0267] In some possible implementations, one or more resource allocation devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network.

[0268] See also Figure 8 , Figure 8 Another structural diagram of a computing device cluster provided in an embodiment of the present application.

[0269] like Figure 8As shown, two resource allocation devices 600A and 600B are connected via a network. Specifically, they are connected to the network via the communication interface in each computing device. In this type of possible implementation, the memory 606 in the resource allocation device 600A stores instructions for the functions of the execution status monitoring submodule 501, the performance and demand analysis submodule 502, and the LLC allocation decision submodule 503. At the same time, the memory 606 in the resource allocation device 600B stores instructions for the functions of the request acquisition submodule 504, the information cache submodule 505, and the LLC capacity analysis submodule 506.

[0270] It should be understood that Figure 8 The function of the resource allocation apparatus 800A shown in FIG. 8 may also be completed by multiple resource allocation apparatuses 600. Similarly, the function of the resource allocation apparatus 600B may also be completed by multiple resource allocation apparatuses 600.

[0271] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Figure 7 and Figure 8 Connection mode of computing device cluster. The difference is that the memory 606 in one or more resource allocation apparatuses 600 in the computing device cluster may store the same instructions for executing any one of the methods for data storage.

[0272] In some possible implementations, the memory 606 of one or more resource allocation devices 600 in the computing device cluster may also store partial instructions for executing any of the data storage methods. In other words, a combination of one or more resource allocation devices 600 may jointly execute instructions for executing any of the data storage methods.

[0273] It should be noted that the memory 606 in different resource allocation apparatuses 600 in the computing device cluster may store different instructions for executing partial functions of the resource allocation apparatus.

[0274] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0275] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0276] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0277] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0278] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for resource allocation, characterized in that: include: Get a first instruction per beat IPC, a second IPC, a first bottom cache LLC, and a second LLC, where the first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, the second LLC is the LLC of the first VM at the second moment, the first moment is before the second moment, and the first VM runs in the target server group; If the difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold, and the difference between the first IPC and the second IPC is less than a second threshold, a correspondence between the third LLC and the first identifier is generated, the first identifier indicates that the LLC can be used by the second VM, the second VM is any VM running on the target server group except the first VM, and the first LLC is composed of the third LLC and the second LLC.

2. The method according to claim 1, characterized in that The method further comprises: Obtain a third IPC, a fourth IPC, a fourth LLC, and a fifth LLC, wherein the third IPC is the IPC of the second VM at a third moment, the fourth IPC is the IPC of the second VM at the fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, a ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment; If the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is greater than a third threshold, a correspondence between the second VM and the sixth LLC is generated, and the sixth LLC carries the first identifier.

3. The method according to claim 1 or 2, characterized in that: Before obtaining the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC, and the second LLC, the method further includes: Obtaining, at a sixth moment, the number of first VMs running on the target server group and first IDs of VMs running on the target server group; Acquire the number of second VMs running on the target server group and the second IDs of the VMs running on the target server group at a seventh moment, wherein the sixth moment and the seventh moment are before the first moment; The obtaining of the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC and the second LLC includes: If the number of the first VMs is the same as the number of the second VMs, and the first ID is the same as the second ID, the first IPC, the second IPC, the LLC, and the second LLC are obtained.

4. The method according to claim 3, characterized in that The first VM runs on the target server group at the seventh moment; The method further comprises: If the number of the first VMs is different from the number of the second VMs, and at least one of the first ID and the second ID is different is true, delete the correspondence between the first VM and the LLC corresponding to the first VM; Obtaining a first capacity, a capacity of a memory of the target server group, and a capacity of an LLC of the target server group, wherein the first capacity is a size of a memory of the first VM; A correspondence relationship between the first VM and the first LLC is generated according to the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group.

5. The method according to any one of claims 1 to 4, characterized in that: The obtaining of the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC and the second LLC includes: Acquire the first IPC and the first LLC at the first moment; Removing the third LLC from the first LLC to obtain a second LLC, wherein a ratio of a capacity of the third LLC to a capacity of the first LLC is a first preset value; The second IPC is acquired at the second moment.

6. The method according to any one of claims 1 to 4, characterized in that: Before obtaining the first number of instructions per beat IPC, the second IPC, the first bottom cache LLC, and the second LLC, the method further includes: Obtaining a first VM creation request and a second VM creation request, wherein the first VM creation request indicates that the memory size of the first VM is a first capacity, and the second VM creation request indicates that the memory size of the second VM is a second capacity; Creating a correspondence between the first VM and the first LLC, where a ratio of the first capacity to the capacity of the target server group is equal to a ratio of the capacity of the first LLC to the capacity of the LLC of the target server group; A correspondence relationship between the second VM and the second LLC is created, and a ratio of the second capacity to the capacity of the target server group is equal to a ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The first IPC, the second IPC, the first LLC and the second LLC are deleted at a fifth moment, the fifth moment is after the second moment, and the duration from the second moment to the fifth moment is equal to a preset duration.

8. The method according to any one of claims 2 to 7, characterized in that: The method further comprises: If the capacity of the fourth LLC is smaller than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is smaller than or equal to a third threshold, a correspondence between the second VM and the second identifier is generated, and the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

9. A resource allocation device, characterized in that: include: A state monitoring submodule, used to obtain a first number of instructions per beat IPC, a second IPC, a first bottom-level cache LLC, and a second LLC, wherein the first IPC is the IPC of the first VM at the first moment, the second IPC is the IPC of the first VM at the second moment, the first LLC is the LLC of the first VM at the first moment, the second LLC is the LLC of the first VM at the second moment, the first moment is before the second moment, and the first VM runs in the target server group; A performance and demand analysis submodule is used to generate a correspondence between a third LLC and a first identifier if the difference between the capacity of the first LLC and the capacity of the second LLC is greater than a first threshold, and the difference between the first IPC and the second IPC is less than a second threshold, wherein the first identifier indicates that the LLC can be used by a second VM, the second VM being any VM running on the target server group except the first VM, and the first LLC consisting of the third LLC and the second LLC.

10. The device according to claim 9, characterized in that The status monitoring submodule is further used to obtain a third IPC, a fourth IPC, a fourth LLC, and a fifth LLC, wherein the third IPC is the IPC of the second VM at a third moment, the fourth IPC is the IPC of the second VM at the fourth moment, the fourth LLC is the LLC of the second VM at the third moment, the fifth LLC is the LLC of the second VM at the fourth moment, the ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third moment is before the fourth moment, and the third moment is after the second moment; The device also includes: The LLC allocation decision submodule is used to generate a correspondence between the second VM and the sixth LLC if the capacity of the fourth LLC is less than the capacity of the fifth LLC and the difference between the fourth IPC and the third IPC is greater than a third threshold, and the sixth LLC carries the first identifier.

11. The device according to claim 10, characterized in that The state monitoring submodule is further used to obtain the number of first VMs running on the target server group and the first IDs of the VMs running on the target server group at a sixth moment; The state monitoring submodule is further used to obtain the number of second VMs running on the target server group and the second IDs of the VMs running on the target server group at a seventh moment, the sixth moment and the seventh moment being before the first moment; The status monitoring submodule is specifically used to obtain the first IPC, the second IPC, the LLC and the second LLC if the number of the first VMs is the same as the number of the second VMs and the first ID is the same as the second ID.

12. The device according to claim 11, characterized in that The first VM runs on the target server group at the seventh moment; The LLC allocation decision submodule is further used to: If the number of the first VMs is different from the number of the second VMs, and at least one of the first ID and the second ID is different is true, delete the correspondence between the first VM and the LLC corresponding to the first VM; Obtaining a first capacity, a capacity of a memory of the target server group, and a capacity of an LLC of the target server group, wherein the first capacity is a size of a memory of the first VM; A correspondence relationship between the first VM and the first LLC is generated according to the first capacity, the capacity of the memory of the target server group, and the capacity of the LLC of the target server group.

13. The device according to any one of claims 9 to 12, characterized in that: The state monitoring submodule is specifically used for: Acquire the first IPC and the first LLC at the first moment; Removing the third LLC from the first LLC to obtain a second LLC, wherein a ratio of a capacity of the third LLC to a capacity of the first LLC is a first preset value; The second IPC is acquired at the second moment.

14. The device according to any one of claims 9 to 12, characterized in that: The device also includes: a request acquisition submodule, configured to acquire a first VM creation request and a second VM creation request, wherein the first VM creation request indicates that the memory size of the first VM is a first capacity, and the second VM creation request indicates that the memory size of the second VM is a second capacity; The LLC allocation decision submodule is specifically configured to create a corresponding relationship between the first VM and the first LLC, wherein a ratio of the first capacity to the capacity of the target server group is equal to a ratio of the capacity of the first LLC to the capacity of the LLC of the target server group; The LLC allocation decision submodule is specifically used to create a corresponding relationship between the second VM and the second LLC, and the ratio of the second capacity to the capacity of the target server group is equal to the ratio of the capacity of the second LLC to the capacity of the LLC of the target server group.

15. The device according to any one of claims 9 to 14, characterized in that: The device also includes an information cache module, which is used to delete the first IPC, the second IPC, the first LLC and the second LLC at a fifth moment, the fifth moment is after the second moment, and the duration from the second moment to the fifth moment is equal to a preset duration.

16. The device according to any one of claims 10 to 15, characterized in that The device also includes: The LLC capacity analysis submodule is used to generate a correspondence between the second VM and the second identifier if the capacity of the fourth LLC is less than the capacity of the fifth LLC, and the difference between the fourth IPC and the third IPC is less than or equal to a third threshold, and the second identifier indicates that the VM does not need to increase the corresponding LLC capacity.

17. A device for resource allocation, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 8 is executed.

18. A computer-readable storage medium, characterized in that: The invention comprises a program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 8.

19. 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 8.

Citation Information

Patent Citations

  • Method for dynamically partitioning shared cache in multi-core environment

    CN103077128A

  • Dynamic configuration in cloud computing environments

    CN104981783A

  • Service shunting method, device and system

    CN116634027A

  • Task processing method and device, equipment and storage medium

    CN117667324A

  • Method and apparatus for processing task, and device and storage medium

    WO2024041401A1