A method, apparatus and computer storage medium for resource allocation
By collecting changes in virtual machine IPC and LLC, and dynamically adjusting LLC resource allocation, the problem of unallocated LLC resources in cloud computing is solved, improving the utilization efficiency of LLC resources and virtual machine performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2026-04-03
AI Technical Summary
In the field of cloud computing, virtualization technology does not allocate the lowest-level cache (LLC) when allocating computing cores and memory resources, resulting in low utilization efficiency of LLC resources, and the relationship between the virtual machine's demand for computing cores and its demand for LLC resources is difficult to measure.
By collecting data on the number of instructions per cycle (IPC) and LLC capacity changes of virtual machines, we can analyze the actual usage of LLC and dynamically adjust the allocation of LLC resources, including releasing or sharing LLC resources during VM operation, and optimizing LLC allocation strategies.
This improved the efficiency of LLC resource utilization, enhanced the performance of virtual machines and the overall resource utilization of the target server group, and avoided resource waste and unnecessary duplication of analysis.
Smart Images

Figure CN119645613B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing, and more particularly to a method, apparatus, and computer storage medium for resource allocation. Background Technology
[0002] In the field of cloud computing, virtualization technology is typically used to provide hardware resources on the same set of servers to different users through different virtual machines. Users can adjust the amount of computing and storage resources they use as needed without having to purchase hardware.
[0003] When virtualization technology allocates hardware resources, the operating system allocates different computing cores and different memory to different virtual machines. However, since the computing cores and the last level cache (LLC) are different hardware areas, the LLC is not allocated when allocating computing cores and memory resources.
[0004] To achieve LLC resource allocation, an LLC allocation optimization component is added to the operating system. This component allocates LLC resources to virtual machines using their basic specifications. For example, it allocates LLC resources to any virtual machine in an online virtual machine based on the number of compute cores. The number of compute cores in a virtual machine is directly proportional to its LLC capacity. Furthermore, when the number of online virtual machines or their operational phase changes, LLC capacity is reallocated. While LLC resource allocation is achieved, the relationship between the virtual machine's demand for compute cores and its LLC resource demand cannot be measured by a simple positive or negative correlation. Therefore, how to further improve the efficiency of LLC resource utilization by allocating LLC resources that match the actual needs of virtual machines becomes a problem that needs to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, and computer storage medium for resource allocation. By combining the running status of virtual machines on a server group, appropriate LLC resources are allocated to virtual machines, thereby improving the utilization efficiency of LLC resources.
[0006] The first aspect of this application provides a method for resource allocation, including:
[0007] Obtain the first instruction per clock cycle (IPC), the second IPC, the first lowest level 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 is running 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. 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 other than the first VM. The first LLC is composed of the third LLC and the second LLC.
[0009] In this embodiment, the IPC changes of the first VM and the LLC capacity changes of the first VM during VM operation are collected and analyzed. When the LLC capacity of the first VM decreases significantly and the IPC of the first VM does not change significantly, it is considered that the LLC capacity of the first VM is too large, and a portion of the LLC capacity can be allocated to other virtual machines. During the operation of the VM, the actual usage of LLC by the first VM is analyzed, and the LLC corresponding to the running first VM is re-allocated, thereby improving the utilization efficiency of LLC resources.
[0010] In one possible implementation of the first aspect, the method further includes:
[0011] Obtain the third IPC, the fourth IPC, the fourth LLC, and the fifth LLC. The third IPC is the IPC of the second VM at the third time, the fourth IPC is the IPC of the second VM at the fourth time, the fourth LLC is the LLC of the second VM at the third time, and the fifth LLC is the LLC of the second VM at the fourth time. The ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio. The third time is before the fourth time and after the second time.
[0012] If the capacity of the fourth LLC is less than that of the fifth LLC, and the difference between the fourth IPC and the third IPC is greater than the third threshold, a correspondence is generated between the second VM and the sixth LLC, and the sixth LLC carries the first identifier.
[0013] In this embodiment, by acquiring the IPC and LLC of the second VM during its operation, and when the IPC of the second VM increases along with 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 then allocated to the second VM for use. By reasonably redistributing LLC resources, the performance of the VMs running on the target server group is improved.
[0014] In one possible implementation of the first aspect, before obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC, the method further includes:
[0015] Obtain the first number of VMs running on the target server group at time 6 and the first ID of the VMs running on the target server group;
[0016] Obtain the number of second VMs running on the target server group at time 7 and the second ID of the VMs running on the target server group, time 6 and time 7 before time 1;
[0017] Obtain the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC, including:
[0018] If the number of first VMs is the same as the number of second VMs, and the first ID and the second ID are the same, obtain the first IPC, the second IPC, the LLC, and the second LLC.
[0019] In 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 ID of the VMs running in the target server group remain unchanged, a demand analysis and reallocation of LLC resources for the VMs running in the target server group is triggered. During the operation of the VMs in the target server group, the LLC resources of the VMs running in the target server group are dynamically adjusted, thereby improving the utilization efficiency of LLC resources of the VMs in the target server group.
[0020] In one 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 at least one of the following is true: the number of first VMs is different from the number of second VMs, and the first ID is different from the second ID, delete the correspondence between the first VM and the LLC corresponding to the first VM.
[0023] Obtain the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group. The first capacity is the memory size of the first VM.
[0024] Based on the first capacity, the memory capacity of the target server group, and the capacity of the LLC of the target server group, generate the correspondence between the first VM and the first LLC.
[0025] In this embodiment of the 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. This avoids the situation where, after adjusting the LLC resources of the VMs, the VMs with low LLC requirements are no longer running on the target server group, and new VMs have no LLC resources to allocate.
[0026] In one possible implementation of the first aspect, obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC includes:
[0027] Acquire the first IPC and the first LLC at the first moment;
[0028] The third LLC is removed from the first LLC to obtain the second LLC. The ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value.
[0029] Acquire the second IPC at the second time point.
[0030] In this embodiment, by adjusting the LLC capacity of the first VM, it is verified whether there is redundancy in the LLC capacity of the first VM. This allows for flexible and immediate knowledge of the VM's response to LLC capacity changes, and the LLC capacity of the first VM can be adjusted based on this response, thereby improving the flexibility and proactivity of the solution.
[0031] In one possible implementation of the first aspect, before obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC, the method further includes:
[0032] Obtain a first VM creation request and a second VM creation request. 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.
[0033] Establish 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 in the target server group.
[0034] Create a mapping between the second VM and the second LLC, where the ratio of the second capacity to the target server group capacity is equal to the ratio of the second LLC capacity to the target server group LLC capacity.
[0035] In this embodiment, during the initial startup phase of the target server group, when creating a VM, the ratio of the memory capacity required to create the VM to the memory capacity that the target server group can provide is used to determine the ratio of the LLC capacity corresponding to the VM to the LLC capacity that the target server group can provide. This allows for the acquisition of the LLC capacity corresponding to the VM and the allocation of LLCs to the VM. This avoids the situation where there is insufficient data to support LLC allocation for the VM during the target server group startup phase, thus improving the execution efficiency of the solution.
[0036] In one possible implementation of the first aspect, the method further includes:
[0037] At the fifth time, delete the first IPC, the second IPC, the first LLC, and the second LLC. The fifth time is after the second time, and the duration from the second time to the fifth time is equal to the preset duration.
[0038] In this embodiment, to fully utilize the storage resources in the information caching module, a preset duration can be set as the usage period of the data in the information caching module. When the preset duration is reached, the information caching module automatically clears this data. This improves the utilization efficiency of the storage resources in the information caching module.
[0039] In one possible implementation of the first aspect, the method further includes:
[0040] If the capacity of the fourth LLC is less than that of the fifth LLC, and the difference between the fourth IPC and the third IPC is less than or equal to the third threshold, a correspondence is generated between the second VM and the second identifier. The second identifier indicates that the VM does not need to increase the corresponding LLC capacity.
[0041] In this embodiment, when the IPC of the second VM does not increase significantly as the LLC capacity of the second VM increases, the second VM does not need to increase the corresponding LLC capacity. 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 this application provides a resource allocation apparatus, comprising:
[0043] The status monitoring submodule is used to obtain the first instruction per clock cycle (IPC), the second IPC, the first lowest level 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 is running 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 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. 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 other than the first VM. The first LLC is composed of the third LLC and the second LLC.
[0045] In one possible implementation of the second aspect, the status monitoring submodule is further configured to acquire 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 time, the fourth IPC is the IPC of the second VM at a fourth time, the fourth LLC is the LLC of the second VM at a third time, and the fifth LLC is the LLC of the second VM at a fourth time, wherein the ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio, the third time is before the fourth time, and the third time is after the second time;
[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 that of the fifth LLC and the difference between the fourth IPC and the third IPC is greater than the third threshold. The sixth LLC carries the first identifier.
[0048] In one possible implementation of the second aspect, the status monitoring submodule is further configured to obtain the first number of VMs running on the target server group at the sixth time and the first ID of the VMs running on the target server group.
[0049] The status monitoring submodule is also used to obtain the number of second VMs running on the target server group at the seventh time and the second ID of the VMs running on the target server group, before the sixth and seventh times.
[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 and the second ID are the same.
[0051] In one 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 for:
[0053] If at least one of the following is true: the number of first VMs is different from the number of second VMs, and the first ID is different from the second ID, delete the correspondence between the first VM and the LLC corresponding to the first VM.
[0054] Obtain the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group. The first capacity is the memory size of the first VM.
[0055] Based on the first capacity, the memory capacity of the target server group, and the capacity of the LLC of the target server group, generate the correspondence between the first VM and the first LLC.
[0056] In one possible implementation of the second aspect, the status monitoring submodule is specifically used for:
[0057] Acquire the first IPC and the first LLC at the first moment;
[0058] The third LLC is removed from the first LLC to obtain the second LLC. The ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value.
[0059] Acquire the second IPC at the second time point.
[0060] In one possible implementation of the second aspect, the apparatus further includes:
[0061] The request acquisition submodule is used to acquire the first VM creation request and the second VM creation request. 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.
[0062] The LLC allocation decision submodule is specifically used to create the correspondence 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 in the target server group.
[0063] The LLC allocation decision submodule is specifically used to create the 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 in the target server group.
[0064] In one possible implementation of the second aspect, the device further includes an information caching module for deleting the first IPC, the second IPC, the first LLC, and the second LLC at the fifth time point, wherein the fifth time point is after the second time point, and the duration from the second time point to the fifth time point is equal to a preset duration.
[0065] In one possible implementation of the second aspect, the apparatus 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 that of the fifth LLC, and the difference between the fourth IPC and the third IPC is less than or equal to the third threshold. The second identifier indicates that the VM does not need to increase the corresponding LLC capacity.
[0067] A third aspect of this application provides a resource allocation apparatus, including a processor and a memory, wherein the memory is used to store instructions and the processor is used to execute the instructions, and when the processor executes the instructions, it performs the method as described in the first aspect or any of the embodiments of the first aspect.
[0068] A fourth aspect of this application provides a computer-readable storage medium, characterized in that it includes a program that, when run on a computer, causes the computer to perform the method as described in the first aspect or any of the embodiments of the first aspect.
[0069] A fifth aspect of this application provides a computing device cluster, characterized in that it includes at least one computing device, each computing device including a processor and a memory;
[0070] A processor of at least one computing device is configured to execute instructions stored in the memory of at least one computing device to cause a cluster of computing devices to perform the method as described in the first aspect or any embodiment of the first aspect. Attached Figure Description
[0071] Figure 1 A schematic diagram of a resource allocation apparatus provided in an embodiment of this application;
[0072] Figure 2 A schematic diagram of a resource allocation method provided in an embodiment of this application;
[0073] Figure 3 Another schematic diagram illustrating the resource allocation method provided in the embodiments of this application;
[0074] Figure 4 Another schematic diagram illustrating the resource allocation method provided in the embodiments of this application;
[0075] Figure 5 Another schematic diagram of the resource allocation apparatus provided in the embodiments of this application;
[0076] Figure 6 Another schematic diagram of the resource allocation apparatus provided in the embodiments of this application;
[0077] Figure 7 This is a schematic diagram of a computing device cluster provided in an embodiment of this application;
[0078] Figure 8 This is a schematic diagram of another structure of the computing device cluster provided in an embodiment of this application. Detailed Implementation
[0079] This application provides a method, apparatus, and computer storage medium for resource allocation. By combining the running status of virtual machines on a server group, appropriate LLC resources are allocated to virtual machines, thereby improving the utilization efficiency of LLC resources.
[0080] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is only for explaining specific embodiments and is not intended to limit the application. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0081] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0082] In the field of cloud computing, virtualization technology is typically used to provide hardware resources on the same set of servers to different users through different virtual machines. Users can adjust the amount of computing and storage resources they use as needed without having to purchase hardware.
[0083] When virtualization technology allocates hardware resources, the operating system allocates different computing cores and different memory to different virtual machines. However, since the computing cores and the last level cache (LLC) are different hardware areas, the LLC is not allocated when allocating computing cores and memory resources.
[0084] To achieve LLC resource allocation, an LLC allocation optimization component is added to the operating system. This component allocates LLC resources to virtual machines using their basic specifications. For example, it allocates LLC resources to any virtual machine in an online virtual machine based on the number of compute cores. The number of compute cores in a virtual machine is directly proportional to its LLC capacity. Furthermore, when the number of online virtual machines or their operational phase changes, LLC capacity is reallocated. While LLC resource allocation is achieved, the relationship between the virtual machine's demand for compute cores and its LLC resource demand cannot be measured by a simple positive or negative correlation. Therefore, how to further improve the efficiency of LLC resource utilization by allocating LLC resources that match the actual needs of virtual machines becomes a problem that needs to be solved.
[0085] Based on the above issues, this application proposes to collect changes in the number of instructions per cycle (IPC) and LLC capacity during the operation of a virtual machine (VM), and analyze these changes. When the LLC capacity corresponding to the VM decreases significantly and the IPC does not change significantly, it is considered that the LLC capacity corresponding to the VM is too large, and a portion of the LLC capacity can be allocated to other VMs for use. During the operation of the VM, the actual usage of LLC by the VM is analyzed, and the LLC corresponding to the running VM is re-allocated, thereby improving the utilization efficiency of LLC resources.
[0086] To facilitate understanding of the specific implementation process and data flow of the solution proposed in this application, the functional units involved in the solution are first introduced. Please refer to [link / reference needed]. Figure 1 , Figure 1 This is a schematic diagram of a resource allocation device provided in an embodiment of this application.
[0087] The resource allocation device 10 includes an information acquisition module 101, an analysis and decision-making module 102, an adjustment and execution module 103, and an information caching 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 foregoing Figure 1 The structural diagram of the resource allocation device provided will introduce the solution proposed in this application. Since the solution proposed in this application is divided into different stages in specific implementation, when introducing the solution proposed in this application, the LLC resource release or sharing stage of the running virtual machine A, the LLC resource occupation or sharing stage of the running virtual machine B, and the target server group startup stage will be introduced in sequence. Among them, 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 running virtual machine A are described. Please refer to [link / reference needed]. Figure 2 , Figure 2 This is a schematic diagram of a resource allocation method provided in an embodiment of this application.
[0093] 201. Obtain the first IPC, the second IPC, the first LLC, and the second LLC;
[0094] When multiple VMs are running on a target server group, some LLC resources are released from the multiple VMs for use by other VMs, or the LLC resources allocated to multiple VMs are shared among the VMs.
[0095] Specifically, any VM from multiple VMs can be randomly selected as the first VM. A first IPC, a second IPC, a first LLC, and a second LLC are obtained. The first IPC is the IPC of the first VM at a first time point, the second IPC is the IPC of the first VM at a second time point, the first LLC is the LLC of the first VM at the first time point, and the second LLC is the LLC of the first VM at the second time point. The first time point is before the second time point, and the first VM is running on the target server group.
[0096] In some possible cases, the collection of IPC and LLC of the first VM can be carried out during the normal operation of the first VM, or when verifying whether the current LLC capacity of the first VM is redundant, without any restrictions.
[0097] For example, this section describes the scenario where the IPC and LLC of the first VM are collected to verify whether the current LLC capacity of the first VM is redundant:
[0098] In some scenarios where IPC cannot be directly collected during operation, the performance monitoring submodule can be used to collect statistical information of the first VM at the first moment. For example, the number of instructions executed by the first VM before and after the first moment and the preset time period. Furthermore, it can also collect cache access count, cache hit count, memory bandwidth utilization and real-time IO bandwidth, etc. There are no restrictions here.
[0099] After collecting the statistical information of the first VM, the IPC of the first VM at the first moment is calculated by using the number of execution instructions of the first VM group before and after the first moment and the preset time period, and the preset time period.
[0100] For example, the first IPC is calculated using the following formula:
[0101] First
[0102] Where A is the number of instructions executed by the first VM before and after the first moment in a preset time period, and t is the preset time period.
[0103] At the same time, the first LLC is obtained by collecting the most recently updated LLC resources of the first VM from the information caching module.
[0104] The capacity of the LLC corresponding to the first VM is reduced, that is, the third LLC can be removed from the first LLC to obtain the second LLC. 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 the capacity of the first LLC, that is, the first preset value is 50%.
[0105] Furthermore, at the second moment, the performance monitoring submodule collects statistical information of the first VM again to obtain the number of instructions executed by the first VM and the preset time period before and after the second moment. The method for calculating the second IPC is similar to the method for calculating the first IPC, and there are no restrictions here.
[0106] The third LLC is removed from the first LLC to obtain the second LLC. 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 time point. The specific methods are similar to those for obtaining the first IPC and the first LLC, and no restrictions are imposed here.
[0108] It is 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 applications, the settings should be combined with the specific application scenario, and no restrictions are imposed here.
[0109] In this embodiment, by adjusting the LLC capacity of the first VM, it is verified whether there is redundancy in the LLC capacity of the first VM. This allows for flexible knowledge of the first VM's immediate response to LLC capacity changes, and the LLC capacity of the first VM can be adjusted based on this response, thus improving the flexibility and proactivity of the solution.
[0110] Furthermore, the status monitoring submodule can also store the first IPC, the second IPC, the first LLC, and the second LLC in the information cache module, without any restrictions.
[0111] 202. Determine whether the difference between the capacity of the first LLC and the capacity of the second LLC is greater than the first threshold.
[0112] After collecting the first IPC, the second IPC, the first LLC, and the second LLC, it is determined whether the 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 based on 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% larger than the capacity of the second LLC. There is no restriction here.
[0114] If so, proceed to step 203;
[0115] If not, proceed to step 201.
[0116] 203. Determine whether the difference between the first IPC and the second IPC is less than the 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 by less than 3% or 5%, it can be considered that the performance of the first VM has not dropped significantly. The specific value of the second threshold is not limited here.
[0119] If so, proceed to step 204;
[0120] If not, proceed to step 205.
[0121] 204. Generate the 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 is generated between the third LLC and the first identifier. The first identifier indicates that the LLC can be used by the second VM, which is any VM running on the target server group other than the first VM.
[0123] For example, a bit can be added after the third LLC's identification document (ID) to indicate whether the LLC can still be used by the second VM after being assigned to the first VM;
[0124] If the LLC can be allocated to a second VM after being allocated to the first VM, then set this bit to 1;
[0125] If the LLC cannot be used by other VMs after being allocated to the first VM, then the bit is set to 0.
[0126] It should be noted that the description of the specific content and form 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, it should be set according to the specific application scenario, and there are no restrictions here.
[0127] Furthermore, the correspondence between the generated third LLC and the first identifier can be stored in the information cache module. The information cache module stores all the data obtained and generated by the resource allocation device on the target server group. The specific content is not limited here.
[0128] 205. Generate the 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] For example, a bit can be added after the ID of the third LLC to indicate whether the LLC can still be used by the second VM after being assigned to the first VM;
[0131] If the LLC can be allocated to the second VM after being assigned to the first VM, then this bit is set to 1; when the LLC can be allocated to the second VM after being assigned to the first VM, there are two specific cases:
[0132] Scenario 1: The LLC is released by the first VM and can be used independently by the second VM.
[0133] Scenario 2: The LLC is marked as a shareable LLC by the first VM and can be shared and used 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, then the bit is set to 0.
[0135] It should be noted that the description of the specific content and form 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, it should be set according to the specific application scenario, and there are no restrictions here.
[0136] 206. Delete the first IPC, the second IPC, the first LLC, and the second LLC at the fifth moment.
[0137] In some possible implementations, the information caching module deletes the first IPC, the second IPC, the first LLC, and the second LLC at the fifth time point, where the fifth time point is after the second time point, and the duration between the second time point and the fifth time point is equal to the preset duration.
[0138] Specifically, to fully utilize the storage resources in the information caching module, a preset duration can be set as the usage period for data in the information caching module. When the preset duration is reached, the information caching module automatically clears this data. The preset duration can be five minutes or half an hour, etc., and there is no restriction here. In actual applications, it can be set according to the specific use case.
[0139] In this embodiment, the IPC changes and LLC capacity changes of the first VM during VM operation are collected and analyzed. When the LLC capacity corresponding to the first VM decreases significantly and the IPC of the first VM does not change significantly, it is considered that the LLC capacity corresponding to the first VM is too large, and a portion of the LLC capacity can be allocated to other virtual machines. During the operation of the first VM, the actual usage of LLC by the first VM is analyzed, and the LLC corresponding to the running first VM is re-allocated, thereby improving the utilization efficiency of LLC resources.
[0140] based on Figure 2 The schemes shown have various methods to ensure that suitable shared LLC resources can be collected in some specific implementation scenarios.
[0141] In one possible scenario, after selecting to release or share the LLC resources of a running virtual machine A, if the first attempt to release or share the LLC resources of virtual machine A fails, it will be tried again until a preset number of attempts are made. Only when the attempt to release or share the LLC resources of virtual machine A still fails will it be abandoned.
[0142] by Figure 2 Taking the illustrated scheme 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 executed. Instead, the capacity of the aforementioned third LLC is adjusted, and steps 201 to 204 are repeated. For example, the capacity of the third LLC is successively 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 in the IPC of the first VM is still greater than 5%, the attempt on the first VM can be abandoned.
[0143] It is understood that the method of performing multiple LLC capacity adjustments for the first VM is only an example. In actual applications, it should be set according to the specific application scenario, and no restrictions are imposed here.
[0144] In some other possible ways, if the first attempt to release or share the LLC resources of a running virtual machine A fails, the operations performed on virtual machine A can be directly performed on other virtual machines, which will not be elaborated here.
[0145] In some other possible ways, similar operations to those performed on virtual machine A can be performed on all virtual machines on the target server group by traversing them and sorting these virtual machines according to the capacity of their releasable or shareable LLC. The specific implementation method is not limited here.
[0146] Secondly, the section on the stage where virtual machine B occupies or shares LLC resources of virtual machine A is described; please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is another schematic diagram illustrating the resource allocation method provided in the embodiments of this application.
[0147] 301. Obtain the first number of VMs, the second number of VMs, 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, it obtains 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 at the sixth time, and obtains the number of the second VMs running on the target server group and the second IDs of the VMs running on the target server at the seventh time.
[0149] Specifically, the status monitoring submodule periodically obtains from the kernel the number of VMs running on the target server group and the IDs of the VMs running on the target server group.
[0150] For example, the status monitoring submodule obtains from the kernel that at the sixth moment, the target server group is running 3 VMs, namely the first VM, the second VM and the third VM. Therefore, the number of the first VMs is 3, and the first IDs are 001, 002 and 003.
[0151] At the seventh moment, the status monitoring submodule obtained from the kernel that four VMs were running on the target server group. These four VMs were the first VM, the second VM, the third VM, and the fourth VM. Therefore, the number of second VMs was 4, and their second IDs were 001, 002, 003, and 004.
[0152] It is understood that the descriptions of obtaining the first number of VMs, the second number of VMs, the first ID, and the second ID here are only examples. In actual use, there may be situations where the number of VMs is the same but the VM IDs are different because a VM running on the target server group completes all tasks and a new VM is added to the target server group. In specific use, the settings should be combined with the specific application scenario, and no restrictions are made here.
[0153] 302. Determine whether the first number of VMs is the same as the second number of VMs, and whether the first ID is the same as the second ID;
[0154] After obtaining the first number of VMs, the second number of VMs, the first ID, and the second ID, determine whether the first number of VMs, the second number of VMs, the first ID, and the second ID satisfy the following conditions: the first number of VMs is the same as the second number of VMs, and the first ID is the same as the second ID.
[0155] If so, proceed to step 303;
[0156] If not, proceed to step 308.
[0157] 303. Obtain the third IPC, fourth IPC, fourth LLC, and fifth LLC;
[0158] When the number of first processes is the same as the number of second processes, and the first ID is the same as the second ID, the status monitoring submodule acquires the third IPC, the fourth LLC, and the fifth LLC. Specifically, the third IPC is the IPC of the second VM at the third time step, the fourth IPC is the IPC of the second VM at the fourth time step, the fourth LLC is the LLC of the second VM at the third time step, and the fifth LLC is the LLC of the second VM at the fourth time step. The ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio. The third time step is before the fourth time step and after the second time step. 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 indicates that the VMs on the target server group are running stably. The status monitoring submodule is then triggered to begin acquiring statistical information about 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. This allows for analysis of whether LLC resource optimization can be performed on the multiple VMs running on the target server group. Specifically, the statistical information about the VMs running on the target server group may include third and fourth IPCs. The specification information about the VMs running on the target server group may include fourth and fifth LLCs, but this is not limited here.
[0160] Furthermore, the statistical information of the VMs running on the target server group can also include the number of instructions executed on the target server group before and after the third time period, the number of instructions executed during the preset time period, and the number of instructions executed on the target server group before and after the fourth time period. Further, the number of cache accesses, the number of cache hits, the memory bandwidth utilization, and the real-time I / O bandwidth at the third time period can also be collected, without any limitations.
[0161] In some possible scenarios, the IPC of the second VM and the LLC of the second VM can be collected during the normal operation of the second VM, or when the LLC capacity of the second VM is adaptively adjusted; there are no restrictions here.
[0162] Furthermore, the status monitoring submodule can also store the third IPC, fourth IPC, fourth LLC, and fifth LLC in the information cache module, without any restrictions.
[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, fourth IPC, fourth LLC, and fifth LLC, determine whether the capacity of the fourth LLC is less than the capacity of the fifth LLC.
[0165] If so, proceed to step 305;
[0166] If not, proceed to step 301.
[0167] 305. Determine whether the difference between the fourth IPC and the third IPC is greater than the third threshold;
[0168] When the capacity of the fourth LLC is less than the capacity of the fifth LLC, determine whether the difference between the fourth IPC and the third IPC is greater than the third threshold.
[0169] Specifically, the third threshold here can be 5% of the fourth IPC, or the third threshold can also be 0.
[0170] In other words, if the IPC of the second VM increases with the increase of the LLC capacity of the second VM, then it can be considered that the IPC of the second VM is positively correlated with the LLC capacity of the second VM. The computing performance of the second VM can be improved by increasing the LLC capacity of the second VM, without any restrictions here.
[0171] If the IPC of the second VM does not change with the increase of the LLC capacity of the second VM, or even shows a negative increase, it means that the computing performance of the second VM cannot be improved by increasing the LLC capacity of the second VM.
[0172] It is understood that the specific value of the third threshold described here is only an example. In actual applications, it should be set according to the specific scenario, and no restrictions are imposed here.
[0173] If so, proceed to step 306;
[0174] If not, proceed to step 307.
[0175] 306. Generate the correspondence between the second VM and the sixth LLC;
[0176] When the capacity of the fourth LLC is less than that of the fifth LLC, and the difference between the fourth IPC and the third IPC is greater than the third threshold, the LLC allocation decision submodule generates a correspondence between the second VM and the sixth LLC. The sixth LLC carries a first identifier, which indicates that the LLC can be used by the second VM.
[0177] Furthermore, the LLC allocation decision submodule can also store the correspondence between the second VM and the sixth LLC in the information cache module, without any restrictions.
[0178] Specifically, when the sixth LLC does not have a corresponding VM, the second VM can directly occupy the sixth LLC.
[0179] However, if the sixth LLC is an LLC allocated to the third VM when generating the correspondence between the second VM and the sixth LLC, then the sixth LLC is an LLC resource shared by the second VM and the third VM.
[0180] For example, in a specific application scenario, when the resources of the sixth LLC are not fully utilized, the instructions of the second VM and the third VM can be executed sequentially according to the order in which the tasks of the second VM and the third VM are initiated.
[0181] When all the resources of the sixth LLC are used, and the second VM and the third VM initiate tasks at the same time, the data in the sixth LLC can be released according to the pre-set window duration, and then the tasks of the second VM and the third VM can be executed simultaneously.
[0182] It is understood that the specific use case description 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 release method in the sixth LLC is not limited by whether the resources in the sixth LLC are sufficient. The specific implementation should be set according to the specific application scenario, and no restrictions are imposed here.
[0183] 307. Generate the correspondence between the second VM and the second identifier;
[0184] 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 less 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 capacity of the corresponding LLC.
[0185] 308. Delete the correspondence between the first VM and the LLC corresponding to the first VM;
[0186] If at least one of the following conditions is met: the number of first VMs is different from the number of second VMs, and the first ID is different from the second ID, delete the correspondence between the first VM and the LLC corresponding to the first VM.
[0187] For example, after the status monitoring submodule obtains the first number of VMs, the first ID, the second number of VMs, and the second ID, it determines whether the first VMs and the second VMs are the same and whether the first ID and the second ID are the same. If at least one of the following is true: the first number of VMs is different from the second number of VMs, and the first ID and the second ID are different, the submodule deletes the correspondence between the first VM and the LLC corresponding to the first VM stored in the information cache submodule.
[0188] Specifically, if the target server group at time six is running the first VM, the second VM, and the third VM;
[0189] At the seventh moment, the target server group was running the first VM, the second VM, the third VM, and the fourth VM;
[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, clear the LLC resource allocation results for all VMs currently running on the target server group.
[0192] It is understandable that there is no explicit order between steps 308 and 309. The explanation here is only an example. In actual applications, the settings should be combined with the specific application scenario. No restrictions are imposed here.
[0193] 309. Obtain the specification information of the VMs running on the target server group;
[0194] When the relationship between the number of first processes, the number of second processes, the first ID, and the second ID does not satisfy the condition that the number of first processes and the number of second processes are the same, and the first ID and the second ID are the same, 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 memory capacity of the target server group, and the LLC capacity of the target server group, where the first capacity is the memory size of the first VM.
[0195] Specifically, the specification information acquisition submodule obtains the specification information of the VMs running on the target server group from the kernel, such as the computer core number corresponding to the VMs running on the target server group and the memory size corresponding to the VMs running on the target server group. There are no restrictions here.
[0196] Furthermore, the specification information acquisition submodule can also store the acquired specification information of the VMs running on the target server group into the information cache module, without any restrictions.
[0197] It is understood that the description of obtaining the specification information of the VM running on the target server group here is only an example. In actual applications, the specification information of the VM running on the target server group can 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 number of first computing cores refers to the number of computing cores of the first VM. The specific usage should be set according to the specific application scenario, and there are no restrictions here.
[0198] It is understandable that there is no explicit order between steps 308 and 309. The explanation here is only an example. In actual applications, the settings should be combined with the specific application scenario. No restrictions are imposed here.
[0199] 310. Generate the correspondence between the first VM and the first LLC based on the specification information of the VMs running on the target server group.
[0200] After obtaining the VM's specifications, a correspondence between the first VM and the first LLC is generated based on the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group. Here, the first capacity refers to the memory capacity of the first VM.
[0201] For example, firstly, a first ratio is obtained by calculating the ratio between the first capacity and the memory capacity of the target server group. Secondly, a third capacity is obtained by multiplying the capacity of the LLCs in the target server group by the first ratio. A first LLC is selected from the LLC resources of the target server group, and the capacity of the first LLC is the same as the third capacity, thus generating a correspondence between the first VM and the first LLC.
[0202] In practical 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, and will not be repeated here.
[0203] Understandably, when the specifications of the VM running on the target server group include the number of first computing cores, the number of computing cores in the target server group, and the capacity of the LLC in the target server group, a similar operation to step 310 is performed: first, the ratio of the number of first computing cores to the number of computing cores in the target server group is calculated; then, the product of the LLC capacity of the target server group and the ratio is calculated to obtain the LLC capacity; the first LLC with this LLC capacity is selected from the target server group as the LLC of the first VM, and a correspondence between the first VM and the first LLC is generated.
[0204] In this embodiment of the 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. This avoids the situation where, after adjusting the LLC resources of the VMs, the VMs with low LLC requirements are no longer running on the target server group, and new VMs have no LLC resources to allocate.
[0205] In this embodiment, by detecting the VMs running in the target server group, if 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 for the VMs running in the target server group is triggered. During the operation of the VMs in the target server group, the LLC resources of the VMs running in the target server group are dynamically adjusted, thereby improving the utilization efficiency of LLC resources of the VMs in the target server group and improving the performance of the VMs running in the target server group.
[0206] The foregoing Figure 2 and Figure 3 The paper describes the stages of releasing or sharing LLC resources of running virtual machine A and the stages of running virtual machine B occupying or sharing LLC resources of virtual machine A. It should be noted that... Figure 2 and Figure 3 In this embodiment, the release and sharing of LLC resources of running virtual machine A, as well as the situation where running virtual machine B occupies or shares LLC resources of virtual machine A, can be implemented in the same embodiment, and there is no limitation here.
[0207] In addition, Figure 2 The triggering condition of step 201 can be related to Figure 3 The triggering conditions for step 303 are the same: 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 Middle step 201 and Figure 3 The triggering condition in step 303 can also be used to periodically check the target server group.
[0209] In one possible scenario, Figure 2 Middle step 201 and Figure 3 The triggering condition for step 303 can also be triggered by the target server group obtaining a VM creation request; there are no restrictions here.
[0210] Finally, the operations performed during the startup phase of the target server group are described with reference to the accompanying diagram. Please refer to [link / reference]. Figure 4 , Figure 4 This is another schematic diagram illustrating the resource allocation method provided in the embodiments of this application.
[0211] 401. Obtain the first VM creation request and the second VM creation request;
[0212] During the initial startup phase of the target server group, the target server receives a first VM creation request and a second VM creation request. 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 there is no explicit restriction on the order in which the first VM creation request and the second VM creation request are obtained. This explanation will only take the simultaneous acquisition of the first VM creation request and the second VM creation request as an example.
[0214] 402. Create the correspondence between the first VM and the first LLC;
[0215] After receiving the first VM creation request, a correspondence is created between the first VM and the first LLC based on 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 in the target server group.
[0216] That is, after receiving 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 is understood that the description of the method for creating the correspondence between the first VM and the first LLC here is only an example. In actual applications, it should be set according to the specific application scenario. No restrictions are imposed here.
[0218] It should be noted that there is no explicit order between steps 402 and 403. The description in this embodiment is only an example. In actual applications, the settings should be combined with the specific application scenario. No restrictions are imposed here.
[0219] 403. Create the correspondence between the second VM and the second LLC.
[0220] After receiving the second VM creation request, a correspondence is created between the second VM and the second LLC based on the second VM creation request. 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 in the target server group.
[0221] That is, after receiving 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 is understood that the description of the method for creating the correspondence between the first VM and the first LLC here is only an example. In actual applications, it should be set according to the specific application scenario. No restrictions are imposed here.
[0223] It should be noted that there is no explicit order between steps 402 and 403. The description in this embodiment is only an example. In actual application, it should be set according to the specific application scenario. No restrictions are imposed here.
[0224] In this embodiment, during the initial startup phase of the target server group, when creating a VM, the ratio of the memory capacity required to create the VM to the memory capacity that the target server group can provide is used to determine the ratio of the LLC capacity corresponding to the VM to the LLC capacity that the target server group can provide. This allows for the acquisition of the LLC capacity corresponding to the VM and the allocation of LLCs to the VM. This avoids the situation where there is insufficient data to support LLC allocation for the VM during the target server group startup phase, thus improving the execution efficiency of the solution.
[0225] It should be noted that allocating resources to all VMs planned to run on the target server group can occur not only during the initial startup phase of the target server group, but also when a large number of VM creation requests suddenly surge. For example, if more than five VM creation requests suddenly arrive within ten minutes, and three VMs are already running on the target server group, the target server group will clear the resource allocation for those three VMs and allocate resources uniformly to all eight VMs planned to run on the target server group, using the same resource allocation method as described above. Figure 4 Similar to what was described earlier, it will not be repeated here.
[0226] It is understood that the description of allocating resources for all VMs planned to run on the target server group is only an example. In actual applications, the settings should be adjusted according to the specific application scenario. No restrictions are imposed here.
[0227] The resource allocation method proposed in this application has been described above. The resource allocation apparatus provided in this application will now be described in conjunction with the accompanying drawings. Please refer to the drawings. Figure 5 , Figure 5 Another schematic diagram of the resource allocation apparatus provided in the embodiments of this application.
[0228] A resource allocation device 50, comprising:
[0229] The status monitoring submodule 501 is used to obtain the first instruction per clock cycle (IPC), the second IPC, the first lowest level 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 is running on the target server group.
[0230] The performance and demand analysis submodule 502 is used to generate a correspondence between a third LLC and a first identifier 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. 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 other than the first VM. The first LLC is composed of the third LLC and the second LLC.
[0231] Optionally, the status monitoring submodule 501 is also used to acquire the third IPC, the fourth IPC, the fourth LLC, and the fifth LLC. The third IPC is the IPC of the second VM at the third time, the fourth IPC is the IPC of the second VM at the fourth time, the fourth LLC is the LLC of the second VM at the third time, and the fifth LLC is the LLC of the second VM at the fourth time. The ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio. The third time is before the fourth time and after the second time.
[0232] The device also includes:
[0233] 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 the third threshold. The sixth LLC carries the first identifier.
[0234] Optionally, the status monitoring submodule 501 is also used to obtain the first number of VMs running on the target server group and the first ID of the VMs running on the target server group at the sixth time.
[0235] The status monitoring submodule 501 is also used to obtain the number of second VMs running on the target server group at the seventh time and the second ID of the VMs running on the target server group, before the sixth and seventh times.
[0236] The status monitoring submodule 501 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 and the second ID are the same.
[0237] Optionally, the first VM runs on the target server group at time seven;
[0238] LLC allocation decision submodule 503 is also used for:
[0239] If at least one of the following is true: the number of first VMs is different from the number of second VMs, and the first ID is different from the second ID, delete the correspondence between the first VM and the LLC corresponding to the first VM.
[0240] Obtain the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group. The first capacity is the memory size of the first VM.
[0241] Based on the first capacity, the memory capacity of the target server group, and the capacity of the LLC of the target server group, generate the correspondence between the first VM and the first LLC.
[0242] Optional, the status monitoring submodule 501 is specifically used for:
[0243] Acquire the first IPC and the first LLC at the first moment;
[0244] The third LLC is removed from the first LLC to obtain the second LLC. The ratio of the capacity of the third LLC to the capacity of the first LLC is a first preset value.
[0245] Acquire the second IPC at the second time point.
[0246] Optionally, the device also includes:
[0247] The request to obtain submodule 504 is used to obtain a first VM creation request and a second VM creation request. 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 is specifically used to create the correspondence 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 in the target server group.
[0249] LLC allocation decision submodule 503 is specifically used to create the 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 in the target server group.
[0250] Optionally, the device also includes an information caching submodule 505, used to delete the first IPC, the second IPC, the first LLC and the second LLC at the fifth time point. The fifth time point is after the second time point, and the duration from the second time point to the fifth time point is equal to a preset duration.
[0251] Optionally, the device also includes:
[0252] 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 the third threshold. 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 operation of the resource allocation device described herein are only one possible scenario. In practical applications, functional modules should be set up to implement specific steps and functions in combination with specific application scenarios. No restrictions are imposed here.
[0254] Please see Figure 6 , Figure 6 Another schematic diagram of the resource allocation apparatus provided in the embodiments of this application.
[0255] The data analysis apparatus 600 includes a bus 602, a processor 604, a memory 606, and a communication interface 608. The processor 604, memory 606, and communication interface 608 communicate via the bus 602. The resource allocation apparatus 900 can be a server or a terminal device. It should be understood that this application does not limit the number of processors 604 and memory 606 in the resource allocation apparatus 600.
[0256] Bus 602 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus 602 may be represented by a single line, but this 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 (e.g., memory 606, processor 604, communication interface 608).
[0257] Processor 604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0258] Memory 606 may include volatile memory, such as random access memory (RAM). Processor 604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0259] The memory 606 stores executable program code, which the processor 604 executes to implement the functions of the aforementioned status monitoring submodule 501, performance and demand analysis submodule 502, LLC allocation decision submodule 503, request retrieval submodule 504, information caching 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 code, which the processor 604 executes to implement the functions of the aforementioned access points, thereby implementing any one of the methods in the data storage method. That is, the memory 606 stores instructions for executing any one of the methods in the data storage method.
[0261] The communication interface 608 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the resource allocation device 600 and other devices or communication networks.
[0262] Please see Figure 7 , Figure 7 This is a schematic diagram of a computing device cluster provided in an embodiment of this application.
[0263] The computing device cluster includes at least one resource allocation device. This 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 smartphone.
[0264] like Figure 7 As shown, the computing device cluster includes at least one resource allocation device 600. The memory 606 of one or more resource allocation devices 600 in the computing device cluster may store the same instructions for performing any of the methods of resource allocation.
[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 methods in the resource allocation method. In other words, a combination of one or more resource allocation devices 600 can jointly execute instructions for executing any one of the methods in the data storage method.
[0266] It should be noted that the memory 606 in the different resource allocation devices 600 within the computing device cluster can store different instructions, each used to execute a portion of the cloud management platform's functions. That is, the instructions stored in the memory 606 of the different resource allocation devices 600 can implement the functions of one or more units among the status monitoring submodule 501, performance and demand analysis submodule 502, LLC allocation decision submodule 503, request retrieval submodule 504, information caching submodule 505, and LLC capacity analysis submodule 506.
[0267] In some possible implementations, one or more resource-allocated devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN), a local area network (LAN), or similar.
[0268] Please see Figure 8 , Figure 8 This is a schematic diagram of another structure of the computing device cluster provided in an embodiment of this application.
[0269] like Figure 8As shown, the two resource allocation devices 600A and 600B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 606 of the resource allocation device 600A stores instructions for the functions of the execution status monitoring submodule 501, performance and demand analysis submodule 502, and LLC allocation decision submodule 503. Meanwhile, the memory 606 of the resource allocation device 600B stores instructions for the functions of the request acquisition submodule 504, information caching submodule 505, and LLC capacity analysis submodule 506.
[0270] It should be understood that Figure 8 The functions of the resource allocation device 800A shown can also be performed by multiple resource allocation devices 600. Similarly, the functions of the resource allocation device 600B can also be performed by multiple resource allocation devices 600.
[0271] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 7 and Figure 8 The connection method of the computing device cluster. The difference is that the memory 606 in one or more resource allocation devices 600 in the computing device cluster can store the same instructions for executing any of the methods of 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 one of the methods in the data storage method. In other words, a combination of one or more resource allocation devices 600 can jointly execute instructions for executing any one of the methods in the data storage method.
[0273] It should be noted that the memory 606 in the different resource allocation devices 600 in the computing device cluster can store different instructions for executing some functions of the resource allocation devices.
[0274] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0275] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0276] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0277] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0278] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for resource allocation, characterized in that, include: Obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC includes: obtaining the first IPC and the first LLC at a first moment; removing 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; obtaining the second IPC at a second moment, 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, wherein the first moment is before the second moment, and the first VM is running on 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 in the target server group other than the first VM. 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 includes: Acquire 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 time, the fourth IPC is the IPC of the second VM at a fourth time, the fourth LLC is the LLC of the second VM at the third time, and the fifth LLC is the LLC of the second VM at the fourth time. The ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio. The third time is before the fourth time and after the second time. 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 the third threshold, a correspondence is generated between the second VM and the sixth LLC, and the sixth LLC carries the first identifier.
3. The method according to claim 1 or 2, characterized in that, Before obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC, the method further includes: Obtain the number of first VMs running on the target server group at the sixth time point and the first ID of the VMs running on the target server group; Obtain the number of second VMs running on the target server group at the seventh time point and the second ID of the VMs running on the target server group, wherein the sixth time point and the seventh time point are prior to the first time point; The process of obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level 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 and the second ID are the same, obtain the first IPC, the second IPC, the LLC, and the second LLC.
4. The method according to claim 3, characterized in that, The first VM is running in the target server group at the seventh time. The method further includes: If at least one of the following is true: 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, delete the correspondence between the first VM and the LLC corresponding to the first VM; Obtain 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 size of the first VM; Based on the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group, a correspondence between the first VM and the first LLC is generated.
5. The method according to any one of claims 1 to 2, characterized in that, Before obtaining the first instruction per clock cycle (IPC), the second IPC, the first lowest-level cache LLC, and the second LLC, the method further includes: Obtain 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; Create a correspondence between the first VM and the first LLC, 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 in the target server group; Create a correspondence between the second VM and the second LLC, where 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 in the target server group.
6. The method according to any one of claims 1 to 2, characterized in that, The method further includes: The first IPC, the second IPC, the first LLC, and the second LLC are deleted at the fifth time point. The fifth time point is after the second time point, and the duration from the second time point to the fifth time point is equal to a preset duration.
7. The method according to claim 2, characterized in that, The method further includes: 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 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.
8. A resource allocation device, characterized in that, include: The status monitoring submodule is used to obtain the first instruction per clock cycle (IPC), the second IPC, the first lowest level 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. The first moment is before the second moment, and the first VM is running on the target server group. The status monitoring submodule is specifically configured to: acquire the first IPC and the first LLC at the first moment; 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; and acquire the second IPC at the second moment. The performance and demand analysis submodule is used to generate a correspondence between a third LLC and a first identifier 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. The first identifier indicates that the LLC can be used by a second VM, and the second VM is any VM running on the target server group other than the first VM. The first LLC is composed of the third LLC and the second LLC.
9. The apparatus according to claim 8, characterized in that, The status monitoring submodule is further configured to acquire 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 time, the fourth IPC is the IPC of the second VM at a fourth time, the fourth LLC is the LLC of the second VM at the third time, and the fifth LLC is the LLC of the second VM at the fourth time. The ratio of the capacity of the third LLC to the capacity of the fourth LLC is a preset ratio. The third time is before the fourth time and after the second time. The device further 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. The sixth LLC carries the first identifier.
10. The apparatus according to claim 9, characterized in that, The status monitoring submodule is also used to obtain the number of first VMs running on the target server group and the first ID of the VMs running on the target server group at the sixth time. The status monitoring submodule is also 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 time, wherein the sixth time and the seventh time are before the first time; 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 and the second ID are the same.
11. The apparatus according to claim 10, characterized in that, The first VM is running in the target server group at the seventh time. The LLC allocation decision submodule is also used for: If at least one of the following is true: 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, delete the correspondence between the first VM and the LLC corresponding to the first VM; Obtain 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 size of the first VM; Based on the first capacity, the memory capacity of the target server group, and the LLC capacity of the target server group, a correspondence between the first VM and the first LLC is generated.
12. The apparatus according to any one of claims 8 to 11, characterized in that, The device further includes: The request acquisition submodule is used to acquire a first VM creation request and a second VM creation request. 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 used to create a correspondence between the first VM and the first LLC, 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 in the target server group. The LLC allocation decision submodule is specifically used to create a correspondence between the second VM and the second LLC, 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 in the target server group.
13. The apparatus according to any one of claims 8 to 11, characterized in that, The device further includes an information caching module for deleting the first IPC, the second IPC, the first LLC, and the second LLC at a fifth time point, wherein the fifth time point is after the second time point, and the duration from the second time point to the fifth time point is equal to a preset duration.
14. The apparatus according to claim 9, characterized in that, The device further 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. The second identifier indicates that the VM does not need to increase the corresponding LLC capacity.
15. A resource allocation device, characterized in that, It includes a processor and a memory, the memory being used to store instructions, the processor being used to execute the instructions, and when the processor executes the instructions, it performs the method as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that, Includes a program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 7.
17. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and 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 to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Task processing method and device, equipment and storage medium
CN117667324A
Method and apparatus for processing task, and device and storage medium
WO2024041401A1