An intelligent capacity expansion and contraction method and system based on capacity early warning

CN115756853BActive Publication Date: 2026-10-23DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211470782.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2026-10-23
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

[0004]应对服务容量压力产生的调整需求依赖人工决策和操作时主要存在以下缺点:人工感知能力延迟,人工只有收到报警或者容量预警才能做出反应,中间难免产生时间差可能造成处理不及时等问题;调整目标机器选择难度大,人工调整只能申请新机器进行布局或者选择已有机器混部,无法做到最优布局,可能出现资源分配不均匀导致CPU分配率和利用率低;稳定性风险大,当人工疲劳时,失误率高是在所难免的,扩缩容操作容易出现失误,高流量期间的操作失误可能会被无限放大造成重大故障

Benefits of technology

[0040]本发明提供的基于容量预警的智能扩缩容方法和系统能通过容量感知监控分析产出服务对资源的具体需求,根据需求总量结合智能编排算法产出服务定向扩缩容的具体策略和方案,结合自动扩缩容系统实现扩缩容。本发明在服务容量预警下,产出容量调整需求,通过容量增长或下降趋势的分析产出当前容量调整计划,并且能够根据容量调整计划,编排当前服务部署,以最优的部署方式做到成本和效率兼顾。同时在流量低峰场景下,可根据当前部署判断是否满足部署资源需求,动态调整布局,将资源重新编排,插空优化,实现资源利用率和分配率最优。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115756853B_ABST
    Figure CN115756853B_ABST
Patent Text Reader

Abstract

The application provides a kind of intelligent capacity expansion and contraction method and system based on capacity early warning, the method comprises: real-time sensing CPU and memory information of service, according to the utilization of CPU and memory to determine whether there is risk, trigger capacity alarm;Get the CUP allocation amount, CUP utilization rate and user request rate information of the current period service, and by judging the capacity change trend as capacity growth trend or capacity decline trend, and combining the capacity threshold and growth base of service to generate capacity adjustment demand;According to the capacity adjustment demand, analyze and screen all servers in the current resource pool and all instances under the service, screen the corresponding server to generate capacity expansion and contraction task;According to the capacity expansion and contraction task, execute capacity expansion and contraction operation.The application can arrange the current service deployment according to the capacity adjustment plan, and achieve cost and efficiency in the best deployment mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network technology, and in particular to an intelligent scaling method and system based on capacity early warning. Background Technology

[0002] With the rapid development of the Internet era and the arrival of the mobile Internet era, the number of users on major websites and platforms has increased rapidly. Therefore, higher demands are placed on the service request processing capabilities, requiring services to support the test of high concurrency and large traffic. In the face of such traffic surges or continuous high traffic scenarios, normal service should be maintained, so as to improve the user experience without any noticeable impact on users. During major events and holidays, when users access the site in a high-density manner, the website service's deployed servers should be able to cope with the impact of a sudden surge in a large number of requests, and meet the requirements of no delay, no interruption, no downtime, and rapid response.

[0003] Currently, most distributed website services cope with holidays and sudden surges in traffic by manually deploying resources in advance. This involves increasing capacity by adding more machines beforehand, having staff on duty on the day of the surge, monitoring service characteristics, assessing the number of requests and machine resource usage, identifying service and machine characteristics, and determining if the service needs to be scaled up or down based on expectations. Then, based on experience, the platform is manually operated to scale up or down the service.

[0004] Relying on manual decision-making and operation to address service capacity pressure has the following drawbacks: Delayed human perception; humans can only react upon receiving alarms or capacity warnings, inevitably creating a time lag that may lead to untimely processing. Difficulty in selecting target machines for adjustment; manual adjustments can only request new machines for deployment or mix existing machines, making optimal deployment impossible and potentially resulting in uneven resource allocation and low CPU utilization. High stability risk; when humans are fatigued, a high error rate is inevitable, and scaling up or down operations are prone to errors. Errors during high-traffic periods can be amplified, potentially causing major failures.

