A business- and result-oriented elastic scaling method
By predicting peak load periods, formulating and adjusting planned expansion strategies in real time, the problems of lag in scaling up and down and disconnection from business operations in existing technologies have been solved, achieving system stability and meeting business needs during peak load periods.
Patent Information
- Application Number
- CN202410176473.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-02-08
AI Technical Summary
Existing elastic scaling mechanisms are lagging and cannot meet the needs of businesses with high real-time requirements. Frequent scaling processes cause resource consumption and instability, and scaling is disconnected from business operations, failing to achieve the expected business results.
By analyzing historical expansion data to predict peak load periods, we formulate planned expansion strategies and expand capacity in advance before peak load periods; we monitor business and system indicators in real time to adjust expansion strategies and optimize the expansion and contraction process to meet business needs.
This effectively avoids lag in scaling up and down, reduces losses caused by frequent scaling up and down, and ensures system stability and meets business needs during peak load periods.
Smart Images

Figure CN118069291B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to a business and result-oriented elastic expansion and contraction method. Background Art
[0002] Most applications are often overloaded during use, which can lead to system performance degradation, response delays, and even downtime and system crashes. Although the system can be expanded manually to solve the problem after the problem is discovered, there are also problems such as inability to respond immediately, high operation and maintenance costs, and easy errors. With the development and maturity of cloud computing technology, elastic scaling technology has also emerged. This technology can monitor the system load and dynamically adjust the resources required for system operation, such as the number of nodes, storage, and memory resources, to provide better performance and availability. Among them, Kubernetes has become a representative technology for achieving elastic scaling of clusters by leveraging the advantages of cloud native.
[0003] Existing scaling technologies monitor the application load by collecting metrics for each container and calculating their resource usage. Horizontal scaling (creating or reducing the number of application containers) or vertical scaling (adjusting the CPU, memory, and other quotas of application containers) based on load changes can greatly improve resource utilization and effectively reduce the system failure rate caused by excessive load.
[0004] However, the elastic scaling mechanism of the existing technology also has some shortcomings: since it needs to initiate scaling only when it detects that the load exceeds a certain threshold, and there is a cooling period after each scaling to determine whether the load is controlled within the threshold, if it is not reached, the next scaling will continue, so there is a certain lag, which will still affect the business with high real-time requirements; if the load fluctuates greatly, the scaling process will be more frequent, and certain resource allocation and data migration will be performed during the scaling process. Frequent scaling will cause unnecessary loss and instability; the elastic scaling of the existing technology does not care about the business, it only scales up and down by monitoring the indicators of the containers in the cluster, such as the CPU, memory and other usage rates. Such scaling results that are out of touch with the business sometimes cannot achieve the desired effect of the business. Summary of the invention
[0005] In view of the above analysis, the present invention aims to provide a business- and result-oriented elastic expansion and contraction method, which plans expansion and real-time expansion and contraction by analyzing historical expansion data and real-time monitoring of business indicators and system performance indicators, and solves the problems in the prior art that expansion and contraction cannot meet the expected business effects, expansion and contraction lags, and performance loss and instability caused by large load fluctuations. The method specifically includes the following steps:
[0006] Predict one or more load peak periods of the day based on historical capacity expansion data, and determine the planned capacity expansion execution time and planned capacity expansion strategy for each load peak period of the day based on the historical capacity expansion data corresponding to each load peak period and the task information of the day;
[0007] During the execution of each planned capacity expansion strategy, each planned capacity expansion strategy is adjusted based on the real-time monitored business indicator value and system performance indicator value to obtain an adjusted capacity expansion strategy, and the adjusted capacity expansion strategy is recorded in the capacity expansion data corresponding to the peak load period;
[0008] In other time periods, real-time expansion and reduction are performed based on the real-time monitored business indicator values and system performance indicator values and recorded in the expansion data corresponding to the corresponding time period.
[0009] Furthermore, the predicting of one or more load peak periods of the day based on historical capacity expansion data includes:
[0010] The proportion of days with expansion records in the corresponding historical data of each hour segment in a day to all historical days is counted, and the hour segment with a proportion greater than a preset threshold is the peak load segment of the day.
[0011] Furthermore, the expansion strategy includes all applications planned to be expanded during the corresponding load peak period and the expansion parameters of each application, and the expansion parameters include the increased number of containers and / or the increased number of threads; the expansion data includes: the application ID executing the expansion, the task ID, the expansion execution time, the expansion time, the expansion parameters, the system performance indicator value and the corresponding level before the expansion, and the business indicator value and the corresponding level.
[0012] Furthermore, the planned capacity expansion execution time and planned capacity expansion strategy for each load peak period based on the historical capacity expansion data corresponding to the load peak period and the task information of the day include:
[0013] Determine the application planned for expansion based on the application ID that has been expanded in the historical expansion data corresponding to the peak load period;
[0014] Determine the application ID corresponding to the task based on the task information of the day;
[0015] Determine the expansion execution time based on the maximum expansion time in the corresponding historical expansion data of the planned expansion application ID and the application ID corresponding to the task;
[0016] The planned capacity expansion strategy is determined based on the planned capacity expansion application ID and the capacity expansion parameters in the historical capacity expansion data corresponding to the application ID corresponding to the task.
[0017] Further, the determining of the expansion execution time based on the planned expansion application ID and the maximum expansion time in the corresponding historical expansion data of the application ID corresponding to the task includes:
[0018] Determine whether all the planned expansion application IDs in each load peak period are the application IDs corresponding to the task,
[0019] If so, then based on the planned expansion application ID, query all corresponding historical data for the maximum expansion time as the planned expansion time during the corresponding load peak period.
[0020] If not, then query the maximum capacity expansion time in all corresponding historical data of the corresponding load peak period based on the planned capacity expansion application ID as the corresponding planned capacity expansion time;
[0021] The time point obtained by subtracting the corresponding planned capacity expansion time from the starting time point of each load peak period is the corresponding planned capacity expansion execution time.
[0022] Further, determining the planned capacity expansion strategy based on the planned capacity expansion application ID and the capacity expansion parameters in the corresponding historical capacity expansion data of the application ID corresponding to the task includes:
[0023] Determine whether the planned expansion application ID is the application ID corresponding to the task,
[0024] If so, query the maximum value of each expansion parameter in all corresponding historical data based on the planned expansion application ID as the planned expansion parameter value of the application;
[0025] If not, then query the values of each expansion parameter at the last expansion in the corresponding historical data of the corresponding load peak period based on the planned expansion application ID as the planned expansion parameter value of the application;
[0026] The corresponding planned capacity expansion strategy is determined based on the planned capacity expansion parameter values of all applications corresponding to each load peak period.
[0027] Furthermore, during the execution of the planned capacity expansion strategy, adjusting the planned capacity expansion strategy based on the real-time monitored business indicator value and system performance indicator value to obtain a corresponding adjusted capacity expansion strategy includes:
[0028] Determine whether the application needs to be expanded based on the business indicator value of each application:
[0029] If so, increase the corresponding expansion parameter based on the business indicator value of the application that needs to be expanded and the system performance indicator value;
[0030] If not, determine whether each application needs to be scaled down based on the system performance indicator value:
[0031] If so, reduce the expansion parameters of the application that needs to be scaled down;
[0032] If not, the expansion parameters of the corresponding application remain unchanged;
[0033] When the planned capacity expansion strategy is executed, the obtained capacity expansion strategy with modified capacity expansion parameters is the corresponding adjusted capacity expansion strategy.
[0034] Further, the increasing of the corresponding expansion parameters based on the business indicator value and the system performance indicator value of the application that needs to be expanded includes:
[0035] Determine the corresponding business indicator level and system performance indicator level based on the business indicator value and the system performance indicator value of each application;
[0036] Based on different business indicator level and performance indicator level combinations of each application, the expansion parameters are increased to different values.
[0037] Furthermore, in the other time periods, performing real-time expansion and contraction based on the real-time monitored business indicator values and system performance indicator values includes:
[0038] Preset the real-time scaling levels and corresponding scaling rules corresponding to the business indicator values and system performance indicator values of each application;
[0039] Based on the business indicator values and system performance indicator values of each application monitored in real time, the real-time expansion and contraction levels and the corresponding expansion and contraction rules, real-time expansion and contraction are performed.
[0040] Furthermore, the other time periods refer to time periods outside the execution process of the planned capacity expansion strategy. The time interval in which the planned capacity expansion strategy is executed is determined based on the load peak period and the planned capacity expansion execution time. Real-time capacity expansion and contraction cannot be performed within the time interval.
[0041] The present invention can achieve at least one of the following beneficial effects:
[0042] By analyzing historical data, we can obtain the load peak pattern, so that we can plan capacity expansion in advance before each load peak to avoid losses caused by too high a frequency of real-time capacity expansion. At the same time, since the load peak is predicted and capacity expansion is initiated in advance, the problem of capacity expansion lag caused by the existing technology of initiating capacity expansion only when the load reaches a certain threshold is solved. This can effectively alleviate the system load peak pressure, so that the application operation can meet the business demand indicators as much as possible.
[0043] By monitoring the business indicator values and system performance indicator values of each application in real time during the execution of the planned expansion strategy, the expansion parameters of the corresponding application are adjusted by comprehensively considering the business indicator values and the system performance indicator values to optimize the expansion strategy, and the optimized expansion strategy is recorded as the corresponding expansion data, so that the subsequent expansion can better meet the business needs and solve the problem of failure to meet business requirements due to the disconnection between expansion and contraction and business in the existing technology.
[0044] By monitoring the dynamic changes of business indicator values and system performance indicator values at the same time, corresponding expansion and contraction rules are formulated so that when the business indicator values and system performance indicator values change, the application can be expanded or contracted in real time according to the business indicator values and system performance indicator values, thereby solving the problem that the existing technology only considers the system performance indicator values but ignores the business needs and fails to meet the business requirements.
[0045] Other features and advantages of the present invention will be described in the following description, and some advantages may become apparent from the description, or may be understood by practicing the present invention. The purpose and other advantages of the present invention may be realized and obtained through the contents particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0047] Figure 1 This is a flow chart of a method according to an embodiment of the present invention;
[0048] Figure 2 To monitor the task running time and memory usage in real time, adjust the capacity expansion strategies of each plan to obtain the process of adjusted capacity expansion strategies;
[0049] Figure 3 The process of adjusting the planned expansion strategy to obtain the adjusted expansion strategy by real-time monitoring of the number of online application users, operation response time, and memory usage. DETAILED DESCRIPTION
[0050] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0051] The present invention studies a method for elastically scaling applications based on containerization technology in cloud computing. A specific embodiment of the present invention discloses an elastic scaling method based on business and result orientation, which specifically includes steps S01-S03:
[0052] Step S01, based on the historical capacity expansion data, predict one or more load peak periods of the day, and determine the planned capacity expansion execution time and planned capacity expansion strategy for each load peak period of the day based on the historical capacity expansion data corresponding to each load peak period and the task information of the day; it should be noted that each planned capacity expansion execution time is earlier than each load peak period, that is, the capacity expansion is completed before the load peak period arrives; the load peak period is divided into hours, and one load peak period corresponds to one planned capacity expansion strategy.
[0053] The expansion data includes: the application ID that executes the expansion, the task ID, the expansion execution time, the expansion time, the expansion parameters, the system performance index value and the corresponding level before the expansion, the business index value and the corresponding level. The task ID indicates the corresponding task that the application plans to execute.
[0054] The task information of the day is used to indicate all task information that each application plans to execute on the day, including the task ID, the corresponding application ID and the task execution time.
[0055] Step S02: During the execution of each planned capacity expansion strategy, each planned capacity expansion strategy is adjusted based on the real-time monitored business indicator value and system performance indicator value to obtain an adjusted capacity expansion strategy, and the adjusted capacity expansion strategy is recorded in the capacity expansion data corresponding to the load peak period; it should be noted that the capacity expansion strategy does not change during the execution of the planned capacity expansion strategy, but whether the capacity expansion meets the business needs is determined based on the real-time monitored business indicator value and system performance indicator value during the capacity expansion process, and the adjusted capacity expansion strategy is recorded in the corresponding capacity expansion data, which is used as historical capacity expansion data for the subsequent formulation of planned capacity expansion strategies.
[0056] Business indicator values refer to the values of each application that meet business requirements, such as the number of online users, task execution time, response time, etc.
[0057] System performance indicators include memory usage, CPU usage, etc.
[0058] Step S03, in other time periods, real-time expansion and contraction are performed based on the real-time monitored business indicator values and system performance indicator values and recorded in the expansion data corresponding to the corresponding time period; it should be noted that since the planned expansion strategy is executed in advance during the peak load period, the resources of each application are very sufficient, which may trigger real-time contraction, so the period from the start of the planned expansion to the peak period should be set as the time interval for the execution of the planned expansion strategy. Real-time expansion and contraction cannot be performed during the time interval, and real-time expansion and contraction cannot be performed during this period.
[0059] This embodiment discloses an elastic scaling method based on business and result orientation. By analyzing historical data, the possible load peak periods of the day are determined, and a planned expansion strategy is formulated to expand capacity in advance to avoid pressure during the load peak period; the expansion strategy is dynamically adjusted through real-time monitored business indicator values and system performance indicator values for subsequent formulation of better expansion strategies to meet business operation needs; for non-load peak periods, real-time monitoring of business indicators and system performance indicators is performed to perform real-time expansion and contraction, which can avoid system instability and additional resource overhead caused by frequent expansion and contraction during load peak periods.
[0060] It should be noted that the business described in the present invention refers to the functions implemented by the application, and the types of business include online load type and task load type; exemplarily, online load type business includes the online volume of application users, API service calls, etc.; task load type business includes offline computing, scheduled computing tasks, etc.
[0061] Furthermore, satisfying business operation requirements in the present invention refers to business operation meeting expected requirements. For example, a business requirement is set to complete a scheduled computing task within 5 minutes; or a business requirement is set to a system response time of less than 5 seconds when the number of people online at the same time reaches more than 1,000.
[0062] Furthermore, the task described in the present invention refers to a task performed by an application at a certain point in time to achieve user business needs, such as flink stream computing, generating statistical reports, etc. An application can have zero or more tasks, so the corresponding application of each task can be determined based on the task information of the day.
[0063] Specifically, in step S01, predicting one or more load peak periods of the day based on historical capacity expansion data includes:
[0064] The percentage of days with expansion records in the corresponding historical data of each hour segment in a 24-hour segment of a day is counted in all historical days, and the hour segment whose percentage is greater than the preset threshold is the peak load period of the day. For example, the preset threshold is 50%, and the hour segment whose percentage is greater than 50% indicates that the probability of the hour segment needing expansion in history is greater than 50%.
[0065] Furthermore, in step S01, the expansion data includes: application ID for executing the expansion, task ID, expansion execution time, expansion time consumption, expansion parameters, system performance index values and corresponding levels before expansion, and business index values and corresponding levels.
[0066] Furthermore, the application ID and task ID of the capacity expansion executed in the record can be used to confirm which applications have executed the capacity expansion. The capacity expansion execution time in the capacity expansion data can be used to determine whether there is a capacity expansion record in each hour period. The capacity expansion parameters include the number of increased containers and / or the number of increased threads. The capacity expansion time refers to the time from the start of the capacity expansion to the completion of the adjustment of the number of containers and / or threads.
[0067] Furthermore, the system performance indicators include memory, CPU usage, etc., and the corresponding levels of system performance indicator values can be preset according to the needs. For example, memory usage greater than 80% means insufficient memory, memory usage greater than 30% and less than 80% means normal memory, and memory usage less than or equal to 30% means sufficient memory; for example, the corresponding relationship between the indicator value and the corresponding level of CPU usage is set as follows: when CPU < 30%, the CPU resources are sufficient; when 30% ≤ CPU < 80%, it indicates that the CPU resources are normal; when 80% ≤ CPU < 95%, it indicates that the CPU is seriously insufficient; when 95% ≤ CPU, it indicates that the CPU resources are dangerous. The business indicator value and the corresponding level are determined according to the business needs of the user. For example, the business indicator value and the corresponding level are preset: the execution time of a certain application is ≤ 5 minutes, which is normal; 5 minutes < execution time ≤ 10 minutes, which is a general timeout; 10 minutes < execution time, which is a serious timeout.
[0068] Furthermore, each expansion strategy includes all applications planned to be expanded during the corresponding load peak period and expansion parameters of each application, and the expansion parameters include the number of increased containers and / or threads.
[0069] Further, in step S01, based on the historical capacity expansion data corresponding to each load peak period and the task information of the day, the planned capacity expansion execution time and planned capacity expansion strategy of each load peak period of the day are determined, including S011-S014.
[0070] S011. Determine the application planned for expansion based on the application ID that has been expanded in the historical expansion data corresponding to the peak load period. It should be noted that the application that has been expanded in the historical expansion data indicates that during the peak load period, the corresponding application has a need for expansion. Therefore, the application that has been expanded in the historical data of the peak load period is determined as the application planned for expansion.
[0071] S012: Determine the application ID corresponding to the task based on the task ID of the task information of the day. The task information includes the task ID, the corresponding application ID and the task execution time. Generally, the task ID is used as the index of the task information, so the corresponding application ID can be queried based on the index task ID.
[0072] S013: Determine the capacity expansion execution time based on the planned capacity expansion application ID and the maximum capacity expansion time in the corresponding historical data of the application ID corresponding to the task.
[0073] Specifically, it is determined whether all the planned expansion application IDs in each load peak period are application IDs corresponding to the task.
[0074] If so, then based on the capacity expansion application ID of the load peak period plan, query all corresponding historical data for the maximum capacity expansion time as the planned capacity expansion time for the load peak period.
[0075] If not, then query the maximum capacity expansion time in all corresponding historical data of the load peak period based on the capacity expansion application ID of the load peak period plan as the capacity expansion time planned for the load peak period;
[0076] The time point obtained by subtracting the corresponding planned capacity expansion time from the starting time point of each load peak period is the corresponding planned capacity expansion execution time.
[0077] S014. Determine a planned capacity expansion strategy based on the planned capacity expansion application ID and the capacity expansion parameters in the historical data corresponding to the application ID corresponding to the task.
[0078] Specifically, it is determined whether the planned expansion application ID is the application ID corresponding to the task.
[0079] If so, query the maximum value of each expansion parameter in all corresponding historical data based on the planned expansion application ID as the planned expansion parameter value of the application;
[0080] If not, then query the values of each expansion parameter at the last expansion in the corresponding historical data of the corresponding load peak period based on the planned expansion application ID as the planned expansion parameter value of the application;
[0081] The corresponding planned capacity expansion strategy is determined based on the planned capacity expansion parameter values of all applications corresponding to each load peak period.
[0082] The present embodiment discloses a business- and result-oriented elastic scaling method, which obtains the load peak pattern by analyzing historical data, so as to plan capacity expansion in advance before each load peak to avoid the loss caused by too high frequency of real-time capacity expansion. At the same time, since the load peak is predicted and capacity expansion is initiated in advance, the problem of capacity expansion lag caused by the initiation of capacity expansion only when the load reaches a certain threshold in the prior art is solved, which can effectively alleviate the system load peak pressure, so that the application operation can meet the business demand indicators as much as possible.
[0083] Specifically, in step S02, during the execution of each planned capacity expansion strategy, each planned capacity expansion strategy is adjusted based on the real-time monitored business indicator value and system performance indicator value to obtain an adjusted capacity expansion strategy, including:
[0084] Determine whether the application needs to be expanded based on the business indicator value of each application:
[0085] If so, increase the corresponding expansion parameter based on the business indicator value of the application that needs to be expanded and the system performance indicator value;
[0086] If not, it is determined whether each application needs to be scaled down based on the system performance indicator value: when the system indicator value is lower than the set threshold, it means that the system resources are sufficient. In order to avoid wasting resources, it is determined that the application needs to be scaled down.
[0087] If so, reduce the expansion parameters of the application that needs to be scaled down;
[0088] If not, the expansion parameters of the corresponding application remain unchanged;
[0089] When the planned capacity expansion strategy is executed, the obtained capacity expansion strategy with modified capacity expansion parameters is the corresponding adjusted capacity expansion strategy.
[0090] Further, the business indicators of the application include: task running time, number of online users, operation response time, etc. The user sets the corresponding level of the business indicator value according to the business needs. For example, the preset value of the running time of task A is set to 10 minutes. If it exceeds the preset value by 5 minutes to 30 minutes, it is a general timeout, and if it exceeds the preset value by 30 minutes, it is a serious timeout. When the business indicator value is a general timeout or a serious timeout, it cannot meet the user's needs, and it is judged that the application needs to be expanded. For example, when the preset value of the number of online users of the application is set to exceed 1,000, the user's operation response time is less than 5 seconds for smooth operation, more than 5 seconds and less than one minute for general jamming, and more than one minute for serious jamming; similarly, when the preset value of the number of online users is in the range of 500-1,000, different response time ranges can be set for smooth operation, general jamming, and serious jamming. When the corresponding level of the business indicator value is general jamming or serious jamming, it cannot meet the user's needs, and it is judged that the application needs to be expanded.
[0091] Furthermore, the system performance index includes memory, CPU usage, etc. Exemplarily, a memory usage greater than 80% indicates insufficient memory, a memory usage greater than 30% and less than 80% indicates normal memory, and a memory usage less than or equal to 30% indicates sufficient memory.
[0092] Further, increasing the corresponding expansion parameters based on the business indicator value and the system performance indicator value of the application that needs to be expanded includes:
[0093] Determine the corresponding business indicator level and system performance indicator level based on the business indicator value and the system performance indicator value of each application;
[0094] Based on different business indicator level and performance indicator level combinations of each application, the expansion parameters are increased to different values.
[0095] For example, Figure 2 The figure shows the process of adjusting each planned expansion strategy to obtain the adjusted expansion strategy when monitoring the task running time and memory usage in real time; Figure 3The process of adjusting the planned expansion strategy to obtain the adjusted expansion strategy when the number of online users, operation response time and memory usage rate of the application are monitored in real time. When it is determined that the system needs to be expanded, the business indicator level is first determined according to the business indicator value, such as Figure 2 The business indicator level may be determined as general timeout or severe timeout, and then the value of the expansion parameter increase is determined according to the system performance indicator level. If the corresponding system indicator level is severe memory shortage, the number of different containers is increased respectively, otherwise the number of different threads is increased respectively; Figure 3 The business indicator level may be general or severe, and then the value of the expansion parameter increase is determined according to the system performance indicator level. If the corresponding system indicator level is severe memory shortage, the number of containers is increased respectively, otherwise the number of threads is increased respectively. It should be noted that Figure 2 , Figure 3 When it is determined that the system needs to be expanded, it means that the expansion parameters in the planned expansion strategy cannot meet the business needs. Therefore, it is necessary to increase the value of the expansion parameters and record them in the corresponding expansion data as historical expansion data when subsequently formulating the planned expansion strategy.
[0096] It should be noted that, since the business indicator values and required system resources of each application are different, the user can set different business indicator levels and system indicator levels for each application according to needs, and all possible combinations are not listed here one by one.
[0097] Furthermore, since the planned capacity expansion strategy is based on historical capacity expansion data over a period of time, it can generally meet the capacity expansion needs during peak load periods. In order to avoid frequent capacity expansion that occupies system resources and may cause system instability, the capacity expansion strategy does not change during the execution of the planned capacity expansion strategy. Instead, the adjusted capacity expansion strategy is obtained based on the business indicator values and system performance indicator values monitored in real time during the capacity expansion process, and the corresponding capacity expansion data is recorded for use as historical capacity expansion data when subsequently formulating the planned capacity expansion strategy.
[0098] It should be noted that when the entire system is initially running, each application does not have historical expansion data, and it is impossible to specify a planned expansion strategy at this time. Instead, real-time expansion and contraction are performed based on real-time monitored business indicator values and system performance indicator values, and the corresponding expansion data is recorded. After the system has been running for a period of time, such as one month, the historical expansion data shows a periodic expansion pattern, and you can start to formulate a planned expansion strategy and determine the planned expansion time.
[0099] The present embodiment discloses an elastic scaling method based on business and result orientation. In the process of executing the planned scaling strategy, the business indicator value and the system performance indicator value of each application are monitored in real time, the scaling parameters of the corresponding application are adjusted by comprehensively considering the business indicator value and the system performance indicator value to optimize the scaling strategy, and the optimized scaling strategy is recorded as corresponding scaling data, so that the subsequent scaling can better meet the business needs, and solve the problem in the prior art that the scaling and business are out of touch and the business requirements cannot be met.
[0100] Specifically, in step S03, performing real-time expansion and contraction based on the real-time monitored business indicator value and system performance indicator value includes:
[0101] Preset the real-time scaling levels and corresponding scaling rules corresponding to the business indicator values and system performance indicator values of each application;
[0102] Based on the business indicator values and system performance indicator values of each application monitored in real time, the real-time expansion and contraction levels and the corresponding expansion and contraction rules, real-time expansion and contraction are performed.
[0103] Specifically, the real-time scaling levels corresponding to the business indicator values and system performance indicator values of each application can be set to the same level as in step S02, or can be set to different levels than in step S02. The scaling rules corresponding to each level are respectively increasing the number of containers by a different number, increasing the number of threads by a different number; the scaling rules corresponding to each level are respectively reducing the number of preset containers or reducing the number of threads.
[0104] Exemplarily, the corresponding relationship between the indicator value of CPU usage and the corresponding level is set as follows:
[0105] When CPU < 30%, CPU resources are sufficient;
[0106] When 30%≤CPU≤80%, it means that the CPU resources are normal;
[0107] When 80%≤CPU≤95%, it indicates that the CPU is seriously insufficient;
[0108] When 95% ≤ CPU ≤ 100%, it indicates that CPU resources are in danger.
[0109] Accordingly, you can set expansion rules. When the business execution time meets the preset value, but the CPU occupancy rate is at the above different levels, the capacity can be expanded or reduced in real time. For example, when the CPU is seriously insufficient, the expansion parameter of the real-time expansion is to add 2 containers; when the CPU resources are dangerous, the expansion parameter of the real-time expansion is to add 5 containers.
[0110] Further, in step S03, the other time periods refer to the time periods outside the execution process of the planned capacity expansion strategy. The time interval in which the planned capacity expansion strategy is executed is determined based on the load peak period and the planned capacity expansion execution time, and the time interval is set as the cooling period for expansion and contraction. Real-time expansion and contraction cannot be performed during the cooling period. This is because the planned capacity expansion strategy is executed in advance during the load peak period, so the resources of each application are very sufficient, which is likely to trigger real-time contraction, so a cooling period is set to avoid the occurrence of real-time contraction.
[0111] Furthermore, the time interval is from the planned capacity expansion execution time to the end of the load peak period.
[0112] This embodiment discloses a business- and result-oriented elastic scaling method, which monitors the dynamic changes of business indicator values and system performance indicator values at the same time, formulates corresponding scaling rules, and scales applications in real time according to business indicator values and system performance indicator values, thereby solving the problem that the prior art only considers system performance indicator values and ignores the effect of business requirements failing to meet business requirements. At the same time, since real-time scaling is performed in a time period outside the cooling period, frequent scaling during peak load periods can be avoided, and additional overhead on system resources can be avoided, thereby further ensuring the stability of system operation.
[0113] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A business- and result-oriented elastic expansion and contraction method, characterized in that: The steps include: Based on the historical capacity expansion data, one or more load peak periods of the day are predicted, and the planned capacity expansion execution time and planned capacity expansion strategy of each load peak period of the day are determined based on the historical capacity expansion data corresponding to each load peak period and the task information of the day; the capacity expansion strategy includes all planned capacity expansion applications and capacity expansion parameters of each application in the corresponding load peak period, and the capacity expansion parameters include the number of increased containers and / or the number of increased threads; the capacity expansion data includes: application ID for executing capacity expansion, task ID, capacity expansion execution time, capacity expansion time, capacity expansion parameters, system performance indicator values and corresponding levels before capacity expansion, business indicator values and corresponding levels; the task information of the day is used to represent all task information planned to be executed by each application on the day, including task ID, corresponding application ID and task execution time; During the execution of each planned capacity expansion strategy, each planned capacity expansion strategy is adjusted based on the real-time monitored business indicator value and system performance indicator value to obtain an adjusted capacity expansion strategy, and the adjusted capacity expansion strategy is recorded in the capacity expansion data corresponding to the load peak period; the adjustment of each planned capacity expansion strategy based on the real-time monitored business indicator value and system performance indicator value to obtain the adjusted capacity expansion strategy includes: judging whether the application needs to be expanded based on the business indicator value of each application: if so, increasing the corresponding capacity expansion parameter based on the business indicator value and the system performance indicator value of the application that needs to be expanded; if not, judging whether each application needs to be reduced based on the system performance indicator value: if so, reducing the capacity expansion parameter of the application that needs to be reduced; if not, the capacity expansion parameter of the corresponding application remains unchanged; when the planned capacity expansion strategy is executed, the obtained capacity expansion strategy with modified capacity expansion parameters is the corresponding adjusted capacity expansion strategy; In other time periods, real-time expansion and reduction are performed based on the real-time monitored business indicator values and system performance indicator values and recorded in the expansion data corresponding to the corresponding time period; the other time periods refer to the time periods outside the execution process of the planned expansion strategy; the time interval in which the planned expansion strategy is executed is determined based on the load peak period and the planned expansion execution time, and real-time expansion and reduction cannot be performed within the time interval.
2. The elastic expansion and contraction method according to claim 1, characterized in that: The prediction of one or more load peak periods of the day based on historical capacity expansion data includes: The proportion of days with expansion records in the corresponding historical data of each hour segment in a day to all historical days is counted, and the hour segment with a proportion greater than a preset threshold is the peak load segment of the day.
3. The elastic expansion and contraction method according to claim 2, characterized in that: Determining the planned capacity expansion execution time and planned capacity expansion strategy for each load peak period of the day based on the historical capacity expansion data corresponding to each load peak period and the task information of the day includes: Determine the application planned for expansion based on the application ID that has been expanded in the historical expansion data corresponding to the peak load period; Determine the application ID corresponding to the task based on the task information of the day; The expansion execution time is determined based on the maximum expansion time in the corresponding historical expansion data of the application ID of the planned expansion and the application ID corresponding to the task, including: respectively judging whether all the application IDs of the planned expansion in each load peak period are the application IDs corresponding to the task, if so, querying the maximum expansion time in all corresponding historical data based on the application ID of the planned expansion as the planned expansion time for the corresponding load peak period, if not, querying the maximum expansion time in all corresponding historical data of the corresponding load peak period based on the application ID of the planned expansion as the planned expansion time for the corresponding load peak period; the time point obtained by subtracting the planned expansion time for the corresponding load peak period from the starting time point of each load peak period is the corresponding planned expansion execution time; Determine a planned capacity expansion strategy based on the capacity expansion parameters in the historical capacity expansion data corresponding to the application ID of the planned capacity expansion and the application ID corresponding to the task, including: judging whether the application ID of the planned capacity expansion is the application ID corresponding to the task, and if so, querying the maximum value of each capacity expansion parameter in all corresponding historical data based on the application ID of the planned capacity expansion as the planned capacity expansion parameter value of the application; if not, querying the values of each capacity expansion parameter at the time of the last capacity expansion in the corresponding historical data of the corresponding load peak period based on the application ID of the planned capacity expansion, and using them as the planned capacity expansion parameter values of the application; and determining the corresponding planned capacity expansion strategy based on the planned capacity expansion parameter values of all applications corresponding to each load peak period.
4. The elastic expansion and contraction method according to claim 3, characterized in that: The business indicator value and the system performance indicator value of the application that needs to be expanded increase the corresponding expansion parameters include: Determine the corresponding business indicator level and system performance indicator level based on the business indicator value and the system performance indicator value of each application; Based on different business indicator level and performance indicator level combinations of each application, the expansion parameters are increased to different values.
5. The elastic expansion and contraction method according to claim 1, characterized in that: In the other time periods, performing real-time expansion and contraction based on the real-time monitored business indicator values and system performance indicator values includes: Preset the real-time scaling levels and corresponding scaling rules corresponding to the business indicator values and system performance indicator values of each application; Based on the business indicator values and system performance indicator values of each application monitored in real time, the real-time expansion and contraction levels and the corresponding expansion and contraction rules, real-time expansion and contraction are performed.
Citation Information
Patent Citations
Dynamic capacity expansion method based on service prediction in micro-service environment
CN114064204A
Business container capacity expansion and shrinkage adjustment method and device, storage medium and electronic equipment
CN116204277A