Method and device for expanding and shrinking capacity of nodes in machine room

By acquiring the resource usage of the computer room nodes and performing expansion and scaling processing according to the set threshold, the problem of low scaling efficiency of computer room nodes in the prior art is solved, and more efficient scaling operation is achieved.

CN119520291APending Publication Date: 2025-02-25MIGU CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411559814.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art has problems of inefficiency in the scaling processing of nodes in the computer room, especially in the case of repeated scaling, resulting in untimely service response.

Method used

By obtaining the current resource usage of each node in the computer room, it is determined whether the expansion and scaling conditions are met. The specific steps include: performing a stop access request processing at a node whose resource usage is less than the first capacity reduction threshold, and performing a reduction processing at a node whose resource usage is less than the second capacity reduction threshold.

Benefits of technology

It effectively reduces the frequent expansion and capacity operation of computer room nodes, improves the processing efficiency of expansion and capacity, and reduces the impact on business response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520291A_ABST
    Figure CN119520291A_ABST
Patent Text Reader

Abstract

The invention relates to a capacity expansion and shrinkage method and device for nodes in a machine room, and the method comprises the steps: obtaining the current resource usage amount of each node in the machine room, and carrying out the access stop request processing of a first capacity shrinkage node when the resource usage amount of each node in the machine room is smaller than a first capacity shrinkage threshold value; and when a second capacity reduction node of which the resource usage amount is smaller than a second capacity reduction threshold exists in the first capacity reduction nodes, carrying out capacity reduction processing on the second capacity reduction node. In the embodiment, a new access stopping request is carried out on a first capacity reduction node, of which the resource usage amount is smaller than a first capacity reduction threshold value, in nodes in a machine room, and processed services are continuously processed to prepare for capacity reduction; and when the second capacity reduction node meeting the condition that the resource usage amount is smaller than the second capacity reduction threshold exists in the first capacity reduction nodes, capacity reduction processing is performed on the second capacity reduction node, so that frequent capacity expansion and reduction processing on the nodes in the machine room can be effectively reduced, and the capacity expansion and reduction processing efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for scaling up and down nodes in a computer room. Background Art

[0002] In industries such as communications or electricity, computer rooms usually store servers and provide personalized services to users and employees. To meet actual needs, computer rooms generally have the ability to automatically expand and shrink capacity.

[0003] In the related technologies, the computer room can achieve rapid capacity expansion according to the current indicators, but it usually takes a period of time before the capacity can be reduced. As a result, the related technologies have the problem of repeated expansion and reduction, resulting in low efficiency of expansion and reduction. Summary of the invention

[0004] The present invention provides a method and device for scaling up and down nodes in a computer room.

[0005] According to a first aspect of the present disclosure, a method for scaling a node in a computer room is provided, the method comprising:

[0006] Get the current resource usage of each node in the computer room;

[0007] Based on the resource usage, when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room, a stop access request processing is performed on the first shrinking node; when there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes, shrinking processing is performed on the second shrinking node; wherein the first shrinking threshold is greater than the second shrinking threshold.

[0008] According to a second aspect of the present disclosure, a device for scaling a node in a computer room is provided, the device comprising:

[0009] The resource usage acquisition module is used to obtain the current resource usage of each node in the computer room;

[0010] A shrinking processing module is used to, based on the resource usage, perform a stop access request process on a first shrinking node when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room; and perform shrinking processing on the second shrinking node when there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes; wherein the first shrinking threshold is greater than the second shrinking threshold.

[0011] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.

[0012] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.

[0013] The method and device for scaling up and down nodes in a computer room provided by the embodiments of the present disclosure obtain the current resource usage of each node in the computer room, and based on the resource usage, when there is a first scaling-down node whose resource usage is less than a first scaling-down threshold among the nodes in the computer room, the first scaling-down node is stopped from accessing the request; and when there is a second scaling-down node whose resource usage is less than a second scaling-down threshold among the first scaling-down nodes, the second scaling-down node is scaled down. In the embodiments, the first scaling-down node among the nodes in the computer room that satisfies the requirement that the resource usage is less than the first scaling-down threshold is stopped from receiving new requests, and the processed services are continued to be processed, so as to prepare for scaling down; and when there is a second scaling-down node among the first scaling-down nodes that satisfies the requirement that the resource usage is less than the second scaling-down threshold, the second scaling-down node is scaled down. This can effectively reduce the frequent scaling-up and scaling-down of nodes in the computer room, thereby improving the scaling-up and scaling-down processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 A schematic diagram of a process for implementing node capacity expansion in a computer room in an embodiment of the present disclosure;

