Search

CN-122019060-A - Virtual machine memory adjustment method, virtual machine memory adjustment device, computer equipment, storage medium and computer program product

CN122019060ACN 122019060 ACN122019060 ACN 122019060ACN-122019060-A

Abstract

The application provides a virtual machine memory adjustment method, a device, computer equipment, a storage medium and a computer program product, wherein the method comprises the steps of obtaining first data related to a first virtual machine, predicting second data based on the first data, wherein the second data represents the performance degradation degree of the first virtual machine, determining a second virtual machine and a third virtual machine from a plurality of virtual machines according to the second data, wherein the second virtual machine comprises M virtual machines with the largest performance degradation degree, the third virtual machine comprises N virtual machines with the smallest performance degradation degree, exchanging and storing first memory data corresponding to a first page of the second virtual machine in a remote CXL memory and second memory data corresponding to a second page of the third virtual machine in a local memory, so as to improve the local memory data duty ratio of target memory data corresponding to the second virtual machine, and/or reduce the CXL memory data duty ratio of the target memory data. The application can improve the performance of the virtual machine.

Inventors

  • ZHOU ZEHAO
  • WANG SHANLONG
  • JIA YU
  • QIAN LING

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260413

Claims (10)

  1. 1. The method for adjusting the virtual machine memory is characterized by comprising the following steps: acquiring first data related to a first virtual machine, wherein the first virtual machine is any virtual machine in a plurality of virtual machines borne by a host, and the first data comprises one or more index parameters related to hardware execution behaviors; Predicting second data of the first virtual machine based on the first data, the second data representing a degree of performance degradation of the first virtual machine; Determining a second virtual machine and a third virtual machine from the plurality of virtual machines according to second data of each first virtual machine, wherein the second virtual machine comprises M virtual machines with the largest performance degradation degree, the third virtual machine comprises N virtual machines with the smallest performance degradation degree, M is an integer greater than or equal to 1, and N is an integer greater than or equal to 1; And exchanging and storing first memory data corresponding to a first page of the remote open type rapid interconnection CXL memory of the second virtual machine with second memory data corresponding to a second page of the third virtual machine in the local memory so as to improve the proportion of the local memory data in target memory data corresponding to the second virtual machine and/or reduce the proportion of the CXL memory data in the target memory data, wherein the first page is a part of pages in the pages corresponding to the remote CXL memory, and the second page is a part of pages in the pages corresponding to the local memory.
  2. 2. The method of claim 1, wherein exchanging and storing the first memory data corresponding to the first page in the remote open fast interconnect CXL memory for the second virtual machine and the second memory data corresponding to the second page in the local memory for the third virtual machine comprises: Determining first information related to a first page and determining second information related to a second page; The first memory data is obtained from the remote CXL memory based on the first information and written into a local memory, and the second memory data is obtained from the local memory based on the second information and written into the remote CXL memory.
  3. 3. The method of claim 2, wherein the first information includes a first address range corresponding to the first page, the second information includes a second address range corresponding to the second page, the obtaining the first memory data from the remote CXL memory and writing the first memory data into a local memory based on the first information, and obtaining the second memory data from a local memory and writing the second memory data into the remote CXL memory based on the second information includes: Establishing a mapping relation between the first information and the second information; The first memory data is obtained from the remote CXL memory based on the first information, the first memory data is written into a local memory corresponding to the second address range according to the mapping relation, the second memory data is obtained from the local memory based on the second information, and the second memory data is written into the remote CXL memory corresponding to the first address range according to the mapping relation; And replacing a second address range corresponding to the local memory in the third virtual machine with the first address range, and replacing a first address range corresponding to the remote CXL memory in the second virtual machine with the second address range.
  4. 4. A method according to claim 3, wherein said obtaining the first memory data from the remote CXL memory based on the first information, writing the first memory data into a local memory corresponding to the second address range according to the mapping relationship, and obtaining the second memory data from the local memory based on the second information, writing the second memory data into the remote CXL memory corresponding to the first address range according to the mapping relationship, comprises: Acquiring the second memory data from the local memory based on the second information, and caching the second memory data; Acquiring the first memory data from the remote CXL memory based on the first information, and writing the first memory data into a local memory corresponding to the second address range according to the mapping relation so as to cover the second memory data corresponding to the third virtual machine in the local memory; and writing the second memory data into the remote CXL memory corresponding to the first address range according to the mapping relation so as to cover the first memory data in the remote CXL memory corresponding to the second virtual machine.
  5. 5. The method of any of claims 1 to 4, wherein predicting second data of the first virtual machine based on the first data comprises: And processing the first data by using a first model to obtain second data corresponding to the first virtual machine, wherein the first model is obtained by training by using training data in advance.
  6. 6. The method of claim 5, wherein the method further comprises: Obtaining training data, wherein the training data comprises first training data and second training data associated with the first training data, the first training data represents the working performance of virtual machines, and the second training data comprises one or more index parameters related to hardware execution behaviors; Training a first model to be trained based on the first training data and the second training data to adjust model parameters of the first model until a trained first model is obtained.
  7. 7. The method of claim 6, wherein the obtaining training data comprises: Executing one or more first work tasks for multiple times by using a fourth virtual machine, and obtaining the completion time of executing the first work tasks each time by the fourth virtual machine, wherein the fourth virtual machine is any virtual machine in the multiple virtual machines; Determining a performance description parameter of a fourth virtual machine based on a first completion time, a second completion time and the number of first work tasks, wherein the first completion time represents the time length of the fourth virtual machine currently completing the first work tasks, and the second completion time represents the time length of the fourth virtual machine last completing the first work tasks; And taking the performance description parameter representing performance degradation as first training data corresponding to the fourth virtual machine.
  8. 8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 7 when the program is executed by the processor.
  9. 9. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method according to any of claims 1 to 7.

Description

Virtual machine memory adjustment method, virtual machine memory adjustment device, computer equipment, storage medium and computer program product Technical Field The present application relates to computer technology, and in particular, to a virtual machine memory adjustment method, apparatus, computer device, storage medium, and computer program product. Background The data center introduces a heterogeneous computing architecture aiming at the problem of explosive growth of data to improve the processing efficiency, adopts an open type quick interconnection (CXL, compute Express Link) technology with low delay, high bandwidth and cross-equipment characteristics, constructs a remote CXL memory pool to fuse local memory resources of a host of the data center, realizes the expansion of virtual machine memory carried by the host, and provides performance support for various computing tasks at the same time, so that the virtual machine can execute different deployed task loads through a mixed mode of the local memory and the constructed remote CXL memory. Therefore, the ratio of the local memory to the remote CXL memory in the virtual machine memory is critical to the virtual machine performance, the resource waste can be caused by the too high local memory, the virtual machine performance can be reduced due to the too low local memory, and the flexible adjustment of the local memory ratio has important significance on the virtual machine performance in heterogeneous scenes. Disclosure of Invention The embodiment of the invention provides a virtual machine memory adjusting method, a virtual machine memory adjusting device, computer equipment, a storage medium and a computer program product, which can improve the performance of a virtual machine. The technical scheme of the embodiment of the invention is realized as follows: The embodiment of the invention provides a virtual machine memory adjustment method, which comprises the following steps: acquiring first data related to a first virtual machine, wherein the first virtual machine is any virtual machine in a plurality of virtual machines borne by a host, and the first data comprises one or more index parameters related to hardware execution behaviors; Predicting second data of the first virtual machine based on the first data, the second data representing a degree of performance degradation of the first virtual machine; Determining a second virtual machine and a third virtual machine from the plurality of virtual machines according to second data of each first virtual machine, wherein the second virtual machine comprises M virtual machines with the largest performance degradation degree, the third virtual machine comprises N virtual machines with the smallest performance degradation degree, M is an integer greater than or equal to 1, and N is an integer greater than or equal to 1; And exchanging and storing first memory data corresponding to a first page of the remote open type rapid interconnection CXL memory of the second virtual machine with second memory data corresponding to a second page of the third virtual machine in the local memory so as to improve the proportion of the local memory data in target memory data corresponding to the second virtual machine and/or reduce the proportion of the CXL memory data in the target memory data, wherein the first page is a part of pages in the pages corresponding to the remote CXL memory, and the second page is a part of pages in the pages corresponding to the local memory. In the above scheme, the exchanging and storing the first memory data corresponding to the first page of the remote open rapid interconnection CXL memory of the second virtual machine and the second memory data corresponding to the second page of the third virtual machine in the local memory includes determining first information related to the first page and determining second information related to the second page, obtaining the first memory data from the remote CXL memory based on the first information and writing the first memory data into the local memory, and obtaining the second memory data from the local memory based on the second information and writing the second memory data into the remote CXL memory. In the scheme, the second information comprises a second address range corresponding to the second page, the first memory data is obtained from the remote CXL memory based on the first information and written into a local memory, the second memory data is obtained from the local memory based on the second information and written into the remote CXL memory, the method comprises the steps of establishing a mapping relation between the first information and the second information, obtaining the first memory data from the remote CXL memory based on the first information, writing the first memory data into the local memory corresponding to the second address range according to the mapping relation, obtaining the second memory data from the