[0005] In existing technologies, cloud storage elastic scaling methods have been proposed to address service deployment capacity issues in scenarios involving large-scale mixed service deployments. However, few technical solutions can achieve a balance between cost and efficiency, and they cannot optimize server resource utilization and allocation. Summary of the Invention

[0006] To address the problems of existing technologies, embodiments of the present invention provide an intelligent scaling method and system based on capacity early warning. The specific technical solution of the present invention is as follows:

[0007] According to one aspect of the present invention, a smart scaling-up / scaling method based on capacity early warning is provided, the method comprising:

[0008] Step 1: Real-time monitoring of the service's CPU and memory information; assessment of CPU and memory utilization to determine potential risks and trigger capacity alerts.

[0009] Step 2: Obtain information on the current period's service CPU allocation, CPU utilization, and user request rate; determine whether the capacity change trend is a capacity growth trend or a capacity decline trend; and generate capacity adjustment requirements by combining the service's capacity threshold and growth base.

[0010] Step 3: Based on the capacity adjustment requirements, analyze and filter all servers and instances under the current resource pool, and filter the corresponding servers to generate scaling tasks;

[0011] Step 4: Perform the scaling up / down operation according to the scaling up / down task.

[0012] Preferably, in step two of the method, the condition for determining that the capacity change trend is a capacity growth trend is that both the CPU utilization rate and the daily capacity change curve corresponding to the current period increase simultaneously, and the condition for determining that the capacity change trend is a capacity decline trend is that the CPU utilization rate, the daily capacity change curve corresponding to the current period, and the user request rate decrease simultaneously.

[0013] Prior to this, the capacity adjustment requirement includes the capacity adjustment type and the number of servers that need to be adjusted. The capacity adjustment type is the expansion requirement type, and the number of servers that need to be expanded is determined and calculated based on the following formula:

[0014] (Proportion of resource increase in the next cycle * Current service resource usage * Base number of resource reserved buffers - Current service resource usage) / Resource occupancy per instance;

[0015] The resource reservation buffer base refers to the space that needs to be reserved by the CPU.

[0016] The single-instance resource occupancy refers to the amount of resources occupied by a single instance on a single server.

[0017] Prior to this, the capacity adjustment requirement includes the capacity adjustment type and the number of servers that need to be adjusted. The capacity adjustment type is a scaling-down requirement type, and the number of servers that need to be scaled down is determined and calculated based on the following formula:

[0018] (Prospective decrease in resources for the next cycle * Current service resource usage - Current service resource usage * Minimum resource retention threshold) / Resource occupancy per instance;

[0019] The minimum resource reservation threshold refers to the minimum CPU utilization rate set for normal system operation.

[0020] The single-instance resource occupancy refers to the amount of resources occupied by a single instance on a single server.

[0021] Prioritize that, in step three, when the demand type is determined to be a scaling-down demand, sort the servers corresponding to all instances of the current service according to the number of service deployments on the servers, and select the N servers with the fewest service deployments as the scaling-down target servers.

[0022] Priority is given to step three, when the demand type is determined to be an expansion demand, all current servers are sorted according to the available server resource balance, and it is determined whether the resources of the servers with sufficient balance meet the demand. If the resources are insufficient, a new server is requested from the alternative server pool. If the resources are sufficient or the new server is allocated, the top N servers are sorted according to CPU utilization and selected as the expansion target servers.

[0023] Preferred, the method also includes: Step 5: During periods of low traffic frequency, make unified adjustments to all servers in the current resource pool at a certain period.

[0024] Prioritized, step five includes: calculating the number of servers Y that can be optimized in the current resource pool;

[0025] Obtain the deployment information of all servers in the resource pool, sort them according to the number of services deployed on the servers, select the Y servers with the fewest services as the servers to be taken offline, and deploy all instances of the servers to be taken offline one by one to the servers to be reserved.