[0016] Figure 2 A schematic diagram of a process for implementing node capacity reduction in a computer room in an embodiment of the present disclosure;

[0017] Figure 3 A flowchart of a method for scaling up and down nodes in a computer room provided by an exemplary embodiment of the present disclosure;

[0018] Figure 4 A schematic block diagram of functional modules of a device for scaling capacity of a node in a computer room provided by an exemplary embodiment of the present disclosure;

[0019] Figure 5 A structural block diagram of an electronic device provided for an exemplary embodiment of the present disclosure;

[0020] Figure 6 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

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

[0023] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

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

[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0029] In related technologies, in order to achieve automatic expansion and contraction, automatic expansion and contraction processing is usually achieved through the automatic expansion and contraction mechanism (Horizontal Pod Autoscaler, HPA) component. The conditions for the HPA component to determine expansion and contraction are some indicators: Resource Metrics and Custom Metrics. The conditions can be various central processing units (Central Processing Unit, CPU) or memory metrics of business operations, and custom metrics are also reserved for expansion. The expected number of running instances can be calculated according to the following formula:

[0030] Exp_instance=ceil[cur_instance*(cur_metrics / exp_metrics)] (1)

[0031] Among them, exp_instance is the expected number of running instances, exp_metrics is the expected metric, cur_instance is the current number of running instances, and cur_metrics is the current metric.

[0032] Among them, starting from version 1.7, Kubernetes itself has incubated a basic performance data collection and monitoring framework - Kubernetes Monitoring Architecture, so as to better support HPA and other functional modules that need to use basic performance data. In Kubernetes Monitoring Architecture, Kubernetes defines a set of standardized API interfaces Resource Metrics API to facilitate client applications (such as HPA) to obtain performance data of target resource objects from Metrics Server, such as CPU and memory usage data of containers. In the Kubernetes architecture, custom monitoring indicators can be provided through Custom Metrics, and user-specified extension policies can also be executed through Custom Metrics.

[0033] For expansion operations, the maximum number of nodes on the platform is limited, and for reduction operations, the basic service needs of the platform must be met. In order to avoid the impact of frequent automatic expansion and reduction on services, HPA has designed a strategy of fast expansion and slow reduction. By default:

[0034] 1. Metrics calculates the current indicator every 10 seconds, then executes the above formula to calculate the number of instances expected to run under the current indicator and puts it into a sample pool (the sample pool automatically discards data older than 5 minutes);

[0035] 2. Then obtain the maximum value in the sample pool as the final number of running instances.

[0036] In this way, if the indicator is relatively high, the number of instances will be adjusted up in the next computing cycle. Once the capacity is expanded, the next time it needs to be reduced, it will take at least 5 minutes (waiting for the maximum value in the sample pool to expire). It is precisely because of this strategy that business fluctuations can be smoothed.

[0037] The above HPA component provides a macro formula for calculating the expected number of instances for scaling and simplifies the system complexity, but it still has the following problems:

[0038] 1. The expected running instance is a general expected value calculated by a formula, which cannot guarantee that the system can meet the business expansion requirements in a short period of time. Although it supports fast expansion, there is a risk of continuous expansion, which leads to great business pressure.

[0039] 2. The strategy of fast expansion and slow reduction simplifies the system complexity and makes business fluctuations smoother. However, the 5-minute silent period does not take into account too many business forms, resulting in repeated expansion and reduction, and there is also a risk of not being able to meet business response requirements.

[0040] Therefore, in order to solve the above technical problems and improve the efficiency of scaling the capacity of each node in the computer room, it is assumed that all node devices in the computer room can have corresponding services, and the network policies have been opened up, and there are no business-related issues such as software installation.

[0041] 1) You can set the capacity expansion threshold by performing stress testing based on the existing machine nodes in the computer room.

[0042] (1) The bandwidth can be calculated using the following formula:

[0043]

[0044] in, It represents the average bit rate, bandwith represents the bandwidth, and users represents the number of viewers, which is also the number of concurrent channels.

[0045] In the embodiment, the usage of different bit rates in actual services can be counted according to historical data to obtain more accurate bandwidth data. Therefore, the above formula (2) can be optimized to obtain:

[0046]

[0047] Where, bandwith represents bandwidth, C i Indicates the bit rate, P i It indicates the percentage corresponding to the bit rate, and users indicates the number of viewers, that is, the number of concurrent channels.

[0048] (2) Use indicators such as success rate, network packet loss rate, or video freeze (such as caused by excessive CPU usage) as stress testing evaluation indicators.

