Capacity adjustment method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202210455436.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-04-24
AI Technical Summary
[0007]本发明的主要目的在于提供一种容量调整方法、装置、设备及存储介质,旨在解决现有技术无法高效且准确的进行容量调整的技术问题
[0045] This invention obtains the application operation information of each target application in a target application set; selects applications to be adjusted from the target application set based on the application operation information and preset thread utilization, and determines the scaling up/down quantity corresponding to each application to be adjusted; applies circuit breaker protection restrictions to the applications to be adjusted and the scaling up/down quantity, and generates a capacity adjustment plan; and performs capacity adjustment according to the capacity adjustment plan. Since the scaling up/down quantity of each application can be accurately calculated based on the application operation information, and applications requiring capacity adjustment are selected, no large amount of manpower or complex calculations are required, thus achieving efficient and accurate application capacity adjustment. Furthermore, circuit breaker protection restrictions are implemented before capacity adjustment to prevent instability of the business system due to excessive adjustment, improving the reliability of the capacity adjustment method of this invention.
Smart Images

Figure CN116991533B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a capacity adjustment method, apparatus, device, and storage medium. Background Technology
[0002] Capacity management has always been a major challenge for operations and maintenance (O&M) personnel. Effectively balancing cost and quality to achieve maximum capacity with minimal resources is the ultimate goal of every O&M professional. Especially with the impact of internet business models, operators are increasingly experimenting with marketing activities such as flash sales and live streaming, where the sudden surge in traffic severely tests system capacity.
[0003] Existing technologies typically employ capacity planning methods based on end-to-end stress testing or capacity management methods based on elastic scaling of operational metrics for capacity adjustment. However, existing technologies have the following drawbacks when adjusting capacity:
[0004] When capacity planning is based on end-to-end load testing, the capacity assessment results obtained from the load testing are highly coupled with the system modules and business scenarios at the time of the load testing. However, cloud-native architectures iterate rapidly and business models are constantly changing, causing the capacity assessment results from the load testing to become inapplicable after a single deployment change. Moreover, end-to-end load testing in production environments is generally conducted during off-peak hours at night, resulting in extremely long testing times and requiring significant manpower for each result assessment. Consequently, capacity planning based on end-to-end load testing suffers from poor timeliness and extremely high costs.
[0005] While elastic capacity management based on operational metrics can only determine whether expansion or contraction criteria have been met, it cannot accurately calculate the amount of expansion or contraction, leading to resource waste and extremely low accuracy in capacity management. Furthermore, some application modules may create the illusion of busy / idle resource usage while waiting for responses from downstream applications, potentially causing misjudgments and affecting the stable operation of the production system.
[0006] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0007] The main objective of this invention is to provide a capacity adjustment method, apparatus, device, and storage medium, aiming to solve the technical problem that existing technologies cannot perform capacity adjustment efficiently and accurately.
[0008] To achieve the above objectives, the present invention provides a capacity adjustment method, the method comprising the following steps:
[0009] Obtain application runtime information for each target application in the target application set;
[0010] Based on the application running information and preset thread utilization, select applications to be adjusted from the target application set, and determine the scaling up or down quantity corresponding to each application to be adjusted;
[0011] The application to be adjusted and the number of expansion / contraction operations are subject to circuit breaker protection restrictions, and a capacity adjustment plan is generated.
[0012] Capacity adjustments will be made in accordance with the aforementioned capacity adjustment plan.
[0013] Optionally, the step of applying circuit breaker protection to the application to be adjusted and the number of expansions / contractions, and generating a capacity adjustment plan, includes:
[0014] Obtain historical capacity adjustment plans, and filter the applications to be adjusted according to the historical capacity adjustment plans to obtain the applications planned for adjustment;
[0015] The number of applications to be expanded or shrunk in each plan is limited according to a preset quantity threshold, so as to obtain the number of applications to be adjusted in each plan.
[0016] Obtain a preset adjustment interval, and generate a capacity adjustment plan based on the preset adjustment interval, the planned adjustment applications, and the number of applications to be adjusted.
[0017] Optionally, the step of filtering the applications to be adjusted according to the historical capacity adjustment plan to obtain the applications planned for adjustment includes:
[0018] The previous adjustment time corresponding to each application to be adjusted is determined based on the historical capacity adjustment plan.
[0019] The adjustment interval duration for each application to be adjusted is determined based on the previous adjustment time and the current system time.
[0020] Applications whose adjustment interval is greater than or equal to the preset duration threshold are designated as planned adjustment applications.
[0021] Optionally, the step of filtering the applications to be adjusted according to the historical capacity adjustment plan to obtain the applications to be adjusted includes:
[0022] The number of times each application to be adjusted has been adjusted within the preset detection period is determined based on the historical capacity plan.
[0023] Applications that have been adjusted less than the preset adjustment threshold are designated as planned adjustment applications.
[0024] Optionally, after the step of adjusting the capacity according to the capacity adjustment plan, the method further includes:
[0025] When the optimization analysis function is triggered, the application directed graph corresponding to the target application set is obtained, and the application to be managed is selected from the target application set;
[0026] Perform permanent capacity management on the applications to be managed;
[0027] Upon completion of the governance process, the upstream application corresponding to the application to be governed is obtained based on the application directed graph.
[0028] Permanent capacity management is performed on the upstream application.
[0029] Optionally, the step of selecting applications to be governed from the target application set includes:
[0030] Applications to be selected are selected from the target application set based on the application directed graph;
[0031] Obtain the number of capacity changes for each application to be selected within a preset analysis period;
[0032] Applications whose corresponding capacity change count is greater than or equal to the preset optimization threshold are selected as applications to be addressed.
[0033] Optionally, the step of performing permanent capacity management on the upstream application includes:
[0034] Obtain the historical capacity change times corresponding to the application to be governed, and obtain the first set of change times;
[0035] Obtain the historical capacity change times corresponding to the upstream application to obtain a second set of change times;
[0036] Based on the first set of change times and the second set of change times, determine whether the upstream application changes capacity at the same frequency as the application to be governed;
[0037] If so, then permanent capacity management will be performed on the upstream application.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes a capacity adjustment device, which includes the following modules:
[0039] The information acquisition module is used to acquire application operation information of each target application in the target application set;
[0040] The scaling determination module is used to select applications to be adjusted from the target application set based on the application running information and preset thread utilization, and to determine the scaling capacity corresponding to each application to be adjusted.
[0041] The planning adjustment module is used to apply circuit breaker protection restrictions to the application to be adjusted and the number of expansions and contractions, and generate a capacity adjustment plan.
[0042] The capacity adjustment module is used to adjust the capacity according to the capacity adjustment plan.
[0043] Furthermore, to achieve the above objectives, the present invention also proposes a capacity adjustment device, which includes: a processor, a memory, and a capacity adjustment program stored in the memory and executable on the processor. When the capacity adjustment program is executed by the processor, it implements the steps of the capacity adjustment method described above.
[0044] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a capacity adjustment program, which, when executed, implements the steps of the capacity adjustment method described above.
[0045] This invention obtains the application operation information of each target application in a target application set; selects applications to be adjusted from the target application set based on the application operation information and preset thread utilization, and determines the scaling up / down quantity corresponding to each application to be adjusted; applies circuit breaker protection restrictions to the applications to be adjusted and the scaling up / down quantity, and generates a capacity adjustment plan; and performs capacity adjustment according to the capacity adjustment plan. Since the scaling up / down quantity of each application can be accurately calculated based on the application operation information, and applications requiring capacity adjustment are selected, no large amount of manpower or complex calculations are required, thus achieving efficient and accurate application capacity adjustment. Furthermore, circuit breaker protection restrictions are implemented before capacity adjustment to prevent instability of the business system due to excessive adjustment, improving the reliability of the capacity adjustment method of this invention. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the structure of an electronic device in the hardware operating environment involved in the embodiments of the present invention;
[0047] Figure 2 This is a flowchart illustrating the first embodiment of the capacity adjustment method of the present invention;
[0048] Figure 3 This is a flowchart illustrating the second embodiment of the capacity adjustment method of the present invention;
[0049] Figure 4 This is a structural block diagram of the first embodiment of the capacity adjustment device of the present invention.
[0050] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0051] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0052] Reference Figure 1 , Figure 1 This is a schematic diagram of the capacity adjustment device structure of the hardware operating environment involved in the embodiment of the present invention.
[0053] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0054] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0055] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a capacity adjustment program.
[0056] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the capacity adjustment device. The electronic device calls the capacity adjustment program stored in the memory 1005 through the processor 1001 and executes the capacity adjustment method provided in the embodiment of the present invention.
[0057] This invention provides a capacity adjustment method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating a first embodiment of a capacity adjustment method according to the present invention.
[0058] In this embodiment, the capacity adjustment method includes the following steps:
[0059] Step S10: Obtain the application running information of each target application in the target application set.
[0060] It should be noted that the execution subject of this embodiment can be the capacity adjustment device, which can be a personal computer, server or other electronic device, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the capacity adjustment device is used as an example to illustrate the capacity adjustment method of the present invention.
[0061] It's important to note that modern software development utilizes microservices. Different microservices can be deployed in different containers (servers or virtual machines, etc.) to provide business services. An application can be a group of containers that provide the same business service. For example, if containers A, B, and C all provide registration services, then containers A, B, and C together constitute one application. The target application can be an application managed by the capacity adjustment device. The target application set can include application information for all target applications managed by the capacity adjustment device. Application runtime information can include information such as the response time of business requests in the application, the total number of requests in the cluster, the maximum number of threads in a single container, and the current total number of containers.
[0062] In practical use, the maximum number of threads per container can be preset by the administrator of the capacity adjustment device based on the container's performance parameters. The current total number of containers can be the total number of containers currently included in the application. The total number of cluster requests can be the total number of requests received by all containers of the application within a preset statistical time period. The preset time period can be set by the administrator of the capacity adjustment device according to actual needs, for example, setting the preset time period to 1 minute.
[0063] In practical implementation, the capacity adjustment device can be connected to a database that stores application information of the target application, such as system identifier, module identifier, and container identifier. The capacity adjustment device can read various information of the target application from the database to obtain the target application set. Obtaining the application runtime information of the target application can be achieved by accessing the target application based on its application information and then collecting the application runtime information.
[0064] Step S20: Select applications to be adjusted from the target application set according to the application running information and preset thread utilization, and determine the scaling up and down quantity corresponding to each application to be adjusted.
[0065] It should be noted that the preset thread utilization rate can be set in advance by the administrator of the capacity adjustment device, and different applications can correspond to different preset thread utilization rates.
[0066] In practical use, applications to be adjusted are selected from the target application set based on application running information and preset thread utilization. The scaling up and down quantity corresponding to each application to be adjusted can be determined by first calculating the container quota Q required by the application based on the application running information and preset thread utilization. Then, the container quota Q is compared with the current total number of containers N in the application running information. If the current total number of containers N is inconsistent with the container quota Q, the application can be regarded as the application to be adjusted, and the scaling up and down quantity C corresponding to the application to be adjusted is C = QN. Where C > 0, it means that C containers need to be expanded; if C < 0, it means that C containers need to be shrunk.
[0067] In practical use, the container quota Q for an application can be determined by calculating the container quota based on application runtime information and preset thread utilization using the container quota calculation formula. The container quota calculation formula is as follows:
[0068]
[0069] In the formula, Q is the container quota, K is the preset thread utilization rate corresponding to the application, t is the business request response time contained in the application running information, R is the total number of cluster requests contained in the application running information, T is the maximum number of threads in a single container contained in the application running information, and S is the preset time period used to count the total number of cluster requests, in seconds.
[0070] Step S30: Apply circuit breaker protection to the application to be adjusted and the number of expansions and contractions, and generate a capacity adjustment plan.
[0071] It should be noted that the number of applications to be adjusted may be too large, and the number of scaling up or down may also be too large. If too many applications are scaled up or down at once, or too many containers are scaled up or down at once, or the frequency of scaling up or down is too high, it may lead to a decrease in the stability of the overall business system, and in severe cases, it may even directly cause the business system to crash. In order to avoid this phenomenon, after determining the applications to be adjusted and the corresponding scaling up or down number of each application, it is necessary to implement circuit breaker protection restrictions on the applications to be adjusted and the scaling up or down number. Then, a capacity adjustment plan is generated based on the restricted applications to be adjusted and the scaling up or down number. At this time, it can be guaranteed that the generated capacity adjustment plan will not lead to a decrease in the stability of the business system.
[0072] Furthermore, to ensure that the generated capacity adjustment plan does not lead to a decrease in the stability of the business system, step S30 in this embodiment may include:
[0073] Obtain historical capacity adjustment plans, and filter the applications to be adjusted according to the historical capacity adjustment plans to obtain the applications planned for adjustment;
[0074] The number of applications to be expanded or shrunk in each plan is limited according to a preset quantity threshold, so as to obtain the number of applications to be adjusted in each plan.
[0075] Obtain a preset adjustment interval, and generate a capacity adjustment plan based on the preset adjustment interval, the planned adjustment applications, and the number of applications to be adjusted.
[0076] It should be noted that the historical capacity adjustment plan can be the capacity adjustment plan used in previous capacity adjustments. The preset adjustment interval can be set in advance by the administrator of the capacity adjustment equipment based on the effective duration of capacity expansion and contraction. The applications to be adjusted are filtered according to the historical capacity adjustment plan to obtain the planned adjustment applications. This can be done by filtering the applications to be adjusted according to the historical capacity adjustment plan, removing applications that are adjusted too frequently, and using the remaining applications as the planned adjustment applications.
[0077] In practical use, the expansion / shrinkage quantities corresponding to each planned adjustment application are limited according to a preset quantity threshold. The quantity to be adjusted for each planned adjustment application can be obtained by comparing the expansion / shrinkage quantity for each application with the preset quantity threshold. If the expansion / shrinkage quantity is greater than the preset quantity threshold, the preset quantity threshold is used as the quantity to be adjusted for the planned adjustment application; if the expansion / shrinkage quantity is less than or equal to the preset quantity threshold, the expansion / shrinkage quantity is used as the quantity to be adjusted for the planned adjustment application. The preset quantity threshold can be pre-set by the administrator of the capacity adjustment device, for example, setting the preset quantity threshold to 5.
[0078] In practical use, when generating a capacity adjustment plan based on the preset adjustment interval, the planned adjustment applications, and the quantity to be adjusted corresponding to each planned adjustment application, the application adjustment order can be determined first based on the priority of each planned adjustment application, and then the capacity adjustment plan can be generated based on the application adjustment order, the preset adjustment interval, the planned adjustment applications, and the quantity to be adjusted corresponding to each planned adjustment application.
[0079] In a specific implementation, determining whether an application to be adjusted is being adjusted too frequently can be done based on the time of the last capacity adjustment of that application and the current time. Therefore, the step described in this embodiment of filtering applications to be adjusted based on the historical capacity adjustment plan to obtain applications scheduled for adjustment may include:
[0080] The previous adjustment time corresponding to each application to be adjusted is determined based on the historical capacity adjustment plan.
[0081] The adjustment interval duration for each application to be adjusted is determined based on the previous adjustment time and the current system time.
[0082] Applications whose adjustment interval is greater than or equal to the preset duration threshold are designated as planned adjustment applications.
[0083] It should be noted that the initial adjustment time can be the most recent time when the application to be adjusted underwent capacity adjustment. The adjustment interval for the application to be adjusted can be determined by using the absolute value of the difference between the previous adjustment time and the current system time. The preset time threshold can be pre-set by the administrator of the capacity adjustment device based on the time from the start of scaling up / down to its detection by the business system. For example, assuming there is approximately a 10-minute time difference between the business system detecting the scaling up / down and its taking effect, the preset time threshold can be set to 10 minutes.
[0084] Understandably, if the adjustment interval for an application to be adjusted is less than the preset time threshold, it means that the application has already undergone capacity adjustment, but the adjustment may not have taken effect yet. If the application is adjusted again at this time, the stability of the business system may be affected due to the excessive adjustment frequency. Therefore, applications to be adjusted with an adjustment interval less than the preset time threshold can be cleared, and applications to be adjusted with an adjustment interval greater than or equal to the preset time threshold can be designated as planned adjustment applications.
[0085] In a specific implementation, determining whether an application to be adjusted is being adjusted too frequently can also be based on the number of times the application is adjusted within a unit of time. In this case, the step described in this embodiment of filtering applications to be adjusted based on the historical capacity adjustment plan to obtain applications scheduled for adjustment may include:
[0086] The number of times each application to be adjusted has been adjusted within the preset detection period is determined based on the historical capacity plan.
[0087] Applications that have been adjusted less than the preset adjustment threshold are designated as planned adjustment applications.
[0088] It should be noted that the preset detection period can be set in advance by the administrator of the capacity adjustment equipment. Determining the number of times the application to be adjusted has been adjusted within the preset detection period based on historical capacity plans can be done by determining the current detection time range based on the preset detection period and the current system time, then counting the number of times the adjustment time of the application to be adjusted in the historical capacity plans falls within the current detection time range, and using this count as the number of adjustments. For example, assuming the preset detection period is set to 10 minutes and the current system time is 9:00, the current detection time range is [8:50-9:00]. If the number of times the adjustment time of the application to be adjusted falls within the current detection time range in the historical capacity plans is 2, then the number of adjustments is 2.
[0089] Understandably, if the number of adjustments is greater than or equal to the preset adjustment threshold, it means that the application to be adjusted has already undergone multiple capacity adjustments in a short period of time. If the capacity of the application to be adjusted is adjusted again at this time, it may affect the stability of the business system due to the excessive adjustment frequency. Therefore, the application to be adjusted with the corresponding number of adjustments greater than or equal to the preset adjustment threshold can be removed, and the application to be adjusted with the corresponding number of adjustments less than the preset adjustment threshold can be designated as the application to be adjusted.
[0090] In a specific implementation, the two different determination methods mentioned above can be combined to determine whether an application to be adjusted is being adjusted too frequently, and this embodiment does not limit this.
[0091] Step S40: Perform capacity adjustment according to the capacity adjustment plan.
[0092] It should be noted that capacity adjustment according to the capacity adjustment plan can be performed by reading data from the capacity adjustment plan, and then adjusting the capacity of each application to be adjusted in sequence according to the read application to be adjusted, the number of applications to be adjusted corresponding to each application, the order of application adjustment, and the planned adjustment interval.
[0093] For example: Suppose that the planned adjustment applications read are four, A, B, C, and D, and the quantities to be adjusted for each planned adjustment application are 2, -1, 3, and -2 respectively. The application adjustment order is BCAD, and the planned adjustment interval is 30 seconds. Then the capacity adjustment process is as follows: First, reduce the capacity of application B by 1 container and wait for 30 seconds. Then, increase the capacity of application C by 3 containers and wait for 30 seconds. Then, increase the capacity of application A by 2 containers and wait for 30 seconds. Finally, reduce the capacity of application D by 2 containers.
[0094] This embodiment obtains the application operation information of each target application in the target application set; selects applications to be adjusted from the target application set based on the application operation information and preset thread utilization, and determines the scaling up / down quantity corresponding to each application to be adjusted; applies circuit breaker protection restrictions to the applications to be adjusted and the scaling up / down quantity, and generates a capacity adjustment plan; and performs capacity adjustment according to the capacity adjustment plan. Since the scaling up / down quantity of each application can be accurately calculated based on the application operation information, and the applications that need capacity adjustment are screened out, no large amount of manpower or complex calculations are required, thus achieving efficient and accurate capacity adjustment of applications. Furthermore, circuit breaker protection restrictions are applied before capacity adjustment to avoid instability of the business system due to excessive adjustment, improving the reliability of the capacity adjustment method of this invention.
[0095] refer to Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of a capacity adjustment method according to the present invention.
[0096] Based on the first embodiment described above, the capacity adjustment method of this embodiment further includes, after step S40:
[0097] Step S50: When the optimization analysis function is triggered, obtain the application directed graph corresponding to the target application set, and select the application to be managed from the target application set.
[0098] It should be noted that the optimization analysis function can be triggered by user operation of the capacity adjustment device, such as when a user clicks the adjustment analysis function button. Alternatively, it can be triggered by the capacity adjustment device when it detects that system operating information meets preset trigger conditions. For example, assuming the preset trigger condition is 3:00 AM on the 1st of each month, the capacity adjustment device will trigger the optimization analysis function when it detects that the system is running at 3:00 AM on the 1st of the current month. The directed graph corresponding to the target application set can be a directed graph constructed based on the target applications that have undergone capacity adjustments (expansion or reduction) and the call relationships between these target applications.
[0099] It should be noted that if an application frequently triggers scaling up or down, it may cause instability in the business system, thereby affecting the operation of the business system and even causing some anomalies. For such applications that frequently trigger scaling up or down, additional processing is required. In this case, the application to be managed can be selected from the target application set as the application with the highest scaling up or down frequency.
[0100] Furthermore, not all applications with high scaling frequencies are due to their own inherent issues; that is, not all applications with high scaling frequencies require permanent capacity management. To accurately identify applications requiring permanent capacity management, permanent capacity management can be performed first on the most downstream applications, and then gradually on the upstream applications. The step of selecting applications to be managed from the target application set described in this embodiment may include:
[0101] Applications to be selected are selected from the target application set based on the application directed graph;
[0102] Obtain the number of capacity changes for each application to be selected within a preset analysis period;
[0103] Applications whose corresponding capacity change count is greater than or equal to the preset optimization threshold are selected as applications to be addressed.
[0104] It should be noted that selecting candidate applications from the target application set based on the application directed graph can be done by statistically analyzing the out-degree of each application in the application directed graph, and selecting applications with an out-degree of 0, i.e., applications without downstream applications, as candidate applications. The preset analysis period can be set by the administrator of the capacity adjustment equipment according to actual needs, for example, setting the preset analysis period to within 30 days.
[0105] In practical use, obtaining the number of capacity changes of the selected application within a preset analysis period can be done by counting the number of times the selected application experienced capacity changes within the preset analysis period, and then using the counted number as the number of capacity changes.
[0106] It is understandable that if the number of capacity changes is greater than or equal to the preset optimization threshold, it means that the scaling up and down frequency of the application to be selected exceeds the preset optimization threshold, and permanent capacity management is required for the application to be selected. In this case, the application to be selected with the corresponding number of capacity changes greater than or equal to the preset optimization threshold can be selected as the application to be managed.
[0107] Step S60: Perform permanent capacity management on the application to be managed.
[0108] It is understandable that the application to be governed is one that frequently triggers scaling up and down. Therefore, it is necessary to adjust the capacity of the application to be governed to minimize the frequency of scaling up and down.
[0109] In practical use, permanent capacity management of an application to be managed can be achieved by adjusting the number of containers of the application to be managed to the maximum value of the containers during its multiple scaling up and down processes, thereby avoiding the application to be managed from frequently triggering scaling up and down.
[0110] Step S70: When governance is completed, obtain the upstream application corresponding to the application to be governed according to the application directed graph.
[0111] It should be noted that the upstream application corresponding to the application to be governed is the application that calls the application to be governed. Because the application to be governed frequently triggers scaling up and down, its upstream application may also frequently scale up and down. Therefore, it is necessary to perform permanent capacity governance on its upstream application as well.
[0112] In practical applications, obtaining the upstream application corresponding to the application to be governed based on the application directed graph can be done by determining the upstream application corresponding to the application to be governed based on the connection relationship in the application directed graph.
[0113] Step S80: Perform permanent capacity management on the upstream application.
[0114] Understandably, permanent capacity management for upstream applications could also involve adjusting the number of containers in the upstream application to the maximum value of containers during its multiple scaling-up and scaling-down processes, thereby preventing the upstream application from frequently triggering scaling-up and scaling-down.
[0115] Furthermore, since upstream applications may experience service congestion due to waiting for responses from downstream applications, resulting in pseudo-scaling, permanent capacity management of such upstream applications could lead to resource waste. To avoid this phenomenon, step S80 in this embodiment may include:
[0116] Obtain the historical capacity change times corresponding to the application to be governed, and obtain the first set of change times;
[0117] Obtain the historical capacity change times corresponding to the upstream application to obtain a second set of change times;
[0118] Based on the first set of change times and the second set of change times, determine whether the upstream application changes capacity at the same frequency as the application to be governed;
[0119] If so, then permanent capacity management will be performed on the upstream application.
[0120] It should be noted that determining whether the upstream application's capacity changes at the same frequency as the application to be governed, based on the first and second sets of change times, can be done by determining whether the upstream application's capacity change times are all later than the application to be governed's capacity change times. If the upstream application's capacity change times are all later than the application to be governed's capacity change times, it can be determined that the upstream application's capacity changes at the same frequency as the application to be governed. In this case, it indicates that the upstream application has experienced false scaling up or down, and permanent capacity governance is not required for the upstream application. However, if the upstream application's capacity change times are not all later than the application to be governed's capacity change times, it indicates that the frequent scaling up or down of the upstream application is caused by its own anomaly, and permanent capacity governance is required for the upstream application.
[0121] This embodiment obtains the directed graph of the target application set when the optimization analysis function is triggered, and selects applications to be managed from the target application set; performs permanent capacity management on the applications to be managed; upon completion of management, obtains the upstream applications corresponding to the applications to be managed based on the directed graph of the application set; and performs permanent capacity management on the upstream applications. Since the optimization analysis function selects target applications with high scaling frequencies from the target application set as applications to be managed when triggered, and performs permanent capacity management on the applications to be managed and their upstream applications, elastic scaling operations can be minimized, improving the stability of the business system.
[0122] Furthermore, embodiments of the present invention also propose a storage medium storing a capacity adjustment program, wherein when the capacity adjustment program is executed by a processor, it implements the steps of the capacity adjustment method described above.
[0123] Reference Figure 4 , Figure 4This is a structural block diagram of the first embodiment of the capacity adjustment device of the present invention.
[0124] like Figure 4 As shown, the capacity adjustment device proposed in this embodiment of the invention includes:
[0125] Information acquisition module 10 is used to acquire application operation information of each target application in the target application set;
[0126] The scaling determination module 20 is used to select applications to be adjusted from the target application set based on the application running information and preset thread utilization, and to determine the scaling capacity corresponding to each application to be adjusted.
[0127] The planning adjustment module 30 is used to apply circuit breaker protection restrictions to the application to be adjusted and the number of expansion and contraction, and generate a capacity adjustment plan.
[0128] The capacity adjustment module 40 is used to adjust the capacity according to the capacity adjustment plan.
[0129] This embodiment obtains the application operation information of each target application in the target application set; selects applications to be adjusted from the target application set based on the application operation information and preset thread utilization, and determines the scaling up / down quantity corresponding to each application to be adjusted; applies circuit breaker protection restrictions to the applications to be adjusted and the scaling up / down quantity, and generates a capacity adjustment plan; and performs capacity adjustment according to the capacity adjustment plan. Since the scaling up / down quantity of each application can be accurately calculated based on the application operation information, and the applications that need capacity adjustment are screened out, no large amount of manpower or complex calculations are required, thus achieving efficient and accurate capacity adjustment of applications. Furthermore, circuit breaker protection restrictions are applied before capacity adjustment to avoid instability of the business system due to excessive adjustment, improving the reliability of the capacity adjustment method of this invention.
[0130] Furthermore, the planning adjustment module 30 is also used to obtain historical capacity adjustment plans, filter the applications to be adjusted according to the historical capacity adjustment plans, and obtain the planned adjustment applications; limit the expansion and contraction quantities corresponding to each planned adjustment application according to a preset quantity threshold, and obtain the quantity to be adjusted corresponding to each planned adjustment application; obtain a preset adjustment interval, and generate a capacity adjustment plan according to the preset adjustment interval, the planned adjustment applications, and the quantity to be adjusted corresponding to each planned adjustment application.
[0131] Furthermore, the planning adjustment module 30 is also used to determine the previous adjustment time corresponding to each application to be adjusted according to the historical capacity adjustment plan; determine the adjustment interval duration corresponding to each application to be adjusted according to the previous adjustment time and the current system time; and select the applications to be adjusted whose corresponding adjustment interval duration is greater than or equal to a preset duration threshold as planned adjustment applications.
[0132] Furthermore, the planning adjustment module 30 is also used to determine the number of times each application to be adjusted has been adjusted within a preset detection period based on the historical capacity plan; and to designate applications to be adjusted with a number of adjustments less than a preset adjustment number threshold as planned adjustment applications.
[0133] Furthermore, the capacity adjustment module 40 is also used to obtain the application directed graph corresponding to the target application set when the optimization analysis function is triggered, and select the application to be managed from the target application set; perform permanent capacity management on the application to be managed; when the management is completed, obtain the upstream application corresponding to the application to be managed according to the application directed graph; and perform permanent capacity management on the upstream application.
[0134] Furthermore, the capacity adjustment module 40 is also used to select applications to be selected from the target application set according to the application directed graph; obtain the number of capacity changes of each application to be selected within a preset analysis period; and select applications to be selected whose corresponding number of capacity changes is greater than or equal to a preset optimization threshold as applications to be managed.
[0135] Furthermore, the capacity adjustment module 40 is also used to obtain the historical capacity change times corresponding to the application to be governed, and obtain a first set of change times; obtain the historical capacity change times corresponding to the upstream application, and obtain a second set of change times; determine whether the upstream application changes capacity at the same frequency as the application to be governed based on the first set of change times and the second set of change times; if so, perform permanent capacity governance on the upstream application.
[0136] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0137] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0138] In addition, for technical details not described in detail in this embodiment, please refer to the capacity adjustment method provided in any embodiment of the present invention, which will not be repeated here.
[0139] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0140] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0142] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A capacity adjustment method, characterized in that, The capacity adjustment method includes the following steps: Obtain application runtime information for each target application in the target application set; Based on the application running information and preset thread utilization, select applications to be adjusted from the target application set, and determine the scaling up or down quantity corresponding to each application to be adjusted; The application to be adjusted and the number of expansion / contraction operations are subject to circuit breaker protection restrictions, and a capacity adjustment plan is generated. Capacity adjustments shall be made in accordance with the aforementioned capacity adjustment plan; The step of applying circuit breaker protection to limit the application to be adjusted and the number of capacity expansions / contractions, and generating a capacity adjustment plan, includes: Obtain historical capacity adjustment plans, and filter the applications to be adjusted according to the historical capacity adjustment plans to obtain the applications planned for adjustment; The number of applications to be expanded or shrunk in each plan is limited according to a preset quantity threshold, so as to obtain the number of applications to be adjusted in each plan. Obtain a preset adjustment interval, and generate a capacity adjustment plan based on the preset adjustment interval, the planned adjustment applications, and the number of applications to be adjusted.
2. The capacity adjustment method as described in claim 1, characterized in that, The step of filtering the applications to be adjusted according to the historical capacity adjustment plan to obtain the applications planned for adjustment includes: The previous adjustment time corresponding to each application to be adjusted is determined based on the historical capacity adjustment plan. The adjustment interval duration for each application to be adjusted is determined based on the previous adjustment time and the current system time. Applications whose adjustment interval is greater than or equal to the preset duration threshold are designated as planned adjustment applications.
3. The capacity adjustment method as described in claim 1, characterized in that, The step of filtering the applications to be adjusted according to the historical capacity adjustment plan to obtain the applications planned for adjustment includes: The number of times each application to be adjusted has been adjusted within the preset detection period is determined based on the historical capacity plan. Applications that have been adjusted less than the preset adjustment threshold are designated as planned adjustment applications.
4. The capacity adjustment method according to any one of claims 1-3, characterized in that, Following the step of adjusting capacity according to the capacity adjustment plan, the method further includes: When the optimization analysis function is triggered, the application directed graph corresponding to the target application set is obtained, and the application to be managed is selected from the target application set; Perform permanent capacity management on the applications to be managed; Upon completion of the governance process, the upstream application corresponding to the application to be governed is obtained based on the application directed graph. Permanent capacity management is performed on the upstream application.
5. The capacity adjustment method as described in claim 4, characterized in that, The step of selecting applications to be governed from the target application set includes: Applications to be selected are selected from the target application set based on the application directed graph; Obtain the number of capacity changes for each application to be selected within a preset analysis period; Applications whose corresponding capacity change count is greater than or equal to the preset optimization threshold are selected as applications to be addressed.
6. The capacity adjustment method as described in claim 4, characterized in that, The step of performing permanent capacity management on the upstream application includes: Obtain the historical capacity change times corresponding to the application to be governed, and obtain the first set of change times; Obtain the historical capacity change times corresponding to the upstream application to obtain a second set of change times; Based on the first set of change times and the second set of change times, determine whether the upstream application changes capacity at the same frequency as the application to be governed; If so, then permanent capacity management will be performed on the upstream application.
7. A capacity adjustment device, characterized in that, The capacity adjustment device includes the following modules: The information acquisition module is used to acquire application operation information of each target application in the target application set; The scaling determination module is used to select applications to be adjusted from the target application set based on the application running information and preset thread utilization, and to determine the scaling capacity corresponding to each application to be adjusted. The planning adjustment module is used to apply circuit breaker protection restrictions to the application to be adjusted and the number of expansions and contractions, and generate a capacity adjustment plan. A capacity adjustment module is used to adjust the capacity according to the capacity adjustment plan; The planning adjustment module is further configured to obtain historical capacity adjustment plans, filter the applications to be adjusted according to the historical capacity adjustment plans, and obtain the applications to be adjusted; and limit the expansion and contraction quantities corresponding to each application to be adjusted according to a preset quantity threshold, thereby obtaining the quantity to be adjusted corresponding to each application to be adjusted. Obtain a preset adjustment interval, and generate a capacity adjustment plan based on the preset adjustment interval, the planned adjustment applications, and the number of applications to be adjusted.
8. A capacity adjustment device, characterized in that, The capacity adjustment device includes: a processor, a memory, and a capacity adjustment program stored in the memory and executable on the processor, wherein when the capacity adjustment program is executed by the processor, it implements the steps of the capacity adjustment method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a capacity adjustment program, which, when executed, implements the steps of the capacity adjustment method as described in any one of claims 1-6.
Citation Information
Patent Citations
System resource allocation adjustment method and device
CN108664321A
Method, system and device for positioning micro-service fusing abnormity and medium
CN112187511A