[0026] Prior to this, the specific formula for calculating the number Y of servers that can be optimized in the current resource pool is as follows:

[0027] The number of servers that can be optimized, Y = (allCpu*rate - needCpu*buffer) / instanceCost;

[0028] needCpu = useCpu * current utilization / standard utilization;

[0029] Where: allCpu: refers to the total number of cores in the resource pool;

[0030] needCpu: refers to the total actual CPU demand of the resource pool;

[0031] rate: refers to the expected allocation rate of the server;

[0032] buffer: refers to the space that the CPU needs to reserve.

[0033] instanceCost: refers to the number of cores in a single server;

[0034] useCpu: refers to the number of cores already allocated in the resource pool.

[0035] According to another aspect of the present invention, an intelligent scaling-up / scaling system based on capacity early warning is provided, the system comprising:

[0036] The capacity monitoring module senses the CPU and memory information of the service in real time, judges whether there is a risk based on the utilization of CPU and memory, and triggers capacity alarms.

[0037] The capacity analysis module, upon receiving the capacity alarm, obtains the current period service's CPU allocation, CPU utilization, and user request rate information, and generates capacity adjustment requirements by judging whether the capacity change trend is a capacity growth trend or a capacity decline trend, and by combining the service's capacity threshold and growth base.

[0038] After receiving the capacity adjustment request, the intelligent orchestration module analyzes and filters all servers and all instances under the current resource pool, and selects the corresponding servers to generate scaling up and down tasks.

[0039] The scaling module, upon receiving the scaling task, executes the scaling operation.

[0040] The intelligent scaling method and system based on capacity early warning provided by this invention can generate specific resource requirements for services through capacity-aware monitoring and analysis. Based on the total demand and combined with intelligent orchestration algorithms, it generates specific strategies and schemes for targeted scaling of services, and implements scaling in conjunction with an automatic scaling system. Under service capacity early warning, this invention generates capacity adjustment requirements, generates a current capacity adjustment plan through analysis of capacity growth or decline trends, and orchestrates the current service deployment according to the capacity adjustment plan, achieving a balance between cost and efficiency in the optimal deployment method. Simultaneously, in low-traffic scenarios, it can determine whether the current deployment meets the deployment resource requirements, dynamically adjust the layout, rearrange resources, and optimize resource allocation to achieve optimal resource utilization and allocation. Attached Figure Description

[0041] Further details, features, and advantages of the invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0042] Figure 1 A flowchart of an intelligent scaling-up / scaling method based on capacity warning according to an exemplary embodiment of the present invention is shown;

[0043] Figure 2 A flowchart illustrating a method for intelligent orchestration module based on capacity warning to trigger scaling up or down according to an exemplary embodiment of the present invention is shown.

[0044] Figure 3A flowchart is shown below illustrating a method for organizing all servers in a resource pool during a low-frequency traffic phase according to an exemplary embodiment of the present invention.

[0045] Figure 4 A structural block diagram of an intelligent scaling-up / scaling system based on capacity warning according to an exemplary embodiment of the present invention is shown. Detailed Implementation

[0046] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0047] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0048] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0049] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0050] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0051] Figure 1An exemplary embodiment of a capacity-based intelligent scaling method 100 is shown. The intelligent scaling method 100 includes step 101: The capacity monitoring module senses the CPU and memory information of the service in real time, judges whether there is a risk based on the utilization rate of CPU and memory, and triggers a capacity alarm. Specifically, it judges whether the demand is met based on the utilization rate of CPU and memory. The alarm is divided into low utilization rate or high utilization rate, which will generate an alarm event and trigger capacity analysis.

[0052] The intelligent scaling up / down method 100 includes step 102: After receiving an alarm, the capacity analysis module obtains the current period service's CPU allocation, CPU utilization, and user request rate information, and generates capacity adjustment requirements by judging whether the capacity change trend is a capacity growth trend or a capacity decline trend, and by combining the service's capacity threshold and growth base.