[0049] In the embodiment, the purpose of stress testing is to find the maximum load limit of the computer room, that is, the maximum load. When this limit is exceeded, the user experience will be affected. For example, when the real-time traffic of the node exceeds 600G bandwidth, the success rate will decrease, the packet loss rate will increase, and the client will experience freezes. At this time, 600G is the maximum limit that can be tolerated.

[0050] Another purpose of stress testing is to evaluate the number of concurrency that a single node can handle and the amount of bandwidth traffic that can be relieved under common configurations (such as the number of cores, the amount of memory, the amount of network cards, etc.), so as to calculate the minimum number of nodes required to handle the corresponding amount of bandwidth traffic.

[0051] 2) Circularly determine whether the current computer room meets the expansion conditions. If so, continue to execute the following step 3).

[0052] Combined with the business scenarios in the actual production environment, the expansion conditions should not only consider the upper limit of the stress test indicators, but also the real-time load of the software. For example, if the current node traffic exceeds 600G and the CPU load of Nginx soars to 800% and lasts for more than 1 minute, then it can be considered that the expansion conditions are met.

[0053] Therefore, the embodiment can determine whether the expansion conditions are met in combination with the load of the computer room, the traffic of the node and the duration, and can be specifically set as needed, and the embodiment is not limited thereto.

[0054] 3) Based on the offline training prediction model, the predicted peak value can be calculated by inputting the current real-time indicator data, and the resources that need to be expanded can be calculated and reported to the Master node for resource invitation.

[0055] (1) The generalized autoregressive conditional heteroskedasticity GARCH model can be used to model network bandwidth. Simulation experiments show that this model can better describe the heteroskedasticity of network traffic data.

[0056] Specifically, the bandwidth flow data within a period of time in the historical period may be obtained, for example, the bandwidth flow corresponding to each minute may be recorded in the form of a time series.

[0057] In the embodiment, the GARCH (1,1), EGARCH or TAGRCH model can be selected according to the characteristics of the data and volatility, and the Akaike information criterion (AIC) and Bayesian information criterion (BIC) statistical criteria are applied to fix the orders of p and q in the model.

[0058] The maximum likelihood estimation method can be used to estimate the model parameters, and the fitting effect of the model can be verified by the heteroskedasticity of the residuals. In this way, the possible peak value of the traffic can be comprehensively predicted by combining the ARIMA+GARCH model, where ARIMA is responsible for predicting the mean part and GARCH is responsible for predicting the volatility part.

[0059] (2) Calculate the machine resources that need to be expanded based on the difference between the bandwidth peak and the upper limit of the nodes in the current networked computer room;

[0060] In the embodiment, the peak value is predicted by the above model, and combined with the upper limit of the stress test, it is possible to calculate how much traffic the current computer room needs to supplement. And according to the single machine carrying capacity obtained by the stress test, it is calculated how many machines with such configuration are needed to carry the additional traffic. It should be noted that the nodes in the embodiment can be machines or devices, for example, a node can be a server, etc., and the embodiment is not limited to this.

[0061] 4) Other nodes in the computer room will report their idle resources to the Master regularly or periodically, including information about resources such as CPU or memory. The Master will report the required resources based on the above step 3) and match the resources using the maximum-minimum fairness algorithm.

[0062] In the embodiment, resources are allocated in descending order of demand, so there is no situation where the resources obtained by the user exceed the application demand.

[0063] Among them, the maximum-min fairness algorithm will first identify the dominant resource and calculate the usage ratio of each resource (CPU or memory). The dominant resource is the resource (task) with the highest usage ratio. The maximum-min fairness algorithm allows more flexible management of multiple types of resources and can be easily expanded to new types of resources. By meeting multiple combinations of requirements at the same time, you can choose the combination with the least machines for expansion to improve the efficiency of expansion.

[0064] In the embodiment, the list information of the nodes that need to be expanded can be obtained through the above embodiment, and the relevant expansion script can be executed. It is determined whether the expansion operation is completed through a loop. If it is completed, a notification of the completion of the expansion can be generated by phone, text message or email. Otherwise, if the expansion is not completed, it is necessary to re-determine.

[0065] For example, Figure 1 As shown, Figure 1 The present invention is a flowchart of implementing node capacity expansion in a computer room in an embodiment of the present disclosure.

[0066] In the embodiment, the capacity expansion threshold can be set based on the capacity stress test of the existing machine nodes in the computer room.

[0067] (1) If the bandwidth of a single network card is 20G and there are 10 nodes in the computer room, then the maximum bandwidth of the computer room is 10*20=200G;

[0068] (2) Using the above optimized bandwidth calculation formula (2) to calculate the bandwidth;

