Method, device, medium and system for determining optimal deployment mode of micro service
The method automates the scoring and scaling of microservices to determine the optimal deployment, addressing the inefficiencies of manual methods and improving processing capacity by optimizing server resource utilization.
Patent Information
- Application Number
- CN202411411345.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-03
AI Technical Summary
Existing methods for determining the optimal deployment of microservices require manual adjustments, consuming significant time and resources, and there is a need for a more efficient approach to maximize system processing capacity.
A method involving automatic scoring and scaling of microservices to determine the optimal deployment mode, including obtaining comprehensive scores, scaling down servers based on these scores, and reallocating idle servers to improve processing efficiency.
This approach significantly reduces the time required to determine the optimal deployment, enhancing efficiency by automating the process and optimizing server resource utilization.
Smart Images

Figure CN119248294A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of microservice technology, and more specifically, to a method, device, medium and system for determining an optimal deployment mode of a microservice. Background Art
[0002] For microservice applications, the deployment method and number of microservice instances have a great impact on the system processing capacity. Under the condition that the number of deployable servers is certain, what service deployment method should be adopted to fully utilize server resources and maximize the system processing capacity has always been a difficult problem that plagues development, testing, and operation and maintenance. The traditional method is generally to constantly adjust the service deployment method and the number of instances through manual means to obtain the best service deployment method and number of instances. This method requires a lot of manpower and time costs.
[0003] That is, the existing solution uses manual means to adjust the microservice deployment method, which makes it take a long time to determine the optimal microservice deployment method. Summary of the invention
[0004] The main purpose of the present application is to provide a method, device, medium and system for determining the optimal deployment mode of a microservice, so as to at least solve the problem that the existing solution uses manual means to adjust the microservice deployment mode, thereby taking a long time to determine the optimal microservice deployment mode.
[0005] In order to achieve the above objective, according to one aspect of the present application, a method for determining an optimal deployment mode of a microservice is provided, the method comprising:
[0006] Obtaining comprehensive scores of various microservices to obtain multiple first comprehensive scores; and performing scaling processing on at least part of all servers according to all the first comprehensive scores to generate at least one new deployment mode to increase the number of idle servers until the decrease range of the highest TPS of the deployment mode corresponding to the currently scaled-down target microservice category is greater than or equal to a preset range, wherein the comprehensive scores of various microservices represent the processing efficiency of various microservices, and the target microservice category is the category of all the microservices to be scaled-down;
[0007] Obtaining the comprehensive scores of each type of the microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores to generate at least one new deployment mode until there are no idle servers;
[0008] Determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
[0009] Optionally, according to all the first comprehensive scores, scaling down is performed on at least part of all the servers to generate at least one new deployment mode, including:
[0010] Determine that the target microservice category is a microservice category corresponding to the first comprehensive score being less than a preset score;
[0011] Determine that the TPS difference of the target microservice is the difference between the highest TPS of the current deployment mode of the target microservice and the highest TPS of the previous deployment mode, and the target microservice is a microservice in the target microservice category;
[0012] When the TPS difference of the target microservice is greater than or equal to a preset difference, determining a TPS difference of a microservice other than the target microservice in the target microservice category;
[0013] When the TPS difference of the target microservice is less than the preset difference, the target microservice is deleted from the target server, the target server is modified to an idle server, and a new deployment mode is generated.
[0014] Optionally, increasing the number of servers in a server group corresponding to a maximum value among all the second comprehensive scores to generate at least one new deployment mode includes:
[0015] Allocate one of the idle servers to a target server group, and generate a new deployment mode, wherein the target server group is the server group corresponding to the maximum value of all the second comprehensive scores.
[0016] Optionally, obtain the comprehensive scores of various microservices, including:
[0017] according to Determine the comprehensive score of each type of microservice, where P 1 is the comprehensive score of each type of microservices, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the ith indicator, n is the total number of indicators, and T is the number of servers corresponding to each type of microservice.
[0018] Optionally, the comprehensive scores of the current deployment modes are determined to obtain a plurality of third comprehensive scores, including:
[0019] according to Determine the third comprehensive score, where P 2 For the third comprehensive score, F 1is the initial deployment equal share, F 2 For the current deployment, TPS 1 is the initial TPS, TPS 2 is the current TPS, F 3 is the idle server utilization rate, A 1 , A 2 , A 3 are the first weight value, the second weight value, and the third weight value respectively, A 4 is the score coefficient.
[0020] Optionally, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes:
[0021] according to and Determine the initial deployment share and the current deployment share, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the i-th indicator, n is the total number of indicators, T s is the total number of initial servers, T p The current number of servers.
[0022] Optionally, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes:
[0023] according to Determine the idle server utilization rate, where T b is the number of initial idle servers.
[0024] According to another aspect of the present application, a device for determining an optimal deployment mode of a microservice is provided, the device comprising:
[0025] A first acquisition unit is used to acquire comprehensive scores of various microservices to obtain multiple first comprehensive scores; and according to all the first comprehensive scores, at least part of all the servers are scaled down to generate at least one new deployment mode to increase the number of idle servers until the decrease range of the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is greater than or equal to the preset range, wherein the comprehensive scores of various microservices represent the processing efficiency of the various microservices, and the target microservice category is the category of all the microservices to be scaled down;
[0026] A second acquisition unit is used to obtain the comprehensive scores of each type of the microservices again to obtain multiple second comprehensive scores; and increase the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores, and generate at least one new deployment mode until there are no idle servers;
[0027] The determination unit is used to determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
[0028] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute a method for determining an optimal deployment mode of any one of the microservices.
[0029] According to another aspect of the present application, a system for determining an optimal deployment mode of a microservice is provided, the system comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining an optimal deployment mode for executing any one of the microservices.
[0030] By applying the technical solution of the present application, at least part of all servers are scaled down according to all the first comprehensive scores to generate at least one new deployment method to increase the number of idle servers until the decrease in the highest TPS of the deployment method corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores is increased to generate at least one new deployment method until there are no idle servers, so that the idle servers can be called more effectively, and finally the comprehensive scores of the current deployment methods are determined to obtain multiple third comprehensive scores, and the optimal deployment method is determined to be the maximum value of all the third comprehensive scores. Compared with the existing solutions, the time required for determining the optimal microservice deployment method of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing solution uses manual means to adjust the microservice deployment method, so that it takes a long time to determine the optimal microservice deployment method. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0032] Figure 1 A schematic diagram of a process for determining an optimal deployment mode of a microservice provided in accordance with an embodiment of the present application is shown;
[0033] Figure 2 A schematic diagram of a process of performing downscaling processing on at least part of all servers provided in accordance with an embodiment of the present application is shown;
[0034] Figure 3 A schematic diagram of a process of increasing the number of servers in a server group corresponding to the maximum value among all second comprehensive scores provided in an embodiment of the present application is shown;
[0035] Figure 4 A schematic diagram showing a flow chart of a method for determining another optimal deployment mode of a microservice provided according to an embodiment of the present application;
[0036] Figure 5 A structural block diagram of a device for determining an optimal deployment mode of a microservice provided in accordance with an embodiment of the present application is shown. DETAILED DESCRIPTION
[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0038] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0041] The maximum permissible fluctuation range of TPS refers to the maximum fluctuation range allowed for the system's ability to process transactions (Transactions Per Second) within a certain time frame. This range is usually set by system administrators or developers to ensure that the system can still operate stably under high load. Exceeding the maximum permissible fluctuation range may cause system performance degradation or system crash.
[0042] As introduced in the background technology, for microservice applications, the microservice deployment method and the number of instances have a great impact on the system processing capacity. Under the condition that the number of deployable servers is certain, what service deployment method should be adopted to fully utilize server resources and maximize the system processing capacity has always been a problem that plagues development, testing, and operation and maintenance. The traditional method is generally to continuously adjust the service deployment method and the number of instances by manual means to obtain the best service deployment method and the number of instances. This method requires a lot of manpower and time costs. In order to solve the problem that the existing solution uses manual means to adjust the microservice deployment method, so that it takes a long time to determine the optimal microservice deployment method, the embodiments of the present application provide a method, device, medium and system for determining the optimal deployment method of a microservice.
[0043] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0044] In this embodiment, a method for determining the optimal deployment mode of a microservice is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] Figure 1 FIG. 1 is a flow chart of a method for determining an optimal deployment mode of a microservice provided in accordance with an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0046] Step S101, obtaining comprehensive scores of various microservices to obtain multiple first comprehensive scores; and performing scaling processing on at least part of all servers according to all the first comprehensive scores, generating at least one new deployment mode to increase the number of idle servers, until the decrease range of the highest TPS of the deployment mode corresponding to the currently scaled-down target microservice category is greater than or equal to the preset range, the comprehensive scores of the above-mentioned various microservices represent the processing efficiency of the above-mentioned various microservices, and the above-mentioned target microservice category is the category of all the above-mentioned microservices to be scaled-down;
[0047] The decrease in the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is the difference between the highest TPS of the deployment mode corresponding to the target microservice category before the current scaling down and the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down. The decrease in the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is greater than or equal to the preset range (i.e. 5% of the highest TPS of the deployment mode corresponding to the target microservice category before the current scaling down). If it exceeds 5%, scaling down is not allowed, the scaling down process of the microservice of this category is terminated, and the scaling down process of other scalable microservices is continued; if the microservice of this category can be continuously scaled down, and it is necessary to determine whether the number of microservices of this category is greater than or equal to the preset minimum deployment number (which can be 2), if it is greater than the minimum deployment number, it can be scaled down, otherwise the scaling down process of the microservice is terminated, and the processing of other scalable microservices is continued.
[0048] Specifically, the basic configuration needs to configure preset conditions to provide support for subsequent microservice scaling and expansion. This includes microservice IP lists, blank device IP lists (server ranges participating in elastic scaling); testing the maximum allowable fluctuation range (difference) of TPS (when the TPS decline range exceeds the fluctuation range, it means that the adjustment of this deployment method is not effective and needs to be rolled back); microservice categories and the corresponding minimum number of deployments (the minimum configuration for each type of microservice, scaling can only be performed when the number of microservice deployments is greater than the minimum number of deployments), and corresponding start and stop service scripts (one-click service start and stop); microservice scaling preset scores (preset microservice scaling scores, if a certain type of microservice scores lower than the preset score, it can enter the scaled microservice range); setting microservice scoring factors and corresponding weights (based on the application type, such as CPU-intensive, IO-intensive, etc., select the test indicators (factors) that need to be focused on, and set the corresponding factor weights).
[0049] In one embodiment of the present application, Figure 2 As shown, in step S101, at least part of all servers are scaled down according to all first comprehensive scores to generate at least one new deployment method, including:
[0050] Determine the target microservice category as a microservice category corresponding to the first comprehensive score being less than a preset score;
[0051] Determine that the TPS difference of the target microservice is the difference between the highest TPS of the current deployment mode of the target microservice and the highest TPS of the previous deployment mode, and the target microservice is a microservice in the target microservice category;
[0052] When the TPS difference of the target microservice is greater than or equal to a preset difference, determine the TPS difference of a microservice other than the target microservice in the target microservice category;
[0053] When the TPS difference of the target microservice is less than the preset difference, the target microservice is deleted from the target server, the target server is modified to an idle server, and a new deployment mode is generated.
[0054] Specifically, automatically locate the inflection point of the performance test: automatically find the performance inflection point according to the current deployment method, record TPS, response time, service deployment information and resource information, and the preset difference can be set accordingly according to the range of the TPS difference. The preset score is less than 5% of the TPS. Depending on whether the above TPS difference of the target microservice is less than the above preset difference, delete the above target microservice from the target server, modify the above target server to an idle server, and generate a new deployment method, or determine the TPS difference of a microservice other than the above target microservice in the above target microservice category, that is, find the TPS difference of the next category of microservices.
[0055] In one embodiment of the present application, the comprehensive scores of various microservices are obtained, including:
[0056] according to Determine the above comprehensive scores for each of the above microservices, where P 1 is the above comprehensive score of each type of microservices, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the ith indicator, n is the total number of indicators, and T is the number of servers corresponding to each of the above microservices.
[0057] Specifically, the processing efficiency level of microservices is characterized by scoring, as shown in Table 1. Taking n indicators as an example, the i-th indicator is represented by k i Indicates that the weight of this indicator is R i .
[0058] Table 1
[0059]
[0060]
[0061] Individual index Z i =S i / M i ,
[0062] Single indicator score Fi = Individual index × indicator weight = Z i ×R i ,
[0063] The comprehensive score of a single microservice machine is
[0064] The weights of each indicator and
[0065] The comprehensive score of a single microservice machine is
[0066] Suppose there are T machines in this type of microservice, and the jth machine consists of T j If it means:
[0067] The comprehensive score of this type of microservices:
[0068] Step S102, obtaining the comprehensive scores of each type of the above microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the above second comprehensive scores to generate at least one new deployment mode until there are no idle servers;
[0069] Specifically, similar to step S101 for obtaining the comprehensive score, which will not be elaborated here, by increasing the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores, it is to use all currently idle servers in the processing of various microservices, improve the processing efficiency of the new deployment method, and facilitate the subsequent optimal deployment method.
[0070] In one embodiment of the present application, Figure 3 As shown, in step S102, increasing the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores to generate at least one new deployment method includes:
[0071] Allocate one of all the idle servers to a target server group, and generate a new deployment mode. The target server group is the server group corresponding to the maximum value of all the second comprehensive scores.
[0072] Specifically, for example, the second comprehensive scores have three values, A, B, and C, which are in descending order, then the server group corresponding to A is taken as the target server group to improve the processing efficiency of the target server group.
[0073] Step S103, determining the comprehensive scores of the current deployment modes, obtaining a plurality of third comprehensive scores, and determining the optimal deployment mode as the maximum value of all the third comprehensive scores.
[0074] In the above steps, at least part of all the servers are scaled down according to all the first comprehensive scores to generate at least one new deployment method to increase the number of idle servers until the decrease in the highest TPS of the deployment method corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then the number of servers in the server group corresponding to the maximum value of all the above second comprehensive scores is increased to generate at least one new deployment method until there are no idle servers, so that the idle servers can be called more effectively, and finally the comprehensive scores of the current deployment methods are determined to obtain multiple third comprehensive scores, and the optimal deployment method is determined to be the maximum value of all the above third comprehensive scores. Compared with the existing solutions, the time required to determine the optimal microservice deployment method of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing solution uses manual means to adjust the microservice deployment method, so that it takes a long time to determine the optimal microservice deployment method.
[0075] In one embodiment of the present application, the comprehensive scores of the current deployment modes are determined in step S103 to obtain multiple third comprehensive scores, including:
[0076] according to Determine the third comprehensive score above, where P 2 is the third comprehensive score mentioned above, F 1 is the initial deployment equal share, F 2 For the current deployment, TPS 1 is the initial TPS, TPS 2 is the current TPS, F 3 is the idle server utilization rate, A 1 , A 2 , A 3 are the first weight value, the second weight value, and the third weight value respectively, A 4 is the score coefficient.
[0077] Specifically, the third comprehensive score can be used to analyze the resource utilization efficiency of the system under different deployment modes, that is, the maximum system processing capacity that the system can provide under different server idle levels. The larger the score, the more effective the deployment mode is in making the most effective use of server resources and providing the best system processing capacity TPS.
[0078] In one embodiment of the present application, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes:
[0079] according to and Determine the initial deployment share and the current deployment share, Si is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the i-th indicator, n is the total number of indicators, T s is the total number of initial servers, T p The current number of servers.
[0080] Specifically, it is the same as the above comprehensive score of microservices, so I will not go into details here.
[0081] In one embodiment of the present application, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes:
[0082] according to Determine the idle server utilization rate, where T b is the number of initial idle servers.
[0083] Specifically, by considering the number of initial idle servers, the total number of initial servers and the number of current servers, the idle server utilization rate can better reflect the actual working conditions.
[0084] This application uses the automatic positioning performance test inflection point method and microservice scoring method to determine the scope of microservices that can be scaled, and adjusts service deployment through iterative dynamic microservice scaling (scaling one microservice instance at a time) to achieve an automatic scaling process for microservice deployment. While ensuring the system's processing capacity, the system's minimized deployment method and idle servers for subsequent microservice expansion can be obtained.
[0085] This application uses the automatic positioning performance test inflection point method and the microservice scoring method to deploy the microservice instances with the highest scores to idle servers one by one (each time the deployment method is adjusted, the automatic positioning performance test inflection point method is required to locate the maximum TPS and calculate the microservice with the highest score), thereby realizing the automatic expansion process of microservice deployment.
[0086] This application can automatically generate test capability analysis reports under different deployment methods, including TPS, response time, resource utilization, service deployment methods, etc., which can be used to quickly compare performance differences under different deployment methods and provide data support for system online deployment; in addition, using data such as TPS, resource utilization (CPU, memory, network, disk, etc.), number of servers, etc., this application generates comprehensive scores under different microservice deployment methods, thereby recommending the best deployment method for microservices.
[0087] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for determining the optimal deployment mode of the microservices of the present application will be described in detail below in combination with specific embodiments.
[0088] This embodiment relates to a specific method for determining the optimal deployment mode of microservices, such as Figure 4 As shown, including:
[0089] Obtaining comprehensive scores of various microservices to obtain a plurality of first comprehensive scores; determining the target microservice category as a microservice category corresponding to a first comprehensive score less than a preset score;
[0090] Determine that the TPS difference of the target microservice is the difference between the highest TPS of the current deployment mode of the target microservice and the highest TPS of the previous deployment mode, and the target microservice is a microservice in the target microservice category;
[0091] When the TPS difference of the target microservice is greater than or equal to the preset difference, determine the TPS difference of a microservice other than the target microservice in the target microservice category;
[0092] When the TPS difference of the target microservice is less than the preset difference, the target microservice is deleted from the target server, and the target server is modified to an idle server, and a new deployment mode is generated to increase the number of idle servers, until the decrease in the highest TPS of the deployment mode corresponding to the currently scaled-down target microservice category is greater than or equal to the preset range. The comprehensive score of each microservice represents the processing efficiency of each microservice, and the target microservice category is the category of all microservices to be scaled-down;
[0093] Obtain the comprehensive scores of various microservices again to obtain multiple second comprehensive scores; allocate one of all idle servers to the target server group, generate a new deployment mode, and generate at least one new deployment mode until there are no idle servers, and the target server group is the server group corresponding to the maximum value of all the second comprehensive scores;
[0094] Determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
[0095] By scaling down at least part of all servers according to all the first comprehensive scores, at least one new deployment method is generated to increase the number of idle servers until the decrease in the highest TPS of the deployment method corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then the number of servers in the server group corresponding to the maximum value of all the above second comprehensive scores is increased to generate at least one new deployment method until there are no idle servers, so that the idle servers can be called more effectively, and finally the comprehensive scores of the current deployment methods are determined to obtain multiple third comprehensive scores, and the optimal deployment method is determined to be the maximum value of all the above third comprehensive scores. Compared with the existing solutions, the time required for determining the optimal microservice deployment method of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing solution uses manual means to adjust the microservice deployment method, so that it takes a long time to determine the optimal microservice deployment method.
[0096] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0097] The embodiment of the present application also provides a device for determining the optimal deployment mode of a microservice. It should be noted that the device for determining the optimal deployment mode of a microservice in the embodiment of the present application can be used to execute the method for determining the optimal deployment mode for a microservice provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0098] The following introduces a device for determining the optimal deployment method of microservices provided in an embodiment of the present application.
[0099] Figure 5 1 is a structural block diagram of a device for determining an optimal deployment mode of a microservice provided in accordance with an embodiment of the present application. Figure 5 As shown, the device comprises:
[0100] The first acquisition unit 51 is used to obtain the comprehensive scores of various microservices to obtain multiple first comprehensive scores; and according to all the first comprehensive scores, at least part of all the servers are scaled down to generate at least one new deployment mode to increase the number of idle servers until the decrease range of the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is greater than or equal to the preset range, the comprehensive scores of the various microservices represent the processing efficiency of the various microservices, and the target microservice category is the category of all the microservices to be scaled down;
[0101] The second acquisition unit 52 is used to obtain the comprehensive scores of each type of the above-mentioned microservices again to obtain multiple second comprehensive scores; and increase the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores, and generate at least one new deployment mode until there are no idle servers;
[0102] The determination unit 53 is used to determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
[0103] In the above-mentioned device, at least part of all the servers are scaled down according to all the first comprehensive scores to generate at least one new deployment method to increase the number of idle servers until the decrease in the highest TPS of the deployment method corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores is increased to generate at least one new deployment method until there are no idle servers, so that the idle servers can be called more effectively, and finally the comprehensive scores of the current deployment methods are determined to obtain multiple third comprehensive scores, and the optimal deployment method is determined to be the maximum value of all the above-mentioned third comprehensive scores. Compared with the existing scheme, the time required for determining the optimal microservice deployment method of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing scheme uses manual means to adjust the microservice deployment method, so that it takes a long time to determine the optimal microservice deployment method.
[0104] In one embodiment of the present application, the first acquisition unit includes a first determination module, a second determination module, a third determination module and a first processing module;
[0105] The first determination module is used to determine that the target microservice category is a microservice category corresponding to the first comprehensive score being less than a preset score;
[0106] The second determination module is used to determine that the TPS difference of the target microservice is the difference between the highest TPS of the current deployment mode of the target microservice and the highest TPS of the previous deployment mode, and the target microservice is a microservice in the target microservice category;
[0107] The third determination module is used to determine the TPS difference of a microservice other than the target microservice in the target microservice category when the TPS difference of the target microservice is greater than or equal to a preset difference;
[0108] The first processing module is used to delete the target microservice from the target server when the TPS difference of the target microservice is less than the preset difference, modify the target server to an idle server, and generate a new deployment mode.
[0109] In one embodiment of the present application, the second acquisition unit includes a second processing module.
[0110] The second processing module is used to allocate one of all the idle servers to a target server group and generate a new deployment mode, wherein the target server group is the server group corresponding to the maximum value of all the second comprehensive scores.
[0111] In one embodiment of the present application, the first acquisition unit includes a fourth determination module.
[0112] The fourth determination module is used to determine Determine the above comprehensive scores for each of the above microservices, where P 1 is the above comprehensive score of each type of microservices, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the ith indicator, n is the total number of indicators, and T is the number of servers corresponding to each of the above microservices.
[0113] In one embodiment of the present application, the determining unit includes a fifth determining module,
[0114] The fifth determination module is used to determine Determine the third comprehensive score above, where P 2 is the third comprehensive score mentioned above, F 1 is the initial deployment equal share, F 2 For the current deployment, TPS 1 is the initial TPS, TPS 2 is the current TPS, F 3 is the idle server utilization rate, A 1 , A 2 , A3 are the first weight value, the second weight value, and the third weight value respectively, A 4 is the score coefficient.
[0115] In one embodiment of the present application, the apparatus further includes a first processing unit, which, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores,
[0116] The first processing unit is used to and Determine the initial deployment share and the current deployment share, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the i-th indicator, n is the total number of indicators, T s is the total number of initial servers, T p The current number of servers.
[0117] In one embodiment of the present application, the apparatus further includes a second processing unit, which, before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores,
[0118] The second processing unit is used to Determine the idle server utilization rate, where T b is the number of initial idle servers.
[0119] The above-mentioned device for determining the optimal deployment mode of the microservice includes a processor and a memory, and the above-mentioned first acquisition unit, the second acquisition unit and the determination unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
[0120] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem that the existing solution uses manual means to adjust the microservice deployment method, which makes it take a long time to determine the optimal microservice deployment method.
[0121] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0122] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, a method for determining an optimal deployment mode of controlling a device where the computer-readable storage medium is located to execute the microservice is provided.
[0123] An embodiment of the present invention provides a processor, which is used to run a program, wherein when the program is running, a method for determining an optimal deployment mode of the microservice is executed.
[0124] The embodiment of the present invention provides a device, the device includes a processor, a memory and a program stored in the memory and can be run on the processor, and the processor implements at least the following steps when executing the program: obtaining the comprehensive scores of various microservices to obtain multiple first comprehensive scores; and according to all the first comprehensive scores, performing scaling processing on at least part of all the servers to generate at least one new deployment mode to increase the number of idle servers until the maximum TPS of the deployment mode corresponding to the currently scaled target microservice category is greater than or equal to the preset range, and the comprehensive scores of the above-mentioned various microservices represent the processing efficiency of the above-mentioned various microservices, and the above-mentioned target microservice category is the category of all the above-mentioned microservices to be scaled; obtaining the comprehensive scores of the above-mentioned various microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores to generate at least one new deployment mode until there is no idle server; determining the comprehensive scores of the current deployment modes to obtain multiple third comprehensive scores, and determining the optimal deployment mode as the maximum value of all the above-mentioned third comprehensive scores. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0125] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with at least the following method steps: obtaining comprehensive scores of various types of microservices to obtain multiple first comprehensive scores; and based on all the first comprehensive scores, performing scaling processing on at least part of all the servers to generate at least one new deployment method to increase the number of idle servers until the decrease in the highest TPS of the deployment method corresponding to the target microservice category after the current scaling is greater than or equal to a preset range, the comprehensive scores of the above-mentioned various types of microservices characterize the processing efficiency of the above-mentioned various types of microservices, and the above-mentioned target microservice category is the category of all the above-mentioned microservices to be scaled; obtaining the comprehensive scores of the above-mentioned various types of microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores to generate at least one new deployment method until there are no idle servers; determining the comprehensive scores of the current deployment methods to obtain multiple third comprehensive scores, and determining the optimal deployment method as the maximum value of all the above-mentioned third comprehensive scores.
[0126] The present application also provides a system for determining the optimal deployment mode of a microservice, the system comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a method for determining the optimal deployment mode of any of the above-mentioned microservices. By scaling down at least part of all servers according to all the first comprehensive scores, generating at least one new deployment mode to increase the number of idle servers until the maximum TPS of the deployment mode corresponding to the currently scaled-down target microservice category is greater than or equal to the preset range, then increasing the number of servers in the server group corresponding to the maximum value of all the above-mentioned second comprehensive scores, generating at least one new deployment mode, until there are no idle servers, so that the idle servers can be called more effectively, and finally determining the comprehensive scores of the current deployment modes, obtaining multiple third comprehensive scores, and determining the optimal deployment mode as the maximum value of all the above-mentioned third comprehensive scores. Compared with the existing scheme, the time required for determining the optimal microservice deployment mode of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing scheme uses manual means to adjust the microservice deployment mode, so that the time required to determine the optimal microservice deployment mode is longer.
[0127] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0134] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0137] 1) The method for determining the optimal deployment mode of a microservice of the present application is to scale down at least part of all servers according to all the first comprehensive scores to generate at least one new deployment mode to increase the number of idle servers until the decrease in the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then increase the number of servers in the server group corresponding to the maximum value of all the above second comprehensive scores to generate at least one new deployment mode until there are no idle servers, so that the idle servers can be called more effectively, and finally determine the comprehensive scores of the current deployment modes to obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the above third comprehensive scores. Compared with the existing solutions, the time required for determining the optimal microservice deployment mode of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing solution uses manual means to adjust the microservice deployment mode, so that it takes a long time to determine the optimal microservice deployment mode.
[0138] 2) The device for determining the optimal deployment mode of the microservice of the present application generates at least one new deployment mode by scaling down at least part of all the servers according to all the first comprehensive scores to increase the number of idle servers until the decrease in the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling is greater than or equal to the preset range, and then increases the number of servers in the server group corresponding to the maximum value of all the above second comprehensive scores to generate at least one new deployment mode until there are no idle servers, so that the idle servers can be called more effectively, and finally determines the comprehensive scores of the current deployment modes to obtain multiple third comprehensive scores, and determines the optimal deployment mode as the maximum value of all the above third comprehensive scores. Compared with the existing scheme, the time required for determining the optimal microservice deployment mode of the present application is shorter, so that the efficiency is improved, thereby solving the problem that the existing scheme uses manual means to adjust the microservice deployment mode, so that it takes a long time to determine the optimal microservice deployment mode.
[0139] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining an optimal deployment mode of a microservice, characterized in that: include: Obtain the comprehensive scores of various microservices and obtain multiple first comprehensive scores; And according to all the first comprehensive scores, at least part of all the servers are scaled down to generate at least one new deployment mode to increase the number of idle servers, until the decrease range of the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is greater than or equal to the preset range, the comprehensive scores of the various microservices represent the processing efficiency of the various microservices, and the target microservice category is the category of all the microservices to be scaled down; Obtaining the comprehensive scores of each type of microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores, generating at least one new deployment mode, until there are no idle servers; Determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
2. The method according to claim 1, characterized in that According to all the first comprehensive scores, scaling down is performed on at least part of all the servers to generate at least one new deployment mode, including: Determine that the target microservice category is a microservice category corresponding to the first comprehensive score being less than a preset score; Determine that the TPS difference of the target microservice is the difference between the highest TPS of the current deployment mode of the target microservice and the highest TPS of the previous deployment mode, and the target microservice is a microservice in the target microservice category; When the TPS difference of the target microservice is greater than or equal to a preset difference, determining a TPS difference of a microservice other than the target microservice in the target microservice category; When the TPS difference of the target microservice is less than the preset difference, the target microservice is deleted from the target server, the target server is modified to an idle server, and a new deployment mode is generated.
3. The method according to claim 1, characterized in that Increasing the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores to generate at least one new deployment mode, including: Allocate one of the idle servers to a target server group, and generate a new deployment mode, wherein the target server group is the server group corresponding to the maximum value of all the second comprehensive scores.
4. The method according to claim 1, characterized in that: Get a comprehensive score for each microservice, including: according to Determine the comprehensive score of each type of microservice, where P1 is the comprehensive score of each type of microservice, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the ith indicator, n is the total number of indicators, and T is the number of servers corresponding to each type of microservice.
5. The method according to claim 1, characterized in that Determine the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, including: according to Determine the third comprehensive score, where P2 is the third comprehensive score, F1 is the initial deployment average score, F2 is the current deployment average score, TPS1 is the initial TPS, TPS2 is the current TPS, F3 is the idle server utilization rate, A1, A2, A3 are the first weight value, the second weight value, and the third weight value, respectively, and A4 is the score coefficient.
6. The method according to claim 5, characterized in that Before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes: according to and Determine the initial deployment share and the current deployment share, S i is the actual value of the ith indicator, M i is the standard value of the ith indicator, R i is the weight value of the i-th indicator, n is the total number of indicators, T s is the total number of initial servers, T p The current number of servers.
7. The method according to claim 5, characterized in that Before determining the comprehensive scores of the current deployment modes to obtain a plurality of third comprehensive scores, the method further includes: according to Determine the idle server utilization rate, where T b is the number of initial idle servers.
8. A device for determining an optimal deployment mode of a microservice, characterized in that: include: A first acquisition unit is used to acquire comprehensive scores of various microservices to obtain multiple first comprehensive scores; And according to all the first comprehensive scores, at least part of all the servers are scaled down to generate at least one new deployment mode to increase the number of idle servers, until the decrease range of the highest TPS of the deployment mode corresponding to the target microservice category after the current scaling down is greater than or equal to the preset range, the comprehensive scores of the various microservices represent the processing efficiency of the various microservices, and the target microservice category is the category of all the microservices to be scaled down; A second acquisition unit is used to acquire the comprehensive scores of each type of microservices again to obtain multiple second comprehensive scores; and increasing the number of servers in the server group corresponding to the maximum value of all the second comprehensive scores, generating at least one new deployment mode, until there are no idle servers; The determination unit is used to determine the comprehensive scores of the current deployment modes, obtain multiple third comprehensive scores, and determine the optimal deployment mode as the maximum value of all the third comprehensive scores.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the optimal deployment mode of the microservice according to any one of claims 1 to 7.
10. A system for determining the optimal deployment mode of microservices, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining an optimal deployment method for executing the microservice described in any one of claims 1 to 7.