[0053] The method for determining capacity growth and decline trends is as follows: the capacity early warning module collects capacity information for each service at various stages daily, such as the user request rate and CPU utilization at 8 AM each day, generating daily trends and graphs for each service. The user request rate is represented by the query rate per second (QPS). The calculation of capacity growth and decline trends is based on the ratio of capacity changes between the current time period T and the previous period T-1, combined with the daily capacity change curve for the current time period to predict the capacity demand for the next period. The calculation of capacity growth and decline trends mainly involves three parameters: QPS, CPU utilization, and the daily capacity change curve corresponding to the current period T. The first parameter, QPS, characterizes whether the capacity change trend is upward or downward. For example, if the QPS in the current time period T is 100, and the QPS in the previous period T-1 was 80, then... T-1 <QPS T If QPS is on an upward trend, then the capacity change trend represented by the QPS parameter is also on an upward trend; conversely, if QPS is on an upward trend... T-1 QPS T If QPS is decreasing, then the capacity change trend represented by the QPS parameter is decreasing, where the time period is, for example, 10 minutes. The second parameter, CPU utilization, represents either an increasing or decreasing capacity change trend. For example, if the CPU utilization in the current time period T is 30%, and the CPU utilization in the previous period T-1 was 40%, then due to CPU... T-1 CPU T If CPU utilization is on a downward trend, then the capacity change trend represented by the CPU utilization parameter will also be downward. Conversely, if CPU utilization is on a downward trend... T-1 <CPU TIf CPU utilization is on an upward trend, then the capacity change trend represented by the CPU utilization parameter is also upward. The third parameter, the daily capacity change curve corresponding to the current period T, represents whether the capacity change trend is upward or downward. The capacity warning server records historical daily capacity change curves. For example, if the current period T is from 8:00 AM to 8:10 AM today, the warning server retrieves historical data from 8:00 AM to 8:10 AM each day and determines whether the current period T is in an upward or downward trend based on this historical data. When the capacity change trend is determined to be an increasing trend, only two parameters need to be considered: CPU utilization and the daily capacity change curve corresponding to the current period T. That is, when both CPU utilization and the daily capacity change curve corresponding to the current period increase simultaneously, it is determined to be an increasing trend, and a capacity increase demand is generated. When the capacity change trend is determined to be a decreasing trend, three parameters need to be considered: CPU utilization, the daily capacity change curve corresponding to the current period, and QPS. That is, when all three parameters decrease simultaneously, it is determined to be a decreasing trend, and a capacity decrease demand is generated.

[0054] Step 102, in addition to determining the capacity change trend, can also predict the capacity value for the next period T+1. This is calculated based on the capacity change output ratio data of the current time period T and the previous two time periods T-1 and T-2. A specific example is as follows: The CPU utilization rate in the current time period T is 30%, the CPU utilization rate in the previous period T-1 is 40%, and the CPU utilization rate in the period before that T-2 is 50%. Combining this with the QPS and the daily capacity change curve corresponding to the current period, a capacity decline trend is determined. The capacity decline value is the smaller of the capacity decline ratio of the previous period and the capacity decline ratio of the current period, multiplied by the current capacity. The capacity decline ratio of the previous period is the CPU... T-1 / CPU T-2 =40% / 50%, the capacity reduction rate for this cycle is CPU T / CPU T-1 = 30% / 40%. Since 3 / 4 < 4 / 5, 3 / 4 * current capacity is the predicted capacity value for the next period T+1. Simultaneously, the predicted resource decrease percentage for the next period will be calculated as 1 / 4. Similarly, when capacity is trending upwards, the predicted resource increase percentage for the next period will be calculated.

[0055] The above calculations ensure real-time updates and habit predictions of service capacity, preventing capacity issues caused by sudden increases or decreases in service resource usage. For example, if there is a sudden drop in users at a certain moment, but the current usage is peak, without analyzing the service's daily usage curve, it is very likely that scaling down during peak hours could lead to a service capacity collapse.