[0069] (3) For stress test evaluation indicators: For example, the success rate must be 100% and the network packet loss rate must not exceed 1%;

[0070] (4) The bandwidth is 180G, and the number of viewers (concurrent channels) is:

[0071]

[0072] According to the above formula (4), users = 180*1024 / (5.23*39%+3.87*48%+4.2*13%) = 41482.68, that is, the maximum number of concurrent paths for a single node is 4148.

[0073] (5) In the embodiment, the setting of the expansion threshold should include both the load of a single node and the overall capacity.

[0074] In the embodiment provided by the present disclosure, it is possible to determine in a loop whether the current computer room meets the expansion conditions. If so, the offline trained network bandwidth peak prediction model is used for prediction to calculate the required expansion resources. Otherwise, the system sleeps for 30 seconds and waits for the next determination.

[0075] In the embodiment, the required bandwidth is obtained by calculation, and the required number of concurrent paths is counted, the required machine resource list is evaluated, reported to the Master node, and the available expansion Agent machine information is generated to make resource invitations. For example, it is assumed that 8 CPUs and 64G memory are required.

[0076] In the embodiment, the offline nodes in the computer room can periodically report the idle resources of the nodes to the Master, including information such as CPU or memory, and the Master reports the required resources according to step 4, and performs resource matching using the maximum-minimum fairness algorithm.

[0077] Specifically, there can be a set of distributed services that use Zookeeper for high availability. The role of the Master service is to collect and summarize the available resources of each child node and match them according to the reported resources. By periodically reporting available resources, on the one hand, it ensures that the node is available, and on the other hand, it determines the amount of available resources. And resources are allocated in descending order of demand, and do not exceed the application demand;

[0078] Through the above embodiment, the list information of capacity expansion can be obtained, and the automatic capacity expansion script can be triggered to execute. After the capacity expansion is completed, the operation and maintenance personnel can be notified by telephone, SMS or email and other tools to complete the capacity expansion task.

[0079] It should be noted that the expansion and reduction processes in the embodiment may be independent of each other, and the reduction may only be for the expanded nodes, rather than the entire service cluster.

[0080] Combination Figure 2 As shown, when shrinking the above-mentioned expanded nodes, two-stage shrinking thresholds can be set according to relevant indicator information (such as bandwidth indicator) of existing online machine nodes of the business.

[0081] (1) According to historical data statistics, in the first stage, it is cyclically determined whether the no-entry switch is turned on. When the following two conditions are met, the no-entry mode is turned on and requests are no longer sent to the scaled-in node.

[0082] Specifically, ① when the real-time bandwidth flow of the current computer room is lower than the threshold, it can be ensured that the original cluster can carry the current flow; for example, the threshold may be: computer room warning value - expansion bandwidth amount.

[0083] ② The CPU load of Nginx used for load balancing in the computer room remains below 500% for more than 10 minutes.

[0084] (2) In the second stage, the 90% quantile is found and used as the threshold for the capacity reduction operation. The 90% quantile can be the overall traffic of the entire network, that is, the peak value of the entire network.

[0085] The main purpose of dividing the capacity reduction into two stages is to make it unaware for users. Data statistics can be performed based on recent time (such as the past 7 days) to obtain the bandwidth flow value of the 50% percentile, which is much lower than the warning value of 600G in the computer room. At this time, the CPU usage of nginx used for load balancing in a single computer room is very low (such as being lower than 500% for 10 minutes), indicating that the original machine can fully withstand the pressure. This is used as the threshold for clearing the node before reducing capacity, so that requests are no longer sent to the reduced node.

[0086] (3) Loop to determine whether the current computer room meets the conditions for shrinking. If so, obtain the expansion agent in the editing machine, that is, shrinking is only performed on the nodes that have been expanded. Through the preparation before shrinking, the request is no longer allocated to the node, etc., so that the node is vacant. In the embodiment, the shrinking process can be performed by executing the relevant shrinking script. After the shrinking is completed, a notification can be made through tools such as phone, text message or email.

[0087] Specifically, the automatic scaling-down solution can be described by the following scaling-down example:

[0088] 1) Query the historical bandwidth data for the past 7 days.

[0089] (1) The real-time bandwidth of the computer room is determined to be lower than (warning value - expansion capacity) in a loop, and the Nginx load continues to decrease. This is used as the condition for opening the first-stage traffic ban switch to reduce the amount of traffic entering the node to be reduced.

[0090] (2) Obtain the 90% quantile statistically as the second-stage scaling-down threshold and update it to the cache daily so that the scaling-down program can obtain it;

[0091] 2) Determine whether there is a node to be expanded in the current network machine through the capacity reduction program, if not, wait for the next determination, otherwise execute step 3);

[0092] 3) If there are currently expanded machine nodes in the network nodes, it is determined whether the current indicator has dropped to the first stage shrinking threshold level. At this time, new requests will no longer be sent to the expanded nodes, that is, requests are only outgoing but not incoming, making preparations before release;

[0093] 4) When the current indicator drops to the second stage shrinking threshold level and there is no service request on the expansion node, the automatic shrinking script is triggered to execute;

[0094] 5) After the reduction is completed, the operation and maintenance personnel will be notified through telephone, text messages, emails, etc. that the reduction task has been completed.

[0095] Based on the above embodiments, the present disclosure also provides a method for scaling nodes in a computer room. Figure 3As shown, the method may include the following steps:

[0096] In step S310, the current resource usage of each node in the computer room is obtained.

[0097] In the embodiment, the computer room may include multiple nodes, each of which is equivalent to a device. The nodes in the embodiment may be used to receive user requests and process the user requests. For example, the node in the computer room may receive a stream pull request sent by a user, and the stream pull request is used to pull audio and video streams such as live broadcasts. After receiving the stream pull request from the user, the node in the computer room may push the stream to the user, for example, push audio and video streams such as live broadcasts to the user.

[0098] Therefore, the current resource usage of each node in the computer room can be obtained to determine whether the nodes in the computer room need to be expanded to avoid excessive pressure on the nodes and affect the user experience. For example, if the pressure on a node is too high, freezes may occur on the user side.

[0099] In step S320, based on resource usage, when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room, a stop access request process is performed on the first shrinking node. When there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes, a shrinking process is performed on the second shrinking node. The first shrinking threshold is greater than the second shrinking threshold.

[0100] In an embodiment, by obtaining the current resource usage of each node in the computer room, based on the resource usage, when there is a first shrinking node in each node in the computer room whose resource usage is less than a first shrinking threshold, the first shrinking node is stopped from accessing the request; when there is a second shrinking node in the first shrinking node whose resource usage is less than a second shrinking threshold, the second shrinking node is shrunk. In an embodiment, by stopping access to new requests for the first shrinking node in each node in the computer room that satisfies the requirement that the resource usage is less than the first shrinking threshold, and continuing to process the processed business, preparation is made for shrinking; and when there is a second shrinking node in the first shrinking node that satisfies the requirement that the resource usage is less than the second shrinking threshold, the second shrinking node is shrunk. This can effectively reduce the frequent expansion and contraction processing of the nodes in the computer room, thereby improving the processing efficiency of expansion and contraction.

[0101] Based on the above embodiment, in another embodiment provided by the present disclosure, the above step S320 may further include the following steps:

[0102] In step S321, when there is an expansion node that needs to be expanded in the computer room, the expansion node is expanded by using idle resources of non-expansion nodes in the computer room.

[0103] In the embodiment, since the computer room includes multiple nodes, and different nodes may process different tasks, some nodes may be overloaded, while some nodes may be under too little pressure. Therefore, in order to balance the load, the nodes that need to be expanded can be expanded by using the idle resources of other nodes in the computer room to reduce the nodes with too much pressure.

[0104] In step S322, based on the current resource usage of the expanded nodes after the expansion process, when there is a first shrunk node whose resource usage is less than the first shrunk threshold among the expanded nodes after the expansion process, a stop access request process is performed on the first shrunk node.

[0105] In an embodiment, with respect to the current resource usage of the expanded node after the expansion process, if the pressure of the expanded node after the expansion process gradually decreases, if there is a first shrunk node in the expanded node after the expansion process whose resource usage is less than the first shrunk threshold, the first shrunk node can be prepared before the shrunk process, that is, the access request is stopped for the first shrunk node, so that the first shrunk node can process the already accessed requests by stopping accessing new requests. The request in the embodiment can specifically be a business request, such as a stream pulling request.

[0106] In this way, the first shrinking node processes the service requests that have been received, and stops receiving new requests, in preparation for the shrinking process of the first shrinking node. At this time, if it is detected that there is a second shrinking node whose resource usage is less than the second shrinking threshold in the first shrinking node, the second shrinking node can be shrunk, which can effectively reduce frequent expansion and shrinking operations and effectively reduce the impact on service response.

[0107] Specifically, the current bandwidth flow of the expanded node after the expansion process can be obtained, and when the bandwidth flow is less than the first preset threshold, and the resource load rate of the computer room for load balancing is lower than the second preset threshold and lasts for a preset time period, it is determined that there is a first reduced capacity node whose resource usage is less than the first reduced capacity threshold among the expanded nodes after the expansion process. At this time, the access stop request process can be performed on the first reduced capacity node to prepare for the reduction process.

[0108] In the embodiment, when the bandwidth flow is less than the third preset threshold, and the resource load rate of the computer room for load balancing is lower than the fourth preset threshold and lasts for a preset time period, it is determined that there is a second shrinking node in the first shrinking node whose resource usage is less than the second shrinking threshold. At this time, the expansion process of the second shrinking node through the idle resources of the non-expanding nodes in the computer room can be cancelled, so as to achieve the purpose of shrinking the second shrinking node. Wherein, the first preset threshold is greater than the third preset threshold, and the second preset threshold is greater than the fourth preset threshold;

[0109] The method for scaling nodes in a computer room provided by the embodiment of the present disclosure obtains the current resource usage of each node in the computer room. When there is a capacity expansion node that needs to be expanded in the computer room, the capacity expansion node is expanded through the idle resources of the non-capacity expansion node in the computer room. And based on the current resource usage of the capacity expansion node after the capacity expansion, when there is a first capacity reduction node whose resource usage is less than the first capacity reduction threshold in the capacity expansion node after the capacity expansion, the first capacity reduction node is stopped from accessing the request; when there is a second capacity reduction node whose resource usage is less than the second capacity reduction threshold in the first capacity reduction node, the second capacity reduction node is scaled down. In the embodiment, the first capacity reduction node in the expanded node that meets the resource usage less than the first capacity reduction threshold is stopped from accessing new requests, and the processed business is continued to be processed to prepare for the capacity reduction; and when there is a second capacity reduction node in the first capacity reduction node that meets the resource usage less than the second capacity reduction threshold, the second capacity reduction node is scaled down, which can effectively reduce the frequent capacity expansion and contraction of the nodes in the computer room, thereby improving the processing efficiency of capacity expansion and contraction.

[0110] Based on the above embodiment, in another embodiment provided by the present disclosure, the current resource usage of each node may include bandwidth flow and load rate. In this way, when there is a flow greater than a preset flow and a load rate greater than a preset load rate in the computer room, it can be determined that there is an expansion node in the computer room that needs to be expanded. Therefore, the above step S321 may further include the following steps:

[0111] In step S3211, based on the current traffic of the expansion node and a pre-built bandwidth peak prediction model, the bandwidth peak of the expansion node is predicted.

[0112] The bandwidth flow fluctuation data in the target historical time period in the computer room is used as a training sample to train the preset model to obtain a bandwidth peak prediction model. The details can be found in the description of the above embodiment, which will not be repeated here.

[0113] In step S3212, based on the bandwidth peak and the upper limit of the traffic carried by the expansion node, the required traffic to be expanded by the expansion node is determined.

[0114] In an embodiment, the difference between the bandwidth peak and the upper limit of the traffic carried by the expansion node may be obtained, and the difference is the to-be-expanded traffic required by the expansion node.

[0115] In step S3213, idle resources of non-expanded nodes in the computer room are acquired based on the traffic to be expanded, and expansion processing is performed on the expanded nodes using the idle resources.

[0116] In an embodiment, the non-expandable nodes in the computer room may report their own idle resources periodically or in real time, so that the reported idle resources may be used for the expansion processing of the expanded nodes.

[0117] Specifically, the resource allocation priority required in the expansion node can be obtained based on the resource allocation priority, and the idle resources can be allocated to the expansion node according to the resource usage ratio. Among them, the resource allocation priority is positively correlated with the resource usage ratio of the expansion node, and the priority of the node with a higher resource usage ratio can be set higher.

[0118] In the case of dividing each functional module according to each function, an embodiment of the present disclosure provides a device for scaling up and down a node in a computer room, and the device for scaling up and down a node in a computer room may be a server, a terminal, or a chip applied to a server. Figure 4 This is a schematic block diagram of the functional modules of a device for scaling capacity of a node in a computer room provided by an exemplary embodiment of the present disclosure. Figure 4 As shown, the expansion and contraction device of the node in the computer room includes:

[0119] The resource usage acquisition module 10 is used to obtain the current resource usage of each node in the computer room;

[0120] The shrinking processing module 20 is used to, based on the resource usage, perform a stop access request process on a first shrinking node when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room; and perform shrinking processing on the second shrinking node when there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes; wherein the first shrinking threshold is greater than the second shrinking threshold.

[0121] In another embodiment provided by the present disclosure, the shrinking processing module is further used to:

[0122] When there is an expansion node that needs to be expanded in the computer room, the expansion node is expanded by using idle resources of non-expansion nodes in the computer room;

