Virtual machine tuning method and system, electronic equipment and readable storage medium
By generating virtual machine tuning strategies through an AI tuning engine, the high cost and low efficiency problems caused by relying on human experience in existing technologies are solved, and efficient and intelligent tuning is achieved.
Patent Information
- Application Number
- CN202411426784.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-10
AI Technical Summary
Existing virtual machine tuning solutions rely on human experience, resulting in high costs and low efficiency.
An AI-powered tuning engine is used to generate tuning strategies. By acquiring virtual machine runtime parameter information, tuning strategies are generated and applied. Combined with access control for cloned virtual machines, intelligent tuning is achieved.
Reduce labor costs, improve tuning efficiency and accuracy, and minimize the impact on the performance of the tuning program.
Smart Images

Figure CN119292735A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a virtual machine tuning method, system, electronic device and readable storage medium. Background Art
[0002] Virtual machine technology creates multiple independent virtual computers on a physical machine, divides the resources of the physical machine (such as processor, memory, storage, etc.) into multiple virtual resources, and provides a certain resource quota for each virtual machine. Each virtual machine can run its own operating system and application. The physical machine where the virtual machine is located is also called the host machine. In order to reduce costs and improve resource utilization, enterprises have generally adopted virtual machines to deploy various applications when building IT systems.
[0003] For the tuning of applications deployed on virtual machines, existing solutions rely too much on the professional understanding and experience accumulation of developers or operation and maintenance personnel, resulting in high labor costs and poor tuning efficiency. Summary of the invention
[0004] The embodiments of the present application provide a virtual machine tuning method, system, electronic device and readable storage medium, which can solve the problem that existing solutions are too dependent on the professional understanding and experience accumulation of development or operation and maintenance personnel, have high labor costs and poor tuning efficiency.
[0005] In a first aspect, a virtual machine tuning method is provided, comprising:
[0006] Obtaining the operating parameter information of the target virtual machine;
[0007] Sending the operating parameter information to the AI tuning engine;
[0008] The AI tuning engine generates a tuning strategy according to the operating parameter information;
[0009] Tuning the target virtual machine according to the tuning strategy;
[0010] The target virtual machine is deployed on a first physical machine, and the AI tuning engine is deployed on a second physical machine.
[0011] In an optional embodiment, the method further includes:
[0012] Generating a clone virtual machine of the target virtual machine on the second physical machine according to the operating parameter information;
[0013] The access received by the target virtual machine is forwarded to the clone virtual machine, and the clone virtual machine processes the access.
[0014] In an optional implementation, before obtaining the operating parameter information of the target virtual machine, the method further includes:
[0015] Obtaining tuning target information and test scripts associated with the target virtual machine;
[0016] The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
[0017] In an optional implementation, the tuning target information includes: target application performance indicators;
[0018] The step of tuning the target virtual machine according to the tuning strategy includes:
[0019] Tuning the target virtual machine using the tuning strategy, and testing the target virtual machine using the test script to obtain a performance indicator of the application after tuning;
[0020] When the application performance indicator after the tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
[0021] In an optional implementation manner, the tuning target information further includes: the number of tuning times;
[0022] The tuning of the target virtual machine according to the tuning strategy also includes:
[0023] When the application performance indicator after the tuning does not meet the target application performance indicator, the operating parameter information of the target virtual machine after the tuning is sent to the AI tuning engine to obtain an updated tuning strategy;
[0024] Use the update tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance index after the update tuning;
[0025] The step of obtaining the updated and tuned application performance indicator is repeatedly performed until the updated and tuned application performance indicator meets the target application performance indicator or reaches the tuning times.
[0026] In an optional implementation, after tuning the target virtual machine according to the tuning strategy, the method further includes:
[0027] Synchronizing application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine;
[0028] Acquire a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data;
[0029] Generate a tuning report according to the first service result and the second service result.
[0030] In an optional implementation, before obtaining the operating parameter information of the target virtual machine, the method further includes:
[0031] Taking a snapshot of the target virtual machine to obtain a snapshot result;
[0032] After generating a tuning report according to the first service result and the second service result, the method further includes:
[0033] When the target virtual machine after application tuning is determined according to the tuning report, destroying the cloned virtual machine;
[0034] In the case that it is determined according to the tuning report that the tuned target virtual machine is not to be applied, the tuned target virtual machine is rolled back to the target virtual machine before the tuning according to the snapshot taking result.
[0035] In a second aspect, a virtual machine tuning system is provided, including: a first physical machine and a second physical machine, wherein a plurality of virtual machines are deployed in the first physical machine, and an AI tuning engine is deployed in the second physical machine;
[0036] The system further comprises:
[0037] A first acquisition module, configured to acquire operating parameter information of a target virtual machine, wherein the target virtual machine is a virtual machine among the multiple virtual machines;
[0038] A sending module, used to send the operating parameter information to the AI tuning engine;
[0039] A first generating module, configured for the AI tuning engine to generate a tuning strategy according to the operating parameter information;
[0040] A tuning module is used to tune the target virtual machine according to the tuning strategy.
[0041] In an optional embodiment, the system further includes:
[0042] A cloning module, configured to generate a clone virtual machine of the target virtual machine on the second physical machine according to the operating parameter information;
[0043] The forwarding module is used to forward the access received by the target virtual machine to the clone virtual machine, and the clone virtual machine processes the access.
[0044] In an optional embodiment, the system further includes:
[0045] A second acquisition module is used to acquire tuning target information and test scripts associated with the target virtual machine before acquiring the operating parameter information of the target virtual machine;
[0046] The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
[0047] In an optional implementation, the tuning target information includes: target application performance indicators;
[0048] The tuning module is specifically used for:
[0049] Tuning the target virtual machine using the tuning strategy, and testing the target virtual machine using the test script to obtain a performance indicator of the application after tuning;
[0050] When the application performance indicator after the tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
[0051] In an optional implementation manner, the tuning target information further includes: the number of tuning times;
[0052] The tuning module is also specifically used for:
[0053] When the application performance indicator after the tuning does not meet the target application performance indicator, the operating parameter information of the target virtual machine after the tuning is sent to the AI tuning engine to obtain an updated tuning strategy;
[0054] Use the update tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance index after the update tuning;
[0055] The step of obtaining the updated and tuned application performance indicator is repeatedly performed until the updated and tuned application performance indicator meets the target application performance indicator or reaches the tuning times.
[0056] In an optional embodiment, the system further includes:
[0057] A synchronization module, configured to synchronize the application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine after the tuning is performed on the target virtual machine according to the tuning policy;
[0058] A third acquisition module is used to acquire a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data;
[0059] The second generating module is used to generate a tuning report according to the first service result and the second service result.
[0060] In an optional embodiment, the system further includes:
[0061] A snapshot module is used to take a snapshot of the target virtual machine before obtaining the operating parameter information of the target virtual machine to obtain a snapshot result;
[0062] A destroying module, configured to, after generating a tuning report according to the first service result and the second service result, destroy the cloned virtual machine when the target virtual machine after application tuning is determined according to the tuning report;
[0063] A rollback module is used to generate a tuning report based on the first service result and the second service result, and if it is determined according to the tuning report that the tuned target virtual machine should not be applied, roll back the tuned target virtual machine to the target virtual machine before tuning based on the snapshot result.
[0064] According to a third aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and wherein the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0065] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0066] In a fifth aspect, a chip is provided, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the first aspect.
[0067] In a sixth aspect, a computer program / program product is provided, wherein the computer program / program product is stored in a storage medium and is executed by at least one processor to implement the steps of the method described in the first aspect.
[0068] In the embodiment of the present application, the AI algorithm is used to generate the tuning strategy for the virtual machine to perform intelligent analysis and tuning, which reduces the labor cost and improves the efficiency and effect of application optimization. The target virtual machine and the AI tuning engine are deployed on different physical machines. With the help of the distributed deployment framework, the impact of the load of the tuning tool on the performance of the program to be tuned is reduced, and the accuracy of the tuning is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 This is one of the flow charts of the virtual machine tuning method provided in the embodiment of the present application;
[0070] Figure 2a It is a schematic diagram of the system architecture provided by the embodiment of the present application;
[0071] Figure 2b This is the second flow chart of the virtual machine tuning method provided in the embodiment of the present application;
[0072] Figure 3 It is a structural diagram of a virtual machine tuning system provided in an embodiment of the present application;
[0073] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0075] The terms "first", "second", etc. of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of one type, and the number of objects is not limited, for example, the first object can be one or more. In addition, "or" in the present application represents at least one of the connected objects. For example, the protection scope of "A or B" covers at least three schemes, that is, scheme one: including A and excluding B; scheme two: including B and excluding A; scheme three: including both A and B. In addition, the terms "A and / or B", "at least one of A and B", and "at least one of A or B" also cover at least the above three schemes respectively. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0076] The following is a detailed description of the virtual machine tuning provided by the embodiments of the present application through some embodiments and their application scenarios in conjunction with the accompanying drawings.
[0077] See also Figure 1 , an embodiment of the present application provides a virtual machine tuning method, the method comprising:
[0078] Step 101: Obtaining operating parameter information of a target virtual machine;
[0079] Step 102: Send the operating parameter information to the AI tuning engine;
[0080] Step 103: The AI tuning engine generates a tuning strategy based on the operating parameter information;
[0081] Step 104: Optimize the target virtual machine according to the optimization strategy;
[0082] The target virtual machine is deployed on the first physical machine, and the AI tuning engine is deployed on the second physical machine.
[0083] The above-mentioned AI tuning engine is pre-set with an AI algorithm, which can generate a tuning strategy based on the operating parameter information of the virtual machine. The tuning strategy describes the modification method of each configuration item (including executing configuration commands, modifying configuration files), and the method of taking effect (including immediate effect, restarting the application and restarting the virtual machine). It can be understood that the embodiment of the present application does not specifically limit the type of AI algorithm used in the AI tuning engine and the calculation process.
[0084] In the embodiment of the present application, the AI algorithm is used to generate the tuning strategy for the virtual machine to perform intelligent analysis and tuning, which reduces the labor cost and improves the efficiency and effect of application optimization. The target virtual machine and the AI tuning engine are deployed on different physical machines. With the help of the distributed deployment framework, the impact of the load of the tuning tool on the performance of the program to be tuned is reduced, and the accuracy of the tuning is improved.
[0085] It should be noted that in the embodiment of the present application, the first physical machine can be understood as a device with virtual machine tuning requirements, in which multiple virtual machines for different application services can be deployed, and the second physical machine can be understood as an external tuning device for tuning the virtual. The first physical machine and the second physical machine can interact with each other via wired (for example, data transmission via a data cable connection) or wireless (for example, data transmission via a wireless network).
[0086] Furthermore, a tuning client and a tuning server can be set in the first physical machine. The tuning client is used to obtain user operation instructions to select a specified target virtual machine and obtain operating parameter information of the target virtual machine. The tuning server is used to send the operating parameter information to the AI tuning engine, receive the tuning strategy from the AI tuning engine, and tune the target virtual machine according to the tuning strategy.
[0087] It is understandable that the above-mentioned tuning client and tuning server can be combined into one functional module to uniformly execute the above-mentioned method steps, or can be divided into multiple different functional modules to respectively execute the above-mentioned method steps. The embodiments of the present application do not make specific limitations on this.
[0088] In an optional embodiment, the method further includes:
[0089] (1) generating a clone virtual machine of the target virtual machine on the second physical machine according to the operating parameter information;
[0090] (2) The access received by the target virtual machine is forwarded to the clone virtual machine, and the clone virtual machine processes the access.
[0091] In an embodiment of the present application, a cloned virtual machine of a target virtual machine is cloned on a second physical machine, and its function is to take over the access processing received by the target virtual machine, so that during the tuning process of the target virtual machine, the cloned virtual machine can maintain the application service of the target virtual machine to avoid interruption of the application service.
[0092] In an optional implementation, before obtaining the operating parameter information of the target virtual machine, the method further includes:
[0093] Obtain tuning target information and test scripts associated with the target virtual machine;
[0094] The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
[0095] In an embodiment of the present application, the tuning target information and test script may be tuning-related instruction information synchronously input by the user when selecting the target virtual machine, or may be pre-configuration information pre-set and bound to the virtual machine, which is not limited in the embodiment of the present application.
[0096] In an optional implementation, the tuning target information includes: target application performance indicators;
[0097] Tune the target VM according to the tuning policy, including:
[0098] (1) Use the tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance indicators after tuning;
[0099] (2) When the application performance indicator after tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
[0100] In an embodiment of the present application, during the process of tuning the target virtual machine, the tuning strategy provided by the AI tuning engine is first applied to the target virtual machine for tuning, and then the tuned target virtual machine is tested using a test script to obtain the application performance indicator after tuning. If the application performance indicator after tuning can meet the target application performance indicator, it means that the tuning strategy used in this tuning can meet the application performance requirements input by the user, and the tuning can be determined to be completed.
[0101] In an optional implementation manner, the tuning target information further includes: the number of tuning times;
[0102] Tuning the target virtual machine according to the tuning policy also includes:
[0103] (1) When the application performance index after tuning does not meet the target application performance index, the operating parameter information of the tuned target virtual machine is sent to the AI tuning engine to obtain an updated tuning strategy;
[0104] (2) Use the updated tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance indicators after the update and tuning;
[0105] (3) Repeat the steps of obtaining the updated and tuned application performance indicator until the updated and tuned application performance indicator meets the target application performance indicator or the tuning times are reached.
[0106] In an embodiment of the present application, if the application performance indicator after tuning does not meet the target application performance indicator, it means that the tuning strategy used in this tuning cannot meet the application performance requirements input by the user. Therefore, further dynamic tuning is needed. The specific method is to send the operating parameter information of the target virtual machine after this tuning to the AI tuning engine to obtain an updated tuning strategy, and then repeat the tuning and subsequent testing of the target virtual machine based on the updated tuning strategy. This is repeated multiple times until the application performance indicator after the update tuning can meet the target application performance indicator or the number of iterative tuning reaches the number of tuning times input by the user. At this time, it can also be determined that the tuning is completed.
[0107] In an optional implementation, after tuning the target virtual machine according to the tuning policy, the method further includes:
[0108] (1) Synchronizing the application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine;
[0109] (2) obtaining a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data;
[0110] (3) Generate an optimization report based on the first service result and the second service result.
[0111] In an embodiment of the present application, after the target virtual machine completes tuning, the application data of the cloned virtual machine during the tuning process is synchronized to the target virtual machine, and then the two obtain two service results based on the same application data, and a tuning report is generated based on the service results of the two. Since the cloned virtual machine is generated based on the operating parameters of the target virtual machine before tuning, it can be used to reflect the application performance of the target virtual machine before tuning. The service results of the tuned target virtual machine and the cloned virtual machine are summarized into a tuning report, which can directly and clearly compare the application performance changes of the target virtual machine after tuning to determine whether the tuning effect meets the requirements.
[0112] In an optional implementation, before obtaining the operating parameter information of the target virtual machine, the method further includes:
[0113] Taking a snapshot of the target virtual machine to obtain a snapshot result;
[0114] After generating a tuning report according to the first service result and the second service result, the method further includes:
[0115] (1) When the target virtual machine after application tuning is determined according to the tuning report, the cloned virtual machine is destroyed;
[0116] (2) When it is determined according to the tuning report that the tuned target virtual machine is not to be applied, the tuned target virtual machine is rolled back to the target virtual machine before the tuning according to the snapshot result.
[0117] In an embodiment of the present application, when determining the target virtual machine that needs to be tuned, a backup is retained in advance by taking a snapshot. In this way, when it is chosen not to apply the tuning results based on the tuning report, the target virtual machine can be rolled back based on the backup to return it to the state before the tuning; if it is chosen to apply the tuning results based on the tuning report, the cloned virtual machine is destroyed.
[0118] The above-mentioned determination of whether to apply the tuned target virtual machine according to the tuning report can be independently decided by the technical personnel based on the tuning report, or can also be automatically determined based on some parameter indicators in the tuning report using a preset program. The embodiments of the present application do not make specific limitations on this.
[0119] The technical solution of the embodiment of the present application is described below in combination with the system structure:
[0120] The AI intelligent tuning solution for virtual machine application configuration designed in this solution can be implemented through a set of software tools, hereinafter referred to as the intelligent tuning tool. The intelligent tuning tool is generally divided into three parts: the tuning client, the tuning server, and the AI tuning engine. Their relationship with the deployment of virtual machines is as follows: Figure 2a shown.
[0121] The client and server of the intelligent tuning tool are deployed on the same physical machine as the virtual machine to be tuned, and the AI engine of the intelligent tuning tool is deployed on another physical machine. The AI engine can receive access from the tuning server in multiple different physical machines through the network.
[0122] 101 Intelligent Tuning Tool Client: Users use the client to initiate requests to the tuning server to complete operations such as registering the virtual machine to be tuned and starting the tuning task.
[0123] 102 Intelligent tuning tool server: The server receives commands from the client, completes the collection of virtual machine operating parameter information, interacts with the AI engine, optimizes the storage of configuration information, and performs control operations such as starting, stopping, and cloning registered virtual machines.
[0124] 103 Intelligent tuning tool AI engine: Based on the operating parameters submitted by the server, it perceives the application type, completes parameter model training and optimization, and sends the tuned configuration items to the tuning server.
[0125] 104 Virtual machine to be tuned: a virtual machine running a target application, that is, an application to be tuned.
[0126] 105 Clone the virtual machine: To avoid the impact of the tuning operation on the continuity of the application and to improve the tuning accuracy, the virtual machine before tuning is cloned to obtain a cloned virtual machine corresponding to the virtual machine to be tuned.
[0127] The overall process of using intelligent tuning tools to implement intelligent tuning for virtual machine applications is as follows: Figure 2b shown.
[0128] 201 The user uses the tuning tool client to register the virtual machine application to be tuned. When registering, the user needs to provide the application configuration of the virtual machine application, application performance indicators and test scripts, and the expected performance optimization target. The performance optimization target can be the performance indicator reaching the target value, or the optimal value among the dynamic tuning results of a specified number of times.
[0129] 202 Users can use the tuning tool client to start the tuning process for registered virtual machine applications. Before starting the tuning, a snapshot will be taken of the virtual machine; using the snapshot, users can quickly roll back the virtual machine and its applications to the state before the tuning.
[0130] 203 After receiving the startup request for tuning a virtual machine application sent by the client, the tuning tool server starts to collect application running parameters. The collected application running parameters include but are not limited to the configuration parameters of the application itself, the kernel parameters of the virtual machine operating system and related basic software parameters, the virtual machine specification parameters (such as the number of CPU cores, memory size, virtual disk IO parameters), the host machine operating system kernel, related basic software configuration and hardware specifications.
[0131] 204 Using the collected application running parameters and combining with the virtual machine system load, the tuning tool server calls the AI tuning engine interface to intelligently perceive the types of applications in the virtual machine, establish a system profile and classify them, including but not limited to Web, big data, distributed storage and other application types.
[0132] 205 Then, the tuning tool server calls the virtual machine management software interface to clone the corresponding virtual machine and its application program on the physical machine where the AI tuning engine is located based on the collected virtual machine application running parameters, and takes over all accesses to the virtual machine application to be tuned, and forwards the accesses to the corresponding application program in the cloned virtual machine.
[0133] 206 The tuning tool server calls the AI tuning engine interface according to the type of virtual machine application obtained by intelligent perception and the resource usage of its host machine to obtain the static tuning configuration and configuration delivery strategy of the virtual machine application. And the static tuning configuration is delivered to the corresponding virtual machine according to the configuration delivery strategy to make the static tuning configuration effective. The configuration delivery strategy describes the modification method of each configuration item (including executing configuration commands and modifying configuration files), and the method of taking effect (including immediate effect, restarting the application and restarting the virtual machine).
[0134] 207 , for the virtual machine application, uses the test script provided when registering the virtual machine application in 201 to test the application performance index, and obtains the optimized application performance index.
[0135] 208 determines whether the tuning target is achieved. The tuning target is achieved when the application performance index after tuning meets the index provided when registering the virtual machine application in 201 and when the specified dynamic tuning times are reached. For the latter, when the dynamic tuning times are greater than 1, the configuration corresponding to the optimal value among the multiple dynamic tunings needs to be issued.
[0136] 209 When the tuning target has not been reached, a dynamic tuning process will be performed. The dynamic tuning process sends the performance indicator data of the current application, as well as the host and virtual machine system load data, to the AI tuning engine; after receiving the performance indicator and load data, the AI tuning engine combines the previously issued tuning configuration to perform iterative training, and returns a set of dynamic tuning configurations and configuration delivery strategies obtained from this round of training to the tuning tool server. After receiving the dynamic tuning configuration, the tuning tool server modifies the configuration according to the delivery strategy corresponding to the dynamic tuning configuration and makes it effective.
[0137] 210 The tuning tool server synchronizes the application data updates in the cloned virtual machine to the virtual machine to be tuned. Specifically, by comparing the last modification time of the files, all the files in the cloned virtual machine whose last modification time is later than the cloning time and which have not been modified during the tuning process are synchronized to the virtual machine to be tuned.
[0138] The 211 tuning tool server will take over the access to the application of the virtual machine to be tuned, and send it to the virtual machine to be tuned and the cloned virtual machine respectively, and compare the return results of the two to test whether the application of the virtual machine to be tuned functions normally after tuning; the return result of the cloned virtual machine is still returned as the actual service response result. It supports configuring the test time length on the tuning tool server, and uploading custom test scripts to compare whether the execution results of the test scripts are consistent.
[0139] 212 provides a detailed tuning report document, which includes but is not limited to all modified configuration items, the meaning and optimization reasons of each configuration item, the performance indicator values before and after the tuning, and the test results of the application.
[0140] 213 The user determines whether to adopt the configuration value modified by this tuning based on the tuning report document.
[0141] 214 Use the virtual machine snapshot before the tuning is started to restore the virtual machine to be tuned.
[0142] The 215 tuning tool server destroys the corresponding cloned virtual machine from the physical machine where the AI engine is located.
[0143] 216 The tuning process ends.
[0144] See also Figure 3 , an embodiment of the present application provides a virtual machine tuning system 300, including: a first physical machine and a second physical machine, a plurality of virtual machines are deployed in the first physical machine, and an AI tuning engine is deployed in the second physical machine;
[0145] The system also includes:
[0146] A first acquisition module 301 is used to acquire operating parameter information of a target virtual machine, where the target virtual machine is a virtual machine among multiple virtual machines;
[0147] A sending module 302 is used to send the operating parameter information to the AI tuning engine;
[0148] The first generation module 303 is used for the AI tuning engine to generate a tuning strategy according to the operating parameter information;
[0149] The tuning module 304 is used to tune the target virtual machine according to the tuning strategy.
[0150] In an optional embodiment, the system further includes:
[0151] A cloning module, used to generate a clone virtual machine of the target virtual machine on the second physical machine according to the operation parameter information;
[0152] The forwarding module is used to forward the access received by the target virtual machine to the clone virtual machine, and the clone virtual machine processes the access.
[0153] In an optional embodiment, the system further includes:
[0154] A second acquisition module is used to acquire tuning target information and test scripts associated with the target virtual machine before acquiring the operating parameter information of the target virtual machine;
[0155] The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
[0156] In an optional implementation, the tuning target information includes: target application performance indicators;
[0157] Tuning module, specifically used for:
[0158] Use the tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance indicators after tuning;
[0159] When the application performance indicator after tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
[0160] In an optional implementation manner, the tuning target information further includes: the number of tuning times;
[0161] The tuning module is also specifically used for:
[0162] If the application performance index after tuning does not meet the target application performance index, the running parameter information of the tuned target virtual machine is sent to the AI tuning engine to obtain an updated tuning strategy;
[0163] Use the update tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance indicators after the update tuning;
[0164] The steps of obtaining the updated and tuned application performance indicator are repeatedly executed until the updated and tuned application performance indicator meets the target application performance indicator or the tuning times are reached.
[0165] In an optional embodiment, the system further includes:
[0166] A synchronization module, for synchronizing the application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine after the tuning according to the tuning policy;
[0167] A third acquisition module is used to obtain a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data;
[0168] The second generating module is used to generate a tuning report according to the first service result and the second service result.
[0169] In an optional embodiment, the system further includes:
[0170] A snapshot module is used to take a snapshot of the target virtual machine before obtaining the operating parameter information of the target virtual machine to obtain a snapshot result;
[0171] A destroying module, configured to destroy the cloned virtual machine after generating a tuning report according to the first service result and the second service result and determining a target virtual machine after application tuning according to the tuning report;
[0172] The rollback module is used to generate a tuning report based on the first service result and the second service result, and if it is determined according to the tuning report that the tuned target virtual machine should not be applied, roll back the tuned target virtual machine to the target virtual machine before tuning according to the snapshot result.
[0173] See also Figure 4 The embodiment of the present invention provides an electronic device 400, including: at least one processor 401, a memory 402, a user interface 403 and at least one network interface 404. The components in the electronic device 400 are coupled together via a bus system 405.
[0174] It is understood that the bus system 405 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. Figure 4 Various buses are labeled as bus system 405 .
[0175] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen, etc.).
[0176] It is understood that the memory 402 in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The memory 402 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0177] In some implementations, the memory 402 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and an application 4022 .
[0178] The operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 4022 includes various application programs, such as a media player, a browser, etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 4022.
[0179] In the embodiment of the present invention, the electronic device 400 may further include: a program stored in the memory 402 and executable on the processor 401, which implements the steps of the method provided in the embodiment of the present invention when executed by the processor 401.
[0180] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a computer-readable storage medium mature in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The computer-readable storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware. Specifically, a computer program is stored on the computer-readable storage medium.
[0181] It is to be understood that the embodiments described in the embodiments of the present invention may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more ASICs, DSPs, digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), FPGAs, general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application or a combination thereof.
[0182] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned xxx method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0183] The processor is the processor in the terminal described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk. In some examples, the readable storage medium may be a non-transient readable storage medium.
[0184] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0185] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0186] The embodiments of the present application further provide a computer program / program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0187] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0188] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general hardware platform, and of course, can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, disk, CD, etc.), including several instructions to enable a terminal or a network-side device to execute the methods described in each embodiment of the present application.
[0189] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of the present application and the scope of protection of the claims, and these implementation methods are all within the protection of the present application.
Claims
1. A virtual machine tuning method, characterized in that: include: Obtaining the operating parameter information of the target virtual machine; Sending the operating parameter information to the AI tuning engine; The AI tuning engine generates a tuning strategy according to the operating parameter information; Tuning the target virtual machine according to the tuning strategy; The target virtual machine is deployed on a first physical machine, and the AI tuning engine is deployed on a second physical machine.
2. The method according to claim 1, characterized in that The method further comprises: Generating a clone virtual machine of the target virtual machine on the second physical machine according to the operating parameter information; The access received by the target virtual machine is forwarded to the clone virtual machine, and the clone virtual machine processes the access.
3. The method according to claim 2, characterized in that Before obtaining the operating parameter information of the target virtual machine, the method further includes: Obtaining tuning target information and test scripts associated with the target virtual machine; The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
4. The method according to claim 3, characterized in that The tuning target information includes: target application performance indicators; The step of tuning the target virtual machine according to the tuning strategy includes: Tuning the target virtual machine using the tuning strategy, and testing the target virtual machine using the test script to obtain a performance indicator of the application after tuning; When the application performance indicator after the tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
5. The method according to claim 4, characterized in that The tuning target information also includes: the number of tuning times; The tuning of the target virtual machine according to the tuning strategy also includes: When the application performance indicator after the tuning does not meet the target application performance indicator, the operating parameter information of the target virtual machine after the tuning is sent to the AI tuning engine to obtain an updated tuning strategy; Use the update tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance index after the update tuning; The step of obtaining the updated and tuned application performance indicator is repeatedly performed until the updated and tuned application performance indicator meets the target application performance indicator or reaches the tuning times.
6. The method according to claim 2, characterized in that After tuning the target virtual machine according to the tuning strategy, the method further includes: Synchronizing application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine; Acquire a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data; Generate a tuning report according to the first service result and the second service result.
7. The method according to claim 6, characterized in that Before obtaining the operating parameter information of the target virtual machine, the method further includes: Taking a snapshot of the target virtual machine to obtain a snapshot result; After generating a tuning report according to the first service result and the second service result, the method further includes: When the target virtual machine after application tuning is determined according to the tuning report, destroying the cloned virtual machine; In the case that it is determined according to the tuning report that the tuned target virtual machine is not to be applied, the tuned target virtual machine is rolled back to the target virtual machine before the tuning according to the snapshot taking result.
8. A virtual machine tuning system, characterized in that: include: A first physical machine and a second physical machine, wherein a plurality of virtual machines are deployed in the first physical machine, and an AI tuning engine is deployed in the second physical machine; The system further comprises: A first acquisition module, configured to acquire operating parameter information of a target virtual machine, wherein the target virtual machine is a virtual machine among the multiple virtual machines; A sending module, used to send the operating parameter information to the AI tuning engine; A first generating module, configured for the AI tuning engine to generate a tuning strategy according to the operating parameter information; A tuning module is used to tune the target virtual machine according to the tuning strategy.
9. The system according to claim 8, characterized in that The system further comprises: A cloning module, configured to generate a clone virtual machine of the target virtual machine on the second physical machine according to the operating parameter information; The forwarding module is used to forward the access received by the target virtual machine to the clone virtual machine, and the clone virtual machine processes the access.
10. The system according to claim 9, characterized in that The system further comprises: A second acquisition module is used to acquire tuning target information and test scripts associated with the target virtual machine before acquiring the operating parameter information of the target virtual machine; The test script is used to test the application performance of the target virtual machine after tuning, and the tuning target information is used to verify whether the application performance of the target virtual machine after tuning reaches the tuning target.
11. The system according to claim 10, characterized in that The tuning target information includes: target application performance indicators; The tuning module is specifically used for: Tuning the target virtual machine using the tuning strategy, and testing the target virtual machine using the test script to obtain a performance indicator of the application after tuning; When the application performance indicator after the tuning meets the target application performance indicator, it is determined that the tuning of the target virtual machine is completed.
12. The system according to claim 11, characterized in that The tuning target information also includes: the number of tuning times; The tuning module is also specifically used for: When the application performance indicator after the tuning does not meet the target application performance indicator, the operating parameter information of the target virtual machine after the tuning is sent to the AI tuning engine to obtain an updated tuning strategy; Use the update tuning strategy to tune the target virtual machine, and use the test script to test the target virtual machine to obtain the application performance index after the update tuning; The step of obtaining the updated and tuned application performance indicator is repeatedly performed until the updated and tuned application performance indicator meets the target application performance indicator or reaches the tuning times.
13. The system according to claim 9, characterized in that The system further comprises: A synchronization module, configured to synchronize the application data of the cloned virtual machine during the tuning of the target virtual machine to the tuned target virtual machine after the tuning is performed on the target virtual machine according to the tuning policy; A third acquisition module is used to acquire a first service result obtained by the cloned virtual machine based on the application data, and a second service result obtained by the tuned target virtual machine based on the application data; The second generating module is used to generate a tuning report according to the first service result and the second service result.
14. The system according to claim 13, characterized in that The system further comprises: A snapshot module is used to take a snapshot of the target virtual machine before obtaining the operating parameter information of the target virtual machine to obtain a snapshot result; A destroying module, configured to, after generating a tuning report according to the first service result and the second service result, destroy the cloned virtual machine when the target virtual machine after application tuning is determined according to the tuning report; A rollback module is used to generate a tuning report based on the first service result and the second service result, and if it is determined according to the tuning report that the tuned target virtual machine should not be applied, roll back the tuned target virtual machine to the target virtual machine before tuning based on the snapshot result.
15. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of virtual machine tuning as described in any one of claims 1 to 7 are implemented.
16. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of virtual machine tuning as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Performance tuning method, device, cloud server, storage medium and program product
CN119759481A