[0056] Step 102 also includes the capacity analysis module calculating the predicted value and then combining the service capacity threshold and growth base to determine whether the capacity is excessive or insufficient, thereby generating a capacity adjustment requirement. This capacity adjustment requirement includes the capacity adjustment type, which is specifically a reduction or expansion requirement. At the same time, the capacity analysis module can calculate the number of servers that need to be expanded or reduced, that is, the capacity adjustment requirement also includes the number of servers that need to be adjusted, specifically in two cases.

[0057] The formula for determining the need for capacity expansion in the first scenario is as follows:

[0058] (Proportion of next cycle resource prediction increase * Current service resource usage * Resource reserved buffer base - Current service resource usage) / Single instance resource occupancy formula (1)

[0059] The predicted increase ratio of resources in the next cycle can be calculated using the capacity change output ratio data of the current time period T and the previous two time periods T-1 and T-2. For specific calculation methods, please refer to the example above.

[0060] The resource reservation buffer base number refers to the space that needs to be reserved by the CPU. For example, if the resource reservation buffer base number is set to 1.1, it means that the current resources need to be reserved by 10% more.

[0061] The single-instance resource occupancy refers to the resource occupancy of a single instance on a single server. For example, a single instance may occupy 4 cores on a single server.

[0062] When the value calculated by formula (1) is greater than 0, it is determined that expansion is needed, and the specific number of servers that need expansion is the calculated value. For example, if the resource prediction increase rate for the next cycle is 160%, the current service resource usage is 100 cores, the resource reserve buffer base is set to 1.1, and the single instance resource occupancy is 4 cores, then formula (1) is calculated as (160% * 100 * 1.1 - 100) / 4 = 19, that is, expansion is needed, and the number of servers that need expansion is 19.

[0063] The second scenario involves excess capacity, and the formula for determining the need for capacity reduction is as follows:

[0064] (Prospective decrease in resources in the next cycle * Current service resource usage - Current service resource usage * Minimum resource retention threshold) / Single instance resource occupancy formula (2)

[0065] The predicted decrease in resources for the next cycle can be calculated using the capacity change output ratio data of the current time period T and the previous two time periods T-1 and T-2. For specific calculation methods, please refer to the example above.

[0066] The minimum resource reservation threshold refers to the minimum CPU utilization rate set for normal system operation, such as 10%.

[0067] The single-instance resource occupancy refers to the resource occupancy of a single instance on a single server. For example, a single instance may occupy 4 cores on a single server.

[0068] When the value calculated by formula (2) is greater than 0, it is determined that the server needs to be scaled down. The specific number of servers that need to be scaled down is the calculated value. For example, if the resource prediction decrease rate for the next cycle is 20%, the current service resource usage is 400 cores, the minimum resource retention threshold is 10%, and the single instance resource occupancy is 8 cores, then formula (2) is calculated as (20% * 400 - 400 * 10%) / 8 = 5, that is, the server needs to be scaled down and the number of servers that need to be scaled down is 5.

[0069] The intelligent scaling up / down method 100 includes step 103: After receiving the capacity adjustment request, the intelligent orchestration module analyzes and filters all servers and all instances under the current resource pool, and filters the corresponding servers to generate scaling up / down tasks, wherein the capacity adjustment request includes the capacity adjustment type and the number of servers to be adjusted.

[0070] The intelligent orchestration module determines the type of requirement and, when selecting corresponding servers, primarily categorizes them into solutions requiring scaling up and solutions requiring scaling down. See details below. Figure 2 As shown.

[0071] When the intelligent orchestration module determines that the demand type is an expansion demand, it sorts all current servers according to CPU allocation rate, that is, according to the available server resources. It then determines whether the resources of servers with sufficient resources can meet the demand. If the resources are insufficient, it requests new servers from the backup server pool. If the resources are sufficient or new servers are allocated, it sorts the servers according to CPU utilization and selects the top N servers as the expansion target servers.

[0072] When the intelligent orchestration module determines that the demand type is a scaling-down demand, it sorts the servers corresponding to all instances of the current service according to the number of service deployments on the servers, and selects the N servers with the fewest service deployments as the scaling-down target servers. If the number of service deployments is the same, it sorts them according to the CPU allocation rate and selects the top N servers as the scaling-down target servers.

[0073] The intelligent scaling method 100 includes step 104: After receiving the scaling task, the scaling module performs the scaling operation according to the scaling task.

[0074] The capacity-aware monitoring and analysis in steps 101-104 can generate the specific resource requirements of the service. Based on the total demand and combined with the intelligent orchestration algorithm, specific strategies and solutions for targeted scaling up and down of the service are generated. Finally, the scaling up and down is realized by combining with the automatic scaling up and down system.

[0075] Adjustments triggered by capacity warnings may result in uneven service distribution, potentially leading to insufficient allocation. Adjusting the layout requires changes to multiple services, but since capacity warnings themselves trigger changes, this is inconvenient. Therefore, adjustments can be made periodically during low traffic periods. Specifically, the intelligent scaling method 100 includes step 105: During low-traffic periods, a unified adjustment is made to all servers in the current resource pool at a certain period, preferably weekly. Step 105 involves uniformly reorganizing all distributions within the current resource pool during low-traffic periods. Through resource size sorting, optimal distribution is achieved while satisfying service mutual exclusion, and resource utilization is guaranteed while meeting redundancy thresholds.

[0076] The specific implementation method of step 105 is as follows:

[0077] First, calculate the number of optimizable servers in the current server resource pool based on the following formula:

[0078] The number of servers that can be optimized, Y = (allCpu * rate - needCpu * buffer) / instanceCost

[0079] needCpu = useCpu * current utilization rate / standard utilization rate Formula (3)

[0080] Where: allCpu: refers to the total number of cores in the resource pool;

[0081] needCpu: refers to the total actual CPU demand of the resource pool. For example, if the server resource pool uses 320c, the current CPU utilization rate is 3%, and the set requirement is 12%, then the total actual CPU demand is 80c (320*3% / 12%).

[0082] rate: refers to the expected allocation rate of the server. For example, if it is stipulated that the allocation rate of each server cannot exceed 90%, then the rate is 90%, that is, the total number of server cores * 90% is the total number of CPUs that can actually be allocated to the server.

[0083] buffer: refers to the space that the CPU needs to reserve. For example, if the buffer is 1.1, it means that 10% more resources need to be reserved for the current resource requirements.

[0084] instanceCost: refers to the number of cores in a single server, such as a server with 32 cores;

[0085] useCpu: refers to the number of cores already allocated within the resource pool;

[0086] Standard utilization rate: refers to a fixed value set in advance, usually 12%.

[0087] Formula (3) can be interpreted as follows: total cores * rate is the expected allocation rate, needCpu * buffer is the number of cores required for the service plus the reserved buffer, the difference between the two is the number of idle cores that can be optimized, and divided by instanceCost is the number of servers that can be optimized.

[0088] After calculating the number of servers that can be optimized, obtain the deployment information of all servers in the resource pool, filter out all machines that meet the adjustment conditions, which means that all services on the server can be automatically scaled up and down. Sort by the number of services deployed on the server, filter out the top X servers with the fewest deployed services, migrate them in a targeted manner, and deploy them to the remaining servers.

[0089] The specific deployment strategy is to sort all servers expected to be optimized from largest to smallest according to their remaining package capacity, sort all servers with reserved resources from largest to smallest, and then deploy all instances from servers to be decommissioned one by one onto servers expected to be reserved, excluding mutual exclusion conditions, which include port conflicts, deployment file conflicts, traffic peak conflicts, and all other conditions that do not meet the requirements for co-location deployment. The deployment is carried out in a cyclical manner, and the instances need to be reordered after each deployment is completed.

