CN-116048727-B - Memory balloon driving method, device, equipment and storage medium
Abstract
The application relates to a memory balloon driving method, a device, equipment and a storage medium, in particular to the technical field of cloud computing. The method comprises the steps of periodically reading the current node memory utilization rate of a physical machine, determining a memory management strategy corresponding to a section range according to the section range of the node memory utilization rate, and executing management operation on a virtual machine on the physical machine according to the memory management strategy to adjust and optimize the node memory utilization rate of the physical machine, wherein the management operation comprises at least one of memory management operation, frequency management operation, on-off machine management operation and thermal migration management operation. Based on the technical scheme, the node memory utilization rate of the physical machine can be adjusted and optimized to a reasonable value, and normal operation of the cluster is ensured.
Inventors
- Request for anonymity
- Request for anonymity
Assignees
- 安超云软件有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230106
Claims (11)
- 1. A memory balloon driving method, the method comprising: Periodically reading the current node memory utilization rate of the physical machine; determining a memory management strategy corresponding to a section range according to the section range of the node memory utilization rate; according to the memory management strategy, executing management operation on the virtual machine on the physical machine so as to adjust and optimize the node memory utilization rate of the physical machine; The management operation comprises at least one of memory management operation, frequency management operation, power on/off management operation and thermal migration management operation; The memory management policy includes a first memory management policy corresponding to a first interval range, where the first interval range is a range lower than a first proportional threshold, and the executing management operation on the virtual machine on the physical machine according to the memory management policy includes: According to the first memory management strategy, inquiring whether a first type virtual machine with recovered memory exists on the physical machine or not, and inquiring whether a second type virtual machine with reduced frequency exists on the physical machine or not; under the condition that the physical machine is provided with the first type virtual machine, inquiring the time of last memory release to the current distance duration, and under the condition that the distance duration is longer than a duration threshold value, executing memory release on the first type virtual machine; and under the condition that the second type virtual machine exists on the physical machine, executing the recovery main frequency on the second type virtual machine.
- 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The memory management operation comprises memory reclamation, and the virtual machine is correspondingly provided with a memory reclamation switch, wherein the memory reclamation switch is used for representing whether the virtual machine supports executing memory reclamation on the virtual machine or not.
- 3. The method of claim 1, wherein the memory management policy includes a second memory management policy corresponding to a second span range, the second span range being a range above the first proportional threshold and below the second proportional threshold; the executing management operation on the virtual machine on the physical machine according to the memory management policy includes: Inquiring whether the physical machine has the down-converted second type virtual machine or not according to the second memory management strategy; and under the condition that the second type virtual machine exists on the physical machine, executing the recovery main frequency on the second type virtual machine.
- 4. The method of claim 2, wherein the memory management policy includes a third memory management policy corresponding to a third span range, the third span range being a range above the second proportional threshold and below a third proportional threshold; the executing management operation on the virtual machine on the physical machine according to the memory management policy includes: according to the third memory management strategy, inquiring whether the memory reclamation switch is in an on state or not on the physical machine, and inquiring whether the physical machine has a second type of virtual machine after the memory reclamation is performed; under the condition that the third type virtual machine exists on the physical machine, performing first-gear memory reclamation on the third type virtual machine according to the reclamation proportion configured by the second proportion threshold; and under the condition that the second type virtual machine exists on the physical machine, executing the recovery main frequency on the second type virtual machine.
- 5. The method of claim 2, wherein the memory management policy includes a fourth memory management policy corresponding to a fourth span range, the fourth span range being a range above a third proportional threshold and below a fourth proportional threshold; the executing management operation on the virtual machine on the physical machine according to the memory management policy includes: Inquiring whether the memory reclamation switch is in an open state or not on the physical machine according to the fourth memory management strategy, and performing first-grade reclamation on a fourth type virtual machine which is not subjected to memory reclamation or is subjected to first-grade reclamation according to the reclamation proportion configured by the second proportion threshold; And under the condition that the fourth type virtual machine exists on the physical machine, performing second-gear memory reclamation on the fourth type virtual machine according to the reclamation proportion configured by the third proportion threshold.
- 6. The method of claim 2, wherein the memory management policies include a fifth memory management policy corresponding to a fifth span range, the fifth span range being a range above a fourth proportional threshold; the executing management operation on the virtual machine on the physical machine according to the memory management policy includes: inquiring whether the memory reclamation switch is in an open state or not on the physical machine according to the fifth memory management strategy, and performing first-grade reclamation on a fourth-type virtual machine which is not subjected to memory reclamation or is subjected to first-grade reclamation according to the reclamation proportion configured by the second proportion threshold; Under the condition that the physical machine is provided with the fourth-type virtual machine, performing second-gear memory recovery on the fourth-type virtual machine according to a recovery ratio configured by a third ratio threshold; and after the second-gear memory is recycled, under the condition that the node memory utilization rate still belongs to the fifth interval range, sequentially performing hot migration, frequency reduction and shutdown on the virtual machine on the physical machine until the node memory utilization rate is lower than the fourth proportion threshold value.
- 7. The method of claim 6, wherein sequentially performing the thermo-migration, the frequency-down, and the shutdown on the virtual machine until the node memory utilization is lower than the fourth ratio threshold comprises: calculating the total memory usage y of the virtual machine which exceeds the memory x and supports the thermal migration, wherein x is equal to the memory usage corresponding to the part of the node memory utilization exceeding the fourth proportion threshold; Under the condition that x is smaller than y, sequentially executing the thermal migration on the virtual machines supporting the thermal migration according to the memory usage amount, and simultaneously executing the frequency reduction on the virtual machines running on the physical machines until the node memory utilization rate is lower than the fourth proportion threshold value; And after the frequency reduction is finished, if the node memory utilization rate still belongs to the fifth interval range, executing shutdown on part of virtual machines in operation on the physical machine until the node memory utilization rate is lower than the fourth proportional threshold.
- 8. The method of claim 1, wherein the virtual machine corresponds to a memory protection switch, the memory protection switch being configured to characterize whether the virtual machine is protected; the method further comprises the steps of: when the memory overflows, the normal operation of the virtual machine with the memory protection switch in an on state is guaranteed, and the virtual machine with the memory protection switch in an off state is closed.
- 9. A memory balloon driving device, the device comprising: The memory utilization rate reading module is used for periodically reading the current node memory utilization rate of the physical machine; the memory management policy determining module is used for determining a memory management policy corresponding to a section range according to the section range of the node memory utilization rate; the memory management policy execution module is used for executing management operation on the virtual machine on the physical machine according to the memory management policy so as to adjust and optimize the node memory utilization rate of the physical machine; The management operation comprises at least one of memory management operation, frequency management operation, power on/off management operation and thermal migration management operation; the memory management policy includes a first memory management policy corresponding to a first interval range, where the first interval range is a range below a first proportional threshold, and the memory management policy execution module is configured to: According to the first memory management strategy, inquiring whether a first type virtual machine with recovered memory exists on the physical machine or not, and inquiring whether a second type virtual machine with reduced frequency exists on the physical machine or not; under the condition that the physical machine is provided with the first type virtual machine, inquiring the time of last memory release to the current distance duration, and under the condition that the distance duration is longer than a duration threshold value, executing memory release on the first type virtual machine; and under the condition that the second type virtual machine exists on the physical machine, executing the recovery main frequency on the second type virtual machine.
- 10. A computer device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set, or instruction set, and wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the memory balloon driving method of any one of claims 1 to 8.
- 11. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, loaded and executed by a processor to implement the memory balloon driving method of any one of claims 1 to 8.
Description
Memory balloon driving method, device, equipment and storage medium Technical Field The application relates to the technical field of cloud computing, in particular to a memory balloon driving method, a device, equipment and a storage medium. Background In the running process of the virtual machine, the virtual machine needs to occupy the memory of the physical machine. Generally, a virtual machine occupies a large amount Of Memory Of a physical host, and if the Memory Of the physical machine is used up under the condition Of sudden increase Of the cluster Memory, an Out Of Memory (OOM) phenomenon occurs, which causes the oom_ killer to randomly kill an indefinite number Of virtual machines in the cluster, thereby affecting normal service provision Of the virtual machines. Therefore, there is a need to provide a technical solution for effectively controlling the memory utilization of a physical machine. Disclosure of Invention The application provides a memory balloon driving method, a device, equipment and a storage medium. The technical scheme is as follows. In one aspect, a method for driving a memory balloon is provided, where the method includes: Periodically reading the current node memory utilization rate of the physical machine; determining a memory management strategy corresponding to a section range according to the section range of the node memory utilization rate; according to the memory management strategy, executing management operation on the virtual machine on the physical machine so as to adjust and optimize the node memory utilization rate of the physical machine; the management operation comprises at least one of memory management operation, frequency management operation, startup and shutdown management operation and thermal migration management operation. In yet another aspect, there is provided an in-memory balloon driving apparatus, the apparatus comprising: The memory utilization rate reading module is used for periodically reading the current node memory utilization rate of the physical machine; the memory management policy determining module is used for determining a memory management policy corresponding to a section range according to the section range of the node memory utilization rate; the memory management policy execution module is used for executing management operation on the virtual machine on the physical machine according to the memory management policy so as to adjust and optimize the node memory utilization rate of the physical machine; the management operation comprises at least one of memory management operation, frequency management operation, startup and shutdown management operation and thermal migration management operation. In yet another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and where the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the memory balloon driving method described above. In yet another aspect, a computer readable storage medium is provided, where at least one instruction, at least one program, a code set, or an instruction set is stored, where the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the memory balloon driving method described above. In yet another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the memory balloon driving method described above. The technical scheme provided by the application can comprise the following beneficial effects: The node memory utilization rate of the physical machine is periodically read, the memory management strategy matched with the node memory utilization rate is determined through the interval range of the node memory utilization rate, and management operation is executed on the virtual machine on the physical machine according to the memory management strategy, so that the node memory utilization rate of the physical machine is adjusted and optimized to a reasonable value through the execution of the management operation, and normal operation of the cluster is ensured. Drawings In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawi