Memory adjustment method and device, computer program product and electronic device
By predicting memory requirements and performance monitoring of virtual machines and dynamically adjusting their memory usage, the problem of improper allocation of virtual machine memory resources is solved, memory utilization and system performance are improved, and resource waste is avoided.
Patent Information
- Application Number
- CN202410764669.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-13
AI Technical Summary
There is a problem of improper memory space allocation in the data center, which results in low memory resource utilization of virtual machines and affects system performance. In addition, existing technology relies on manual allocation, resulting in resource waste and low efficiency.
By predicting the memory demand of the target virtual machine, based on historical data and performance monitoring, it dynamically adjusts the proportion of local memory and CXL memory in its memory usage data to achieve dynamic adjustment of memory and improve memory utilization and efficiency.
It effectively avoids resource waste, improves the memory utilization and efficiency of virtual machines, meets the actual memory requirements of virtual machines, and improves system performance.
Smart Images

Figure CN118331688B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a memory adjustment method, a memory adjustment device, a computer program product, and an electronic device. Background Art
[0002] The explosive growth of data has prompted the computing industry to initiate a groundbreaking architectural shift that fundamentally changes the performance, efficiency, and cost of data centers. To continue to improve performance, servers are increasingly turning to heterogeneous computing architectures. Data centers have serious memory problems. The number of cores has grown rapidly, but the memory bandwidth and capacity of each core have not increased accordingly. On the contrary, memory bandwidth has decreased. This trend continues, and in cloud computing scenarios, the performance and utilization of virtual machines are critical. However, the memory resources allocated to virtual machines often have problems with small memory space allocation, which affects system performance, and too large memory space allocation, which leads to low memory resource utilization.
[0003] Therefore, an effective solution for memory adjustment of virtual machines is urgently needed.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a memory adjustment method and device, a computer program product and an electronic device, thereby improving memory utilization and usage efficiency at least to a certain extent.
[0006] According to one aspect of the present disclosure, a memory adjustment method is provided, comprising: in response to a request to create a target virtual machine, predicting the memory demand of the target virtual machine, and creating the target virtual machine according to the prediction result; wherein the prediction result at least includes target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data; monitoring the performance information of the target virtual machine, and if the performance information meets a preset trigger condition, adjusting the memory of the target virtual machine according to the performance information and the prediction result.
[0007] In an exemplary embodiment of the present disclosure, in response to a request to create a target virtual machine, memory demand prediction is performed on the target virtual machine, including: obtaining historical virtual machine memory usage information, the historical virtual machine memory usage information including historical memory usage data, the proportion of local memory in the historical memory usage data, and the proportion of the historical memory usage data in the calculation high-speed link CXL; based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information, memory demand prediction is performed on the target virtual machine to obtain the prediction result.
[0008] In an exemplary embodiment of the present disclosure, the memory demand prediction of the target virtual machine is performed based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information to obtain the prediction result, including: determining the category of the target virtual machine according to the target virtual machine information; based on the historical virtual machine memory usage information corresponding to the category, predicting the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target memory usage data in the target CXL memory.
[0009] In an exemplary embodiment of the present disclosure, the monitoring of the performance information of the target virtual machine includes: monitoring the memory performance information and operation performance information of the target virtual machine; wherein the memory performance information includes at least the local memory usage and CXL memory usage of the target virtual machine.
[0010] In an exemplary embodiment of the present disclosure, if the performance information meets a preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result, including: if the performance information meets the preset trigger condition, the proportion of target local memory and the proportion of target CXL memory in the target memory usage data of the target virtual machine are adjusted according to the performance information and the prediction result.
[0011] In an exemplary embodiment of the present disclosure, the performance information satisfies a preset trigger condition including: if the running performance information of the target virtual machine exceeds a preset performance threshold, and the local memory usage of the target virtual machine is greater than a first memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition; or if the running performance information of the target virtual machine exceeds a preset performance threshold, and the CXL memory usage of the target virtual machine is greater than a second memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition.
[0012] In an exemplary embodiment of the present disclosure, after adjusting the proportion of target local memory and the proportion of target CXL memory in the target memory usage data of the target virtual machine according to the performance information and the prediction result, the method further includes: obtaining a first duration for which the running performance information of the target virtual machine exceeds the preset performance threshold; if the first duration is greater than a first duration threshold, adjusting the target memory usage data allocated to the target virtual machine; and adjusting the target local memory and target CXL memory of the target virtual machine based on the adjusted target memory usage data.
[0013] In an exemplary embodiment of the present disclosure, if the performance information meets a preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result, and also includes: obtaining a second duration in which the running performance information of the target virtual machine does not exceed a preset performance threshold; if the second duration is greater than a second time threshold, and the local memory usage of the target virtual machine within the second duration is less than a third memory usage threshold, and the CXL memory usage of the target virtual machine within the second duration is less than a fourth memory usage threshold, then reclaiming the unused memory of the target virtual machine.
[0014] In an exemplary embodiment of the present disclosure, the method also includes: obtaining adjustment result information of adjusting the memory of the target virtual machine according to the performance information and the prediction result; adding the adjustment result information to the historical virtual machine memory usage information for predicting the memory demand of the virtual machine to be created.
[0015] According to one aspect of the present disclosure, a memory adjustment device is provided, including: a memory demand prediction module, used to predict the memory demand of the target virtual machine in response to a request to create a target virtual machine, and create the target virtual machine according to the prediction result; wherein the prediction result at least includes target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data; a memory adjustment module, used to monitor the performance information of the target virtual machine, and if the performance information meets a preset trigger condition, adjust the memory of the target virtual machine according to the performance information and the prediction result.
[0016] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, any one of the methods described above is implemented.
[0017] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.
[0018] In the technical solution provided by the exemplary embodiment of the present disclosure, on the one hand, in response to a request to create a target virtual machine, a memory demand prediction is performed on the target virtual machine, and the target virtual machine is created according to the prediction result. Compared with the user-defined allocation method, the various types of memory applied for by the target virtual machine can meet the actual needs and avoid resource waste. On the other hand, the performance information of the target virtual machine can be monitored. If the performance information meets the preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result, so as to realize dynamic adjustment of the memory of the virtual machine and improve the utilization rate and efficiency of the memory.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0021] Figure 1 A system architecture diagram related to an exemplary embodiment of the present disclosure is shown;
[0022] Figure 2 A flowchart schematically illustrates a memory adjustment method of an exemplary embodiment of the present disclosure;
[0023] Figure 3 A flowchart schematically illustrates a method for implementing memory demand prediction in an exemplary embodiment of the present disclosure;
[0024] Figure 4 A flowchart for implementing memory adjustment in an exemplary embodiment of the present disclosure is schematically shown;
[0025] Figure 5 Schematically showing another system architecture diagram related to an exemplary embodiment of the present disclosure;
[0026] Figure 6 A complete flow chart of a memory adjustment method according to an exemplary embodiment of the present disclosure is schematically shown;
[0027] Figure 7 A schematic diagram schematically shows the composition of a memory adjustment device in an exemplary embodiment of the present disclosure;
[0028] Figure 8 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0030] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0031] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0032] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0033] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0034] The technical solution provided by the embodiments of the present disclosure involves artificial intelligence machine learning technology, which uses machine learning technology to predict the memory demand of a target virtual machine to obtain a prediction result, and then creates a target virtual machine based on the prediction result, so that the memory of the target virtual machine meets the prediction result and meets the actual needs of the target virtual machine, avoiding waste of resources.
[0035] For ease of understanding, the system architecture involved in the exemplary embodiments of the present disclosure is first introduced. Figure 1 As shown, the system includes a host, local memory resources corresponding to the host, CXL memory resources, and a memory adjustment device.
[0036] in, Figure 1 Two hosts are shown in the figure, each of which will run a virtual machine (e.g., virtual machine VM3 and virtual machine VM4 run on host 2). When a user applies to create VM1 and VM2, the memory adjustment device responds to the creation request for the target virtual machine, predicts the memory demand of the target virtual machine based on the machine learning algorithm, and creates VM1 and VM2 according to the prediction results. In addition, after VM1 and VM2 are created, the performance information of the target virtual machine can also be monitored by the memory adjustment device. If the performance information meets the preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result. Among them, adjusting the memory of the target virtual machine can be adjusting the local memory and CXL memory of the target virtual machine.
[0037] It is worth noting that the memory adjustment device may be a node independent of the host, and the memory adjustment device may also include sub-nodes deployed on the host and sub-nodes independent of the host, etc., and there is no limitation on this.
[0038] certainly, Figure 1 The system architecture shown is only an example. The system architecture may also include other parts, such as a CXL switch, a virtual switch, etc., which can be flexibly configured according to actual needs and are not specifically limited thereto.
[0039] CXL: Compute Express Link is an open interconnection protocol. It is an interconnection technology designed for memory expansion, heterogeneous computing and system resource decomposition. CXL can provide efficient resource sharing and pooling. Based on CXL, CPU (Central Processing Unit) and GPU (Graphics Processing Unit), FPGA (Field Programmable Gate Array) or other accelerators can achieve high-speed and efficient interconnection, while supporting unified memory access and memory pooling.
[0040] Currently, memory managers are responsible for planning and allocating memory resources to virtual machines. However, research has found that not only is there unreasonable memory allocation, but also that the memory vacancy rate in virtual machines that have been allocated memory is extremely high, posing a huge challenge to the cost of data centers. Since memory resources allocated by memory managers are fixed, there may be differences with the actual memory requirements of virtual machines, which in turn affects virtual machine performance and leads to resource waste.
[0041] Based on one or more of the above problems, an exemplary embodiment of the present disclosure first provides a memory adjustment method, which can be applied to a memory adjustment device, or a module or node having the same function as the memory adjustment device. Figure 2 As shown, the memory adjustment method of the exemplary embodiment of the present disclosure may include the following steps S210 and S220:
[0042] In step S210, in response to a request to create a target virtual machine, a memory requirement prediction is performed on the target virtual machine, and the target virtual machine is created according to the prediction result.
[0043] In an exemplary embodiment of the present disclosure, the prediction result includes at least the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data. The user triggers a creation request for applying to create a target virtual machine, and the creation request may carry relevant parameters of the target virtual machine, including but not limited to the number of processors, the number of cores of each processor, network type information, controller type, disk type, etc., without limitation.
[0044] Furthermore, the memory adjustment device can respond to the creation request of the target virtual machine, predict the memory demand of the target virtual machine, and determine the prediction result. The prediction result may at least include the target memory usage data corresponding to the target virtual machine, the proportion of the target memory usage data in the target local memory, and the proportion of the target memory usage data in the target CXL. Among them, the target memory usage data is the total amount of the target local memory and the target CXL memory. The exemplary embodiment of the present disclosure can adjust the virtual machine configuration according to the prediction result and create a target virtual machine corresponding to the prediction result.
[0045] Among them, the memory demand of the target virtual machine can be predicted based on the machine learning algorithm, and the memory demand of the target virtual machine can be predicted based on the historical virtual machine memory usage information, which will be introduced later.
[0046] In step S220, the performance information of the target virtual machine is monitored, and if the performance information meets a preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result.
[0047] In an exemplary embodiment of the present disclosure, the performance information of the target virtual machine includes memory performance information and operation performance information, and the memory performance information includes at least target local memory, target CXL memory, local memory usage corresponding to the target local memory, CXL memory usage corresponding to the target CXL memory, etc. The operation performance information includes application response time, CPU utilization, etc., which are not specifically limited.
[0048] The preset trigger condition refers to the condition information used to trigger the adjustment of the memory of the target virtual machine. By monitoring the performance information of the target virtual machine in real time, when the performance information meets the preset trigger condition, the memory of the target virtual machine can be adjusted in combination with the performance information and the prediction result, including but not limited to increasing and recycling the memory allocated to the target virtual machine, and adjusting the proportion of the target local memory and the proportion of the target CXL memory in the target memory usage data allocated to the target virtual machine.
[0049] In the technical solution provided by the exemplary embodiment of the present disclosure, on the one hand, in response to a request to create a target virtual machine, a memory demand prediction is performed on the target virtual machine, and the target virtual machine is created according to the prediction result. Compared with the allocation method defined by the user, the memory applied for by the target virtual machine can meet the actual demand and avoid resource waste. On the other hand, the performance information of the target virtual machine can be monitored. If the performance information meets the preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result, so as to realize dynamic adjustment of the memory of the virtual machine and improve the utilization rate and efficiency of the memory.
[0050] The above steps are described in detail below.
[0051] In an exemplary embodiment, a method for implementing memory demand prediction is provided. Figure 3 As shown, in response to a request to create a target virtual machine, predicting the memory demand of the target virtual machine may include:
[0052] Step S310: Obtain historical virtual machine memory usage information, which includes historical memory usage data, the proportion of local memory in the historical memory usage data, and the proportion of the computing high-speed link CXL in the historical memory usage data.
[0053] The virtual machine memory usage information before the user applies to create the target virtual machine can be used as the historical virtual machine memory usage information. The historical virtual machine memory usage information may include multiple data sets, each data set corresponds to a virtual machine, and each data set may include the historical memory usage data of the virtual machine, the proportion of local memory in the historical memory usage data, and the proportion of the historical memory usage data in the computing high-speed link CXL. For example, a data set is {Q; m:n}, where "Q" is the historical memory usage data of the virtual machine, that is, the total amount of memory applied for, and "m:n" is the ratio of the local memory and CXL memory of the virtual machine in "Q".
[0054] That is to say, multiple sets of data sets are obtained according to the data sets corresponding to each virtual machine to jointly construct the historical virtual machine memory usage information. The historical virtual machine memory usage information can be obtained by real-time monitoring, and there is no restriction on this.
[0055] Optionally, the latest collection time of historical virtual machine memory usage information may be close to the time when the creation request of the target virtual machine is received. The closer the collection time of historical virtual machine memory usage information is to the current time, the more accurate the predicted historical virtual machine memory usage information is.
[0056] Optionally, a predetermined period may be set, with the current time as the starting point, to collect memory usage information of virtual machines within the past predetermined period as historical virtual machine memory usage information. The exemplary embodiment of the present disclosure may determine the method of collecting historical virtual machine memory usage information according to actual needs, and there is no limitation on this.
[0057] Step S320: Based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information, a memory demand forecast is performed on the target virtual machine to obtain a forecast result.
[0058] As can be seen from the above, the prediction result at least includes the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data.
[0059] As an example, a machine learning model can be trained based on historical virtual machine memory information by continuously adjusting model parameters until the model reaches training completion conditions, such as model convergence, so that the trained model can be used to predict memory requirements.
[0060] The machine learning model can be constructed using lightweight neural networks, such as CNN (Convolutional Neural Network), RNN (Recurrent Neural Networks), DNN (Deep Neural Networks), etc. Compared with lightweight neural networks, memory prediction models with more complex network structures can also be used, such as heavyweight neural networks. Furthermore, the machine learning model can also be a large model of billions of units, and there is no restriction on this.
[0061] An exemplary embodiment of the present disclosure can take the target virtual machine information carried in the creation request as input, predict the memory demand of the target virtual machine based on the historical virtual machine memory usage information, and obtain the prediction result. By using a machine learning algorithm, the prediction result can reflect the actual demand of the target virtual machine, improve the accuracy of resource allocation, and avoid waste of memory resources.
[0062] In an exemplary embodiment, based on the target virtual machine information and the historical virtual machine memory usage information carried in the creation request, the memory demand prediction of the target virtual machine is performed, and the prediction result may also include:
[0063] Determine the category of the target virtual machine according to the target virtual machine information;
[0064] Based on the historical virtual machine memory usage information corresponding to the category, the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data are predicted.
[0065] The target virtual machine information includes virtual machine parameters that can be used to determine the type of virtual machine. Generally, virtual machine memory usage information of virtual machines of the same category is more correlated. If used for prediction, the accuracy of the prediction result will be further improved. Therefore, the virtual machine category is first determined based on the target virtual machine information, and then the memory demand of the target virtual machine is predicted based on the historical virtual machine memory usage information corresponding to the category.
[0066] By combining the virtual machine category, the prediction results can be more in line with the category requirements of the target virtual machine and the actual memory requirements of its business, thereby improving the accuracy of the prediction results.
[0067] In an exemplary embodiment, monitoring the performance information of the target virtual machine includes monitoring the memory performance information and the operation performance information of the target virtual machine. Through monitoring, it can be determined whether at least one of the target memory usage data scheduled to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data can meet the requirements of its operation performance.
[0068] In an exemplary embodiment, a method for adjusting the memory of a target virtual machine is provided. If the performance information meets a preset trigger condition, adjusting the memory of the target virtual machine according to the performance information and the prediction result may include:
[0069] If the performance information meets the preset trigger condition, the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine are adjusted according to the performance information and the prediction result.
[0070] Among them, different virtual machine performances have different requirements for the local memory and CXL memory of the target virtual machine. At the same time, it is also necessary to avoid excessive local memory or CXL memory usage affecting the virtual machine performance. Therefore, when the performance information meets the preset trigger conditions, the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine can be adjusted according to the performance information and the prediction results.
[0071] As an example, if the application response time of the target virtual machine is long, that is, there is a response delay, and the local memory usage rate exceeds 95% and the CXL memory usage rate is less than 10%, the target local memory ratio and the target CXL memory ratio in the target memory usage data can be adjusted, such as increasing the target local memory ratio and correspondingly reducing the target CXL memory ratio. Of course, this is only an example, and other performance information may also meet the corresponding preset trigger conditions.
[0072] The exemplary embodiment of the present disclosure adjusts the memory configuration of the virtual machine to achieve dynamic adjustment of the proportion of local memory and CXL memory to meet the memory utilization in different scenarios (such as k8s scenarios), thereby improving the performance of the target virtual machine.
[0073] In an exemplary embodiment, the performance information satisfies a preset trigger condition including: if the running performance information of the target virtual machine exceeds a preset performance threshold, and the local memory usage of the target virtual machine is greater than a first memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition; or, if the running performance information of the target virtual machine exceeds the preset performance threshold, and the CXL memory usage of the target virtual machine is greater than a second memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition.
[0074] Among them, for different operating performance information, there are respective corresponding preset performance thresholds. Optionally, in order to ensure that the target virtual machine maintains high-performance operation, when there is at least one operating performance information (such as application response time) that exceeds its corresponding preset performance threshold, it is determined that the operating performance information of the target virtual machine exceeds the preset performance threshold. Optionally, it can also be that there are a preset number of operating performance information that all exceed their respective corresponding preset performance thresholds, then it is determined that the operating performance information of the target virtual machine exceeds the preset performance threshold. Optionally, the target operating performance information can also be specified, and only when the target operating performance information exceeds its corresponding preset performance threshold, it is determined that the operating performance information of the target virtual machine exceeds the preset performance threshold.
[0075] The exemplary embodiments of the present disclosure may select a method for determining whether the operating performance information of the target virtual machine exceeds a preset performance threshold according to actual needs.
[0076] The first memory usage threshold is a memory usage limit value indicating that the local memory needs to be expanded. When the local memory usage of the target virtual machine is greater than the first memory usage threshold, it means that in order to ensure the operating performance of the target virtual machine, the local memory needs to be expanded. Correspondingly, the second memory usage threshold is a memory usage limit value indicating that the CXL memory needs to be expanded. When the CXL memory usage of the target virtual machine is greater than the second memory usage threshold, it means that in order to ensure the operating performance of the target virtual machine, the CXL memory needs to be expanded.
[0077] It should be understood that the first memory usage threshold and the second memory usage threshold can be adjusted according to actual needs. The exemplary embodiments of the present disclosure do not specifically limit the first memory usage threshold and the second memory usage threshold. When the local memory usage is greater than the first memory usage threshold or the CXL memory usage is greater than the second memory usage threshold, it is determined that the performance information of the target virtual machine meets the preset trigger condition, and the memory of the target virtual machine can be adjusted according to the performance information and the prediction results to avoid affecting the operating performance due to insufficient local memory or CXL memory.
[0078] In an exemplary embodiment, if Figure 4 As shown, after adjusting the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine according to the performance information and the prediction result, the process may further include steps S410 to S430:
[0079] Step S410: obtaining a first duration in which the operating performance information of the target virtual machine exceeds a preset performance threshold.
[0080] After adjusting the target local memory ratio and the target CXL memory ratio in the target memory usage data according to the performance information and the prediction results, the target virtual machine's operating performance information can be obtained, and it still exceeds the preset performance threshold and the first duration of the exceeding state. The length of the first duration can reflect whether adjusting the ratio of the two memories is effective in improving the performance of the target virtual machine.
[0081] Step S420: If the first duration is greater than a first duration threshold, adjust the target memory usage data allocated to the target virtual machine.
[0082] When the first duration is greater than the first duration threshold, it indicates that the current performance requirement cannot be met by simply adjusting the proportion of the two types of memory in the target memory usage data, but is caused by insufficient target memory usage data allocated to the target virtual machine, and the target memory usage data allocated to the target virtual machine needs to be adjusted. For example, the target memory usage data allocated to the target virtual machine is increased.
[0083] As an example, a memory usage data increase value may be preset, and the target memory usage data of the target virtual machine may be increased by the memory usage data increase value first. If the target virtual machine's operating performance information still exceeds the preset performance threshold after that, the memory usage data increase value may be increased once more, and the above steps may be repeated until the target virtual machine's operating performance information no longer exceeds the preset performance threshold. The memory usage data increase value may be set according to actual needs, and no feature limitation is made therefor.
[0084] As an example, you can also obtain the excess value of the target virtual machine's operating performance exceeding a preset performance threshold, and based on the correspondence between the preset excess value and the memory usage data increase value, obtain the target memory usage data increase value corresponding to the excess value, and add the target memory usage data increase value to the target memory usage data of the target virtual machine.
[0085] Of course, exemplary embodiments of the present disclosure may also select other methods to adjust the target memory usage data allocated to the target virtual machine, including but not limited to the above-mentioned methods.
[0086] Step S430: adjusting the target local memory and the target CXL memory of the target virtual machine based on the adjusted target memory usage data.
[0087] After adjusting the target memory usage data allocated to the target virtual machine, the target local memory and the target CXL memory of the target virtual machine may be adjusted based on the adjusted target memory usage data to achieve dynamic expansion of the virtual machine memory.
[0088] By adjusting the target memory usage data allocated to the target virtual machine, the idle memory of the system is scheduled to the target virtual machine, making full use of the idle memory, improving memory utilization, and ensuring the operating performance of the target virtual machine.
[0089] In an exemplary embodiment, if the performance information satisfies a preset trigger condition, adjusting the memory of the target virtual machine according to the performance information and the prediction result further includes:
[0090] Obtain a second duration in which the operating performance information of the target virtual machine does not exceed a preset performance threshold; if the second duration is greater than the second time threshold, and the local memory usage of the target virtual machine within the second duration is less than the third memory usage threshold, and the CXL memory usage of the target virtual machine within the second duration is less than the fourth memory usage threshold, then reclaim the unused memory of the target virtual machine.
[0091] Among them, the third memory usage threshold is less than the first memory usage threshold, and the third memory usage threshold is a memory usage limit value indicating that there is a lot of free memory in the local memory. When the local memory usage is often less than the third memory usage threshold, it indicates that the local memory free rate of the target virtual machine is relatively high. Correspondingly, the fourth memory usage threshold is less than the second memory usage threshold, and the fourth memory usage threshold is a memory usage limit value indicating that there is a lot of free memory in the CXL memory. When the CXL memory usage is often less than the fourth memory usage threshold, it indicates that the CXL memory free rate of the target virtual machine is relatively high.
[0092] The fact that the operating performance information of the target virtual machine does not exceed the preset performance threshold means that the operating performance of the target virtual machine is in a better state. When the target virtual machine is in a better state and exceeds the second time threshold, it means that the target virtual machine is running stably and well. At this time, if the local memory and the CXL memory both have a high memory idle rate, the unused memory of the target virtual machine can be recycled. The recycled memory can be scheduled to other virtual machines to improve the utilization rate of the system memory.
[0093] As an example, the amount of unused memory of the target virtual machine can be obtained. In order to ensure the running state of the target virtual machine, part of the amount of memory in use can be recycled. The memory recycling ratio can be set in advance, and the recyclable memory can be obtained from the amount of memory in use according to the memory recycling ratio. The memory recycling ratio can be set according to actual conditions, and there is no special restriction on this.
[0094] As an example, since the second duration has exceeded the second time threshold, it means that the current target memory usage can meet the operating performance of the target virtual machine, and the unused memory of the target virtual machine can be reclaimed.
[0095] Of course, the exemplary embodiments of the present disclosure may also reclaim the unused memory of the target virtual machine in other ways, thereby improving the utilization rate of the system memory and realizing dynamic scheduling of the memory between virtual machines.
[0096] In an exemplary embodiment, in order to improve the accuracy and timeliness of memory demand prediction for a target virtual machine based on historical virtual machine memory usage information, it is also possible to obtain adjustment result information for adjusting the memory of the target virtual machine based on performance information and prediction results, and add the adjustment result information to the historical virtual machine memory usage information for use in memory demand prediction for the virtual machine to be created.
[0097] The adjustment result information may include at least one of the target memory usage information of the adjusted target virtual machine, the proportion of the target local memory in the adjusted target memory usage data, and the proportion of the target CXL memory in the adjusted target memory usage data. By using the adjustment of the memory of the target virtual machine as the historical virtual machine memory usage information, the information used for memory demand prediction is always the information that satisfies the actual virtual machine, forming a dynamic closed loop between the predicted memory and the adjusted memory, thereby improving the accuracy of the memory usage information prediction.
[0098] Figure 5 Another system architecture diagram involved in the exemplary embodiment of the present disclosure is shown, and a memory adjustment device including a scheduling node and a computing node is used as an example for explanation, wherein the computing node may be a node deployed on a physical host, and the scheduling node is a node not deployed on the physical host. The exemplary embodiment of the present disclosure does not impose special restrictions on the deployment locations of the scheduling nodes and the computing nodes.
[0099] like Figure 5 The prediction module is used to predict the memory demand of the virtual machine. The management module (such as Kubelet or VM manager) is used to call the virtual machine monitor to create a virtual machine. At the same time, a performance monitoring module and a memory dynamic expansion module are added. The performance monitoring module is used to collect the performance information of the target virtual machine and determine whether the performance information meets the preset trigger conditions. If the performance information meets the preset trigger conditions, the memory dynamic expansion module is triggered to adjust the memory of the target virtual machine according to the performance information and the prediction results, including but not limited to adjusting the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine, and the target memory usage data allocated to the target virtual machine.
[0100] CXL Memory manages CXL pooled hardware devices (such as Figure 5Optionally, a CXL memory controller (CXL Memory Controller) (not shown in the figure) can be integrated in the CXL pooling hardware device, and a CXL pooling memory management module can be integrated to support dynamic allocation and release of CXL memory and data protection.
[0101] like Figure 5 , the memory inside the target virtual machine is divided into two categories, local memory (such as local DRAM (Dynamic Random Access Memory)) and CXL memory (such as memory in the form of NUMA node (a shared memory controller is used inside the node)).
[0102] like Figure 6 A complete flow chart of a memory adjustment method involved in an exemplary embodiment of the present disclosure is shown below. Figure 5 and Figure 6 A memory adjustment method according to an exemplary embodiment of the present disclosure is described.
[0103] Step S610: The user triggers a request to create a target virtual machine, applying to create a virtual machine.
[0104] The creation request carries target virtual machine information, including virtual machine parameters that can be used to determine the type of the virtual machine.
[0105] Step S620: the scheduling node predicts the memory demand of the target virtual machine in response to the request to create the target virtual machine.
[0106] The scheduling node can obtain historical virtual machine memory usage information, and by calling the scheduling policy (Scheduler), based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information, the memory demand prediction of the target virtual machine is obtained. The prediction result includes at least the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data.
[0107] Step S630: The scheduling node synchronizes the creation request carrying the prediction result to the computing node.
[0108] Step S640: The computing node creates a target virtual machine according to the prediction result.
[0109] Among them, the target memory usage data, the target local memory ratio, and the target CXL memory ratio of the target virtual machine created by the compute node through scheduling the virtual machine monitor Hypervisor are all consistent with the prediction results.
[0110] Step S650: Monitor the memory performance information and operation performance information of the target virtual machine through the performance monitoring module.
[0111] The memory performance information includes at least the local memory usage and CXL memory usage of the target virtual machine. If the running performance information of the target virtual machine exceeds the preset performance threshold, and the local memory usage of the target virtual machine is greater than the first memory usage threshold, or if the running performance information of the target virtual machine exceeds the preset performance threshold, and the CXL memory usage of the target virtual machine is greater than the second memory usage threshold, it is determined that the performance information meets the preset trigger condition, and then the process turns to step S660 to adjust the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine according to the performance information and the prediction result.
[0112] After adjusting the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine according to the performance information and the prediction results, step S670 can be used to obtain the first duration for which the running performance information of the target virtual machine exceeds the preset performance threshold. If the first duration is greater than the first duration threshold, the target memory usage data allocated to the target virtual machine is adjusted, and then based on the adjusted target memory usage data, the target local memory and target CXL memory of the target virtual machine are adjusted.
[0113] In step S680, it is determined whether there is much free memory in the local memory and the CXL memory.
[0114] The second duration during which the operating performance information of the target virtual machine does not exceed the preset performance threshold can be obtained. If the second duration is greater than the second time threshold, and the local memory usage of the target virtual machine in the second duration is less than the third memory usage threshold, and the CXL memory usage of the target virtual machine in the second duration is less than the fourth memory usage threshold, the unused memory of the target virtual machine is reclaimed.
[0115] Step S690: Add the adjusted adjustment result information to the historical virtual machine memory usage information.
[0116] The adjustment result information of adjusting the memory of the target virtual machine according to the performance information and the prediction result can be obtained, and the adjustment result information is added to the historical virtual machine memory usage information to be used for predicting the memory demand of the virtual machine to be created.
[0117] It should be noted that the details of step S610 to step S690 have been recorded in the above exemplary embodiment and will not be repeated here.
[0118] The CXL dynamic expansion memory pooling technology based on machine learning provided by the exemplary embodiment of the present disclosure, on the one hand, predicts the memory demand of the target virtual machine in response to the creation request of the target virtual machine, and creates the target virtual machine according to the prediction result, which can make the memory applied for by the target virtual machine meet the actual demand and avoid resource waste compared with the allocation method customized by the user. On the other hand, the performance information of the target virtual machine can be monitored. If the performance information meets the preset trigger condition, the memory of the target virtual machine is adjusted according to the performance information and the prediction result, so as to realize the dynamic adjustment of the memory of the virtual machine, improve the utilization rate and use efficiency of the memory, and well meet the scenarios with high memory demand, such as k8s (kubernetes, open source, used to manage containerized applications on multiple hosts in the cloud platform).
[0119] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0120] For further reference, Figure 7 As shown, in an exemplary embodiment of the present disclosure, a memory adjustment device 700 is provided, comprising a memory demand prediction module 710 and a memory adjustment module 720. Among them:
[0121] The memory requirement prediction module 710 is used to respond to a request to create a target virtual machine, predict the memory requirement of the target virtual machine, and create the target virtual machine according to the prediction result; wherein the prediction result at least includes the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data.
[0122] The memory adjustment module 720 is used to monitor the performance information of the target virtual machine, and if the performance information meets a preset trigger condition, adjust the memory of the target virtual machine according to the performance information and the prediction result.
[0123] In an exemplary embodiment, the memory demand prediction module 710 is configured to perform: obtaining historical virtual machine memory usage information, the historical virtual machine memory usage information including historical memory usage data, the proportion of local memory in the historical memory usage data, and the proportion of the historical memory usage data in the calculation high-speed link CXL; based on the target virtual machine information carried by the creation request and the historical virtual machine memory usage information, performing memory demand prediction on the target virtual machine to obtain the prediction result.
[0124] In an exemplary embodiment, the memory demand prediction module 710 is configured to perform: determining the category of the target virtual machine based on the target virtual machine information; and predicting the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target memory usage data in the target CXL based on the historical virtual machine memory usage information corresponding to the category.
[0125] In an exemplary embodiment, the memory adjustment module 720 is configured to execute: monitoring the memory performance information and the operation performance information of the target virtual machine; wherein the memory performance information at least includes the local memory usage and the CXL memory usage of the target virtual machine.
[0126] In an exemplary embodiment, the memory adjustment module 720 is configured to execute: if the performance information meets a preset trigger condition, adjust the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine according to the performance information and the prediction result.
[0127] In an exemplary embodiment, the performance information satisfies a preset trigger condition including: if the running performance information of the target virtual machine exceeds a preset performance threshold, and the local memory usage of the target virtual machine is greater than a first memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition; or if the running performance information of the target virtual machine exceeds the preset performance threshold, and the CXL memory usage of the target virtual machine is greater than a second memory usage threshold, then it is determined that the performance information satisfies the preset trigger condition.
[0128] In an exemplary embodiment, the memory adjustment module 720 is further configured to perform: after adjusting the proportion of target local memory and the proportion of target CXL memory in the target memory usage data of the target virtual machine according to the performance information and the prediction result, obtaining the first duration for which the running performance information of the target virtual machine exceeds the preset performance threshold; if the first duration is greater than the first duration threshold, adjusting the target memory usage data allocated to the target virtual machine; and adjusting the target local memory and target CXL memory of the target virtual machine based on the adjusted target memory usage data.
[0129] In an exemplary embodiment, the memory adjustment module 720 is further configured to execute: obtaining a second duration in which the operating performance information of the target virtual machine does not exceed a preset performance threshold; if the second duration is greater than a second time threshold, and the local memory usage of the target virtual machine within the second duration is less than a third memory usage threshold, and the CXL memory usage of the target virtual machine within the second duration is less than a fourth memory usage threshold, then reclaiming the unused memory of the target virtual machine.
[0130] In an exemplary embodiment, the memory adjustment module 720 is also configured to perform: obtaining adjustment result information for adjusting the memory of the target virtual machine based on the performance information and the prediction result; adding the adjustment result information to the historical virtual machine memory usage information for predicting memory requirements for the virtual machine to be created.
[0131] Since the details of each functional module of the memory adjustment device of the exemplary embodiment of the present disclosure have been recorded in the exemplary embodiment of the above-mentioned memory adjustment method, they will not be repeated here.
[0132] It should be noted that although several modules or units of the memory adjustment device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0133] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the memory adjustment method described above is implemented.
[0134] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory (Nand Flash), and the like.
[0135] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0136] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed completely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (for example, through an Internet connection provided by an operator).
[0137] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on the electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure, such as the memory adjustment method described above.
[0138] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. A person skilled in the art will appreciate that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to as a "circuit", "module", or "system" herein.
[0139] Refer to the following Figure 8 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include but are not limited to: the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0140] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0141] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 821 and / or a cache storage unit 822, and may further include a read-only storage unit (ROM) 823. The storage unit 820 may also include a program / utility 824 having a set (at least one) of program modules 825, such program modules 825 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.
[0142] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0143] The electronic device 800 can also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be carried out through an input / output (I / O) interface 850. In addition, the electronic device 800 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs) and / or public networks, such as the Internet) through a network adapter 860. As shown in the figure, the network adapter 860 communicates with other modules of the electronic device 800 through a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0144] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0145] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0146] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A memory adjustment method, characterized in that: The method comprises: In response to a request to create a target virtual machine, use the trained machine learning model to predict the memory demand of the target virtual machine, and create the target virtual machine according to the prediction result; wherein the prediction result at least includes the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data; Monitor the performance information of the target virtual machine, and if at least one operating performance information exceeds a preset performance threshold, and the local memory usage or CXL memory usage of the target virtual machine is greater than the corresponding memory usage limit value, adjust the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine; If the first duration of the operating performance information of the target virtual machine exceeding the preset performance threshold is greater than the first duration threshold, the target memory usage data allocated to the target virtual machine is adjusted; the performance information includes the memory performance information and the operating performance information of the target virtual machine; wherein, in response to the creation request for the target virtual machine, the memory demand prediction for the target virtual machine includes: Obtain historical virtual machine memory usage information; based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information, perform memory demand prediction on the target virtual machine to obtain the prediction result.
2. The method according to claim 1, characterized in that The historical virtual machine memory usage information includes historical memory usage data, the proportion of the local memory in the historical memory usage data, and the proportion of the historical memory usage data in the computing high-speed link CXL.
3. The method according to claim 2, characterized in that The performing memory demand prediction on the target virtual machine based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information to obtain the prediction result includes: Determining a category of the target virtual machine according to the target virtual machine information; Based on the historical virtual machine memory usage information corresponding to the category, the target memory usage data corresponding to the target virtual machine, the proportion of the target local memory in the target memory usage data, and the proportion of the target CXL memory in the target memory usage data are predicted.
4. The method according to claim 2, characterized in that: The monitoring of the performance information of the target virtual machine includes: Monitoring the memory performance information and operation performance information of the target virtual machine; The memory performance information includes at least a local memory usage rate and a CXL memory usage rate of the target virtual machine.
5. The method according to claim 4, characterized in that If at least one type of operating performance information exceeds a preset performance threshold, and the local memory usage or CXL memory usage of the target virtual machine is greater than a corresponding memory usage limit value, the method includes: If the operating performance information of the target virtual machine exceeds a preset performance threshold, and the local memory usage of the target virtual machine is greater than a first memory usage threshold, determining that the performance information meets a preset trigger condition; or If the running performance information of the target virtual machine exceeds a preset performance threshold, and the CXL memory usage of the target virtual machine is greater than a second memory usage threshold, it is determined that the performance information meets the preset trigger condition.
6. The method according to claim 5, characterized in that After adjusting the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine, the method further includes: Based on the adjusted target memory usage data, the target local memory and the target CXL memory of the target virtual machine are adjusted.
7. The method according to claim 5, characterized in that The method further comprises: Acquire a second duration during which the running performance information of the target virtual machine does not exceed a preset performance threshold; If the second duration is greater than the second time threshold, and the local memory usage of the target virtual machine during the second duration is less than the third memory usage threshold, and the CXL memory usage of the target virtual machine during the second duration is less than the fourth memory usage threshold, then the unused memory of the target virtual machine is reclaimed.
8. The method according to any one of claims 2 to 7, characterized in that The method further comprises: Acquire adjustment result information of adjusting the memory of the target virtual machine according to the performance information and the prediction result; The adjustment result information is added to the historical virtual machine memory usage information to be used for predicting the memory demand of the virtual machine to be created.
9. A memory adjustment device, characterized in that: The device comprises: A memory demand prediction module, configured to predict the memory demand of a target virtual machine in response to a request to create the target virtual machine, and create the target virtual machine according to the prediction result; wherein the prediction result includes at least target memory usage data corresponding to the target virtual machine, a proportion of the target local memory in the target memory usage data, and a proportion of the target CXL memory in the target memory usage data; A memory adjustment module, configured to monitor the performance information of the target virtual machine, and if at least one type of operating performance information exceeds a preset performance threshold, and the local memory usage rate or CXL memory usage rate of the target virtual machine is greater than the corresponding memory usage rate limit value, then adjust the target local memory ratio and the target CXL memory ratio in the target memory usage data of the target virtual machine; if the first duration of the operating performance information of the target virtual machine exceeding the preset performance threshold is greater than a first duration threshold, then adjust the target memory usage data allocated to the target virtual machine; the performance information includes the memory performance information and the operating performance information of the target virtual machine; The memory demand prediction module is configured to perform: Obtain historical virtual machine memory usage information; based on the target virtual machine information carried in the creation request and the historical virtual machine memory usage information, perform memory demand prediction on the target virtual machine to obtain the prediction result.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