[0090] The specific process is as follows: Figure 3 As shown, the process involves obtaining a list of servers scheduled to be taken offline, retrieving instance information from the servers to be taken offline, sorting all instances on the servers to be taken offline by package from largest to smallest, iterating through the list of servers to be taken offline, sorting the remaining servers that are not taken offline by CPU remaining capacity from largest to smallest, iterating through all servers, determining if there are any instance conflicts, and if a conflict occurs, moving the original instance to this server, and finally determining if the iteration is complete.

[0091] Figure 4An exemplary embodiment of an intelligent scaling system 400 based on capacity warning is illustrated. The intelligent scaling system 400 includes a capacity monitoring module 401, which senses the CPU and memory information of the service in real time, determines the existence of risks based on CPU and memory utilization, and triggers a capacity alarm. The intelligent scaling system 400 includes a capacity analysis module 402, which, upon receiving a capacity alarm, obtains the current period's CPU allocation, CPU utilization, and user request rate information of the service, and generates a capacity adjustment request by determining whether the capacity change trend is an increasing or decreasing trend, and combining the service's capacity threshold and growth base. The intelligent scaling system 400 also includes an intelligent orchestration module 403, which, upon receiving a capacity adjustment request, analyzes and filters all servers in the current resource pool and all instances under the service, selecting the corresponding servers to generate scaling tasks. The intelligent scaling system 400 also includes a scaling module 404, which, upon receiving the scaling task, executes the scaling operation.

Claims

1. A smart scaling-up / scaling method based on capacity early warning, characterized in that, The method includes: Step 1: Real-time monitoring of the service's CPU and memory information; assessment of CPU and memory utilization to determine potential risks and trigger capacity alerts. Step 2: Obtain the CPU allocation, CPU utilization, and user request rate information for the current service period. By determining whether the capacity change trend is a capacity increase or a capacity decrease, and combining the service's capacity threshold and growth base, generate a capacity adjustment requirement. The capacity adjustment requirement includes the capacity adjustment type and the number of servers that need to be adjusted. The judgment and calculation are based on the following formula: (Proportion of resource forecast increase in the next cycle) Current service resource usage Resource Reserved Buffer Base (Current Service Resource Usage) / Single Instance Resource Occupancy, where the Resource Reserved Buffer Base refers to the space that needs to be reserved by the CPU, and the Single Instance Resource Occupancy refers to the occupancy of a single instance on a single server. When the value calculated by this formula is greater than 0, the capacity adjustment type is determined to be an expansion requirement type, and the number of servers that need to be adjusted is the calculated value. At the same time, the judgment and calculation are based on the following formula: (Proportion of resource decline in the next cycle) Current service resource usage - Current service resource usage (Minimum resource retention threshold) / single instance resource occupancy, where the minimum resource retention threshold refers to the minimum CPU utilization rate set during normal system operation. When the value calculated by this formula is greater than 0, the capacity adjustment type is determined to be a scaling-down requirement type, and the number of servers that need to be adjusted is the calculated value. Step 3: Based on the capacity adjustment requirements, analyze and filter all servers and instances under the current resource pool, and filter the corresponding servers to generate scaling tasks; Step 4: Perform the scaling up / down operation according to the scaling up / down task.

2. The intelligent scaling up / down method based on capacity early warning according to claim 1, characterized in that, In step two, the condition for determining that the capacity change trend is a capacity growth trend is that both the CPU utilization rate and the daily capacity change curve corresponding to the current period increase simultaneously. The condition for determining that the capacity change trend is a capacity decline trend is that all three factors—CPU utilization rate, the daily capacity change curve corresponding to the current period, and the user request rate—decline simultaneously.