[0123] Based on the current resource usage of the expanded node after the expansion process, when there is a first shrunk node whose resource usage is less than a first shrunk threshold among the expanded nodes after the expansion process, a stop access request process is performed on the first shrunk node.

[0124] In another embodiment provided by the present disclosure, the current resource usage of each node includes bandwidth flow and load rate; the device further includes:

[0125] The expansion node determination module is used to determine that there is an expansion node in the computer room that needs to be expanded when the flow in the computer room is greater than the preset flow and the load rate is greater than the preset load rate.

[0126] In another embodiment provided by the present disclosure, the shrinking processing module is further used to:

[0127] Based on the current traffic of the expansion node and the pre-built bandwidth peak prediction model, the bandwidth peak of the expansion node is predicted; wherein the bandwidth traffic volatility data in the target historical time period in the computer room is used as a training sample to train the preset model to obtain the bandwidth peak prediction model;

[0128] Determine the required traffic to be expanded by the expansion node based on the bandwidth peak and the upper limit of the traffic carried by the expansion node;

[0129] Based on the traffic to be expanded, idle resources of non-expanded nodes in the computer room are acquired, and expansion processing is performed on the expanded nodes through the idle resources.

[0130] In another embodiment provided by the present disclosure, the shrinking processing module is further used to:

[0131] Obtaining a resource allocation priority required in the expansion node, where the resource allocation priority is positively correlated with a resource usage ratio of the expansion node;

[0132] Based on the resource allocation priority, the idle resources are allocated to the expansion nodes according to the resource usage ratio.

[0133] In another embodiment provided by the present disclosure, the device includes:

[0134] A bandwidth flow acquisition module is used to acquire the current bandwidth flow of the expanded node after the expansion process;

[0135] The first shrinking node determination module is used to determine that there is a first shrinking node whose resource usage is less than the first shrinking threshold value among the expanded nodes after the expansion processing, when the bandwidth flow is less than the first preset threshold value and the resource load rate of the computer room for load balancing is lower than the second preset threshold value and lasts for a preset time period.

[0136] When the bandwidth flow is less than the third preset threshold, and the resource load rate of the computer room for load balancing is lower than the fourth preset threshold and lasts for a preset time period, it is determined that there is a second capacity reduction node in the first capacity reduction node whose resource usage is less than the second capacity reduction threshold; wherein the first preset threshold is greater than the third preset threshold, and the second preset threshold is greater than the fourth preset threshold;

[0137] The expansion process of the second reduced capacity node by using the idle resources of the non-expanded capacity nodes in the computer room is canceled.

[0138] The relevant device part corresponds to the above-mentioned embodiment, and the specific embodiment corresponding to the method is not repeated here.

[0139] The device for scaling nodes in a computer room provided by the embodiment of the present disclosure obtains the current resource usage of each node in the computer room. When there is a capacity expansion node that needs to be expanded in the computer room, the capacity expansion node is expanded by using the idle resources of the non-capacity expansion nodes in the computer room. And based on the current resource usage of the capacity expansion node after the capacity expansion process, when there is a first capacity reduction node whose resource usage is less than the first capacity reduction threshold among the capacity expansion nodes after the capacity expansion process, the first capacity reduction node is subjected to a stop access request process; when there is a second capacity reduction node whose resource usage is less than the second capacity reduction threshold among the first capacity reduction nodes, the second capacity reduction node is subjected to a capacity reduction process. In this way, frequent capacity expansion and contraction operations can be effectively reduced, thereby improving the efficiency of capacity expansion and contraction.

[0140] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.

[0141] Figure 5 The structure diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801 , and the processor 1801 can execute corresponding steps in the above method disclosed in the embodiment of the present disclosure.

[0142] The processor 1801 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 1801 or by instructions in the form of software. The processor 1801 may be a general-purpose processor, a digital signal processor (DSP), an ASIC (Application Specific Integrated Circuit), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 1802, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 1801 reads the information in the memory 1802 and completes the steps of the method in combination with its hardware.

[0143] In addition, when various operations / processes according to the present disclosure are implemented by software and / or firmware, they can be transmitted from a storage medium or a network to a computer system having a dedicated hardware structure, such as Figure 6 The computer system 1900 shown is installed with the programs constituting the software. When the various programs are installed, the computer system can perform various functions, including the functions described above. Figure 6 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure.

[0144] Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0145] like Figure 6As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 to a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the computer system 1900 can also be stored. The computing unit 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.