3. The intelligent scaling up / down method based on capacity early warning according to claim 1, characterized in that, In step three, when the demand type is determined to be a scaling-down demand, the servers corresponding to all instances of the current service are sorted according to the number of service deployments on the servers, and the N servers with the fewest service deployments are selected as the scaling-down target servers.

4. The intelligent scaling up / down method based on capacity early warning according to claim 1, characterized in that, In step three, when the demand type is determined to be an expansion demand, all current servers are sorted according to their available server resource balance. It is then determined whether the resources of the servers with sufficient resource balance meet the demand. If the resources are insufficient, a new server is requested from the alternative server pool. If the resources are sufficient or the new server is allocated, the top N servers are sorted according to their CPU utilization and selected as the expansion target servers.

5. The intelligent scaling up / down method based on capacity early warning according to claim 1, characterized in that, Also includes: Step 5: During periods of low traffic, make unified adjustments to all servers in the current resource pool at regular intervals.

6. The intelligent scaling up / down method based on capacity early warning according to claim 5, characterized in that, Step five includes: calculating the number Y of servers that can be optimized in the current resource pool; Obtain the deployment information of all servers in the resource pool, sort them according to the number of services deployed on the servers, select the Y servers with the fewest services as the servers to be taken offline, and deploy all instances of the servers to be taken offline one by one to the servers to be reserved.

7. The intelligent scaling up / down method based on capacity early warning according to claim 6, characterized in that, The specific formula for calculating the number Y of servers that can be optimized in the current resource pool is as follows: Optimizable number of servers Y = (all CPUs) rate-needCpu buffer / instanceCost; needCpu=useCpu Current utilization rate / standard utilization rate; Where: allCpu: refers to the total number of cores in the resource pool; needCpu: refers to the total actual CPU demand of the resource pool; rate: refers to the expected allocation rate of the server; buffer: refers to the space that the CPU needs to reserve. instanceCost: refers to the number of cores in a single server; useCpu: refers to the number of cores already allocated in the resource pool.

8. An intelligent scaling-up / scaling system based on capacity early warning, characterized in that, The system includes: The capacity monitoring module senses the CPU and memory information of the service in real time, judges whether there is a risk based on the utilization of CPU and memory, and triggers capacity alarms. The capacity analysis module, upon receiving the capacity alarm, acquires information on the CPU allocation, CPU utilization, and user request rate for the current period's service. It then determines whether the capacity change trend is increasing or decreasing, and generates a capacity adjustment requirement based on the service's capacity threshold and growth base. This requirement includes the type of capacity adjustment and the number of servers requiring adjustment. The judgment and calculation are based on the following formula: (Proportion of resource increase in the next period) Current service resource usage The formula is: Resource Reserved Buffer Base (Current Service Resource Usage) / Single Instance Resource Occupancy. Here, the Resource Reserved Buffer Base refers to the space required for CPU reservation, and the Single Instance Resource Occupancy refers to the resource occupancy of a single instance on a single server. When the calculated value is greater than 0, the capacity adjustment type is determined to be an expansion request type, and the number of servers requiring adjustment is the calculated value. Simultaneously, the following formula is used for judgment and calculation: (Predicted Resource Decrease Ratio for the Next Period) Current service resource usage - Current service resource usage (Minimum resource retention threshold) / single instance resource occupancy, where the minimum resource retention threshold refers to the minimum CPU utilization rate set during normal system operation. When the value calculated by this formula is greater than 0, the capacity adjustment type is determined to be a scaling-down requirement type, and the number of servers that need to be adjusted is the calculated value. After receiving the capacity adjustment request, the intelligent orchestration module analyzes and filters all servers and all instances under the current resource pool, and selects the corresponding servers to generate scaling up and down tasks. The scaling module, upon receiving the scaling task, executes the scaling operation.

Citation Information

Patent Citations

  • Method and device for realizing intelligent capacity expansion of IPTV (Internet Protocol Television) based on time sequence correlation analysis

    CN114650450A

  • Server resource scheduling method and system

    CN114928606A