[0146] A plurality of components in the computer system 1900 are connected to the I / O interface 1905, including: an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. The input unit 1906 may be any type of device capable of inputting information to the computer system 1900, and the input unit 1906 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 1907 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1908 may include, but is not limited to, a disk, an optical disk. The communication unit 1909 allows the computer system 1900 to exchange information / data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0147] The computing unit 1901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above methods disclosed in the embodiments of the present disclosure in any other appropriate manner (e.g., by means of firmware).

[0148] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.

[0149] The computer-readable storage medium in the disclosed embodiments may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specifically, the computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0151] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the embodiments of the present disclosure is implemented.

[0152] In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages ​​or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0154] The modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.

[0155] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0156] The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).

[0157] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims

1. A method for scaling up and down nodes in a computer room, characterized in that: The method comprises: Get the current resource usage of each node in the computer room; Based on the resource usage, when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room, a stop access request processing is performed on the first shrinking node; when there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes, shrinking processing is performed on the second shrinking node; wherein the first shrinking threshold is greater than the second shrinking threshold.

2. The method according to claim 1, characterized in that When there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room, performing a stop access request process on the first shrinking node, comprising: When there is an expansion node that needs to be expanded in the computer room, the expansion node is expanded by using idle resources of non-expansion nodes in the computer room; Based on the current resource usage of the expanded node after the expansion process, when there is a first shrunk node whose resource usage is less than a first shrunk threshold among the expanded nodes after the expansion process, a stop access request process is performed on the first shrunk node.

3. The method according to claim 2, characterized in that The current resource usage of each node includes bandwidth flow and load rate; the method further includes: When the flow in the computer room is greater than the preset flow and the load rate is greater than the preset load rate, it is determined that there is an expansion node that needs to be expanded in the computer room.

4. The method according to claim 3, characterized in that The step of performing capacity expansion processing on the expansion node by using idle resources of the non-expanded nodes in the computer room includes: Based on the current traffic of the expansion node and the pre-built bandwidth peak prediction model, the bandwidth peak of the expansion node is predicted; wherein the bandwidth traffic volatility data in the target historical time period in the computer room is used as a training sample to train the preset model to obtain the bandwidth peak prediction model; Determine the required traffic to be expanded by the expansion node based on the bandwidth peak and the upper limit of the traffic carried by the expansion node; Based on the traffic to be expanded, idle resources of non-expanded nodes in the computer room are acquired, and expansion processing is performed on the expanded nodes through the idle resources.

5. The method according to claim 4, characterized in that The step of performing capacity expansion processing on the expansion node by using the idle resources includes: Obtaining a resource allocation priority required in the expansion node, where the resource allocation priority is positively correlated with a resource usage ratio of the expansion node; Based on the resource allocation priority, the idle resources are allocated to the expansion nodes according to the resource usage ratio.

6. The method according to claim 2, characterized in that The method comprises: Obtaining the current bandwidth flow of the expanded node after the expansion process; When the bandwidth flow is less than the first preset threshold, and the resource load rate of the computer room for load balancing is lower than the second preset threshold and lasts for a preset time period, it is determined that there is a first shrinking node whose resource usage is less than the first shrinking threshold among the expanded nodes after the expansion process; Alternatively, when the bandwidth flow is less than the third preset threshold, and the resource load rate of the computer room for load balancing is lower than the fourth preset threshold and lasts for a preset time period, it is determined that there is a second capacity reduction node in the first capacity reduction node whose resource usage is less than the second capacity reduction threshold; wherein the first preset threshold is greater than the third preset threshold, and the second preset threshold is greater than the fourth preset threshold; The expansion process of the second reduced capacity node by using the idle resources of the non-expanded capacity nodes in the computer room is canceled.

7. A device for expanding and contracting nodes in a computer room, characterized in that: The device comprises: The resource usage acquisition module is used to obtain the current resource usage of each node in the computer room; A shrinking processing module is used to, based on the resource usage, perform a stop access request process on a first shrinking node when there is a first shrinking node whose resource usage is less than a first shrinking threshold among the nodes in the computer room; and perform shrinking processing on the second shrinking node when there is a second shrinking node whose resource usage is less than a second shrinking threshold among the first shrinking nodes; wherein the first shrinking threshold is greater than the second shrinking threshold.

8. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Telescopic capacity control method and device for Kubernetes container cluster and network equipment

    CN111464355A

  • Streaming media cluster node management method and device and storage medium

    CN112468310A

  • Server cluster capacity evaluation method and device, electronic equipment and storage medium

    CN113407426A

  • Capacity expansion and contraction method and device, electronic equipment and readable storage medium

    CN116244069A

  • Data fluctuation early warning method and device, nonvolatile storage medium and electronic equipment

    CN117744033A