Server capacity adjustment method and device, storage medium and electronic device

Through the clustering model, the capacity parameters of the server are analyzed and capacity adjustment is performed, which solves the problem of unbalanced server load in the cloud computing system, improves resource utilization and stability, and reduces energy consumption.

CN114401195BActive Publication Date: 2024-11-29CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210041874.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2024-11-29
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

In the dynamic load balancing algorithm of cloud computing systems, the resource usage caused by server load status differences is too high, resulting in a decline in computing service quality and it is difficult to effectively adjust capacity resources.

Method used

By obtaining the clustering parameters of the server (CPU usage peak, disk utilization peak and capacity normal rate), using the clustering model for analysis, determine whether the capacity adjustment conditions are met, and perform corresponding capacity adjustment operations, and optimize through negative feedback adjustment Resource configuration.

Benefits of technology

It realizes accurate and reasonable scheduling of server capacity resources, improves the resource utilization and stability of the cloud computing platform, reduces energy consumption, and ensures the quality of computing services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114401195B_ABST
    Figure CN114401195B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for adjusting the capacity of a server, a storage medium and an electronic device, wherein the clustering parameters of the server can be obtained, and the clustering parameters of the server include at least one of the following: the peak value of the CPU usage rate of the server, the peak value of the disk utilization rate and the normal capacity rate of the instance of the application system to which the server belongs; the clustering model corresponding to the clustering parameters of the application server is used to perform clustering analysis on the clustering parameters of each server to obtain the clustering analysis results corresponding to the server; if it is determined according to the clustering analysis results of the server that the server meets the first capacity adjustment condition, the first capacity adjustment operation corresponding to the clustering analysis result is performed on the server; the resource usage score of the adjusted server is calculated, and if it is determined according to the resource usage score that the server meets the second capacity adjustment condition, the second capacity adjustment operation corresponding to the resource usage score is performed on the server. The capacity resources of the server can be adjusted accurately and reasonably.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for adjusting the capacity of a server, a storage medium and an electronic device. Background Art

[0002] Cloud computing system is a large-scale computing system composed of multiple servers, which can be used to perform large-scale data analysis and processing tasks. Cloud computing services will generate unnecessary resource waste when the application system is running. How to efficiently use cloud computing service resources is one of the key research objects in the current development of cloud computing.

[0003] In the prior art, cloud computing systems usually use dynamic load balancing algorithms to adjust the capacity of servers. When the dynamic load balancing algorithm runs for a long time on the server, the load state of the server itself will vary greatly. For sudden traffic requests, it will still cause an unbalanced load on the server cluster of the cloud computing system, thereby bringing greater concurrent request pressure to the server cluster. Resource occupation will occur due to excessive server load, resulting in a decrease in the quality of computing services provided to the outside world. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for adjusting the capacity of a server, which can accurately and reasonably schedule the capacity resources of the server.

[0005] The present invention also provides a server capacity adjustment device to ensure the implementation and application of the above method in practice.

[0006] A method for adjusting the capacity of a server, comprising:

[0007] In response to the capacity analysis instruction, a clustering parameter of each server to be analyzed is obtained, wherein the clustering parameter of each server includes at least one of the following: a CPU usage peak value, a disk utilization peak value of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs;

[0008] Applying the clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameter of each server, to obtain a clustering analysis result corresponding to each server;

[0009] For each of the servers, determine whether the server meets a preset first capacity adjustment condition based on the cluster analysis result of the server; if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the cluster analysis result on the server to update the capacity resource configuration of the server; calculate the updated resource usage score of the server, and determine whether the server meets a preset second capacity adjustment condition based on the resource usage score; if the server meets the preset second capacity adjustment condition, perform a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again.

[0010] The above method, optionally, applying the clustering model corresponding to the clustering parameter of each server to perform cluster analysis on the clustering parameter of each server to obtain the clustering analysis result corresponding to each server includes:

[0011] In a case where the clustering parameter of the server includes the CPU usage peak, applying a first clustering model corresponding to the CPU usage peak, performing cluster analysis on the CPU usage peak, and obtaining a first cluster analysis result;

[0012] In the case where the clustering parameter of the server includes the disk utilization peak value, applying a second clustering model corresponding to the disk utilization peak value, performing cluster analysis on the disk utilization peak value, and obtaining a second cluster analysis result;

[0013] In the case that the clustering parameter of the server includes the capacity normal rate, a third clustering model corresponding to the capacity normal rate is applied to perform cluster analysis on the capacity normal rate to obtain a third cluster analysis result.

[0014] In the above method, optionally, determining whether the server meets a preset first capacity adjustment condition according to the cluster analysis result of the server includes:

[0015] If at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity, it is determined that the server meets a preset first capacity adjustment condition.

[0016] In the above method, optionally, the step of calculating the updated resource usage score of the server includes:

[0017] Monitoring the resource usage of the updated server within a preset observation time to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage of the server is less than a preset first threshold value within the observation time; the second abnormal time period is a time period during which the resource usage of the server is greater than a preset second threshold value within the observation time;

[0018] Calculating a first resource usage score of the server according to a ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration;

[0019] A second resource usage score of the server is calculated according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration.

[0020] In the above method, optionally, judging whether the server meets a preset second capacity adjustment condition according to the resource usage score includes:

[0021] Determining whether the resource usage score is less than a preset score threshold;

[0022] When the resource usage score is less than a preset score threshold, determining that the server meets the second capacity adjustment condition;

[0023] When the resource usage score is greater than or equal to a preset score threshold, it is determined that the server does not meet the second capacity adjustment condition.

[0024] A capacity adjustment device for a server, comprising:

[0025] An acquisition unit, configured to respond to the capacity analysis instruction and acquire the clustering parameters of each server to be analyzed, wherein the clustering parameters of each server include at least one of the following: a peak value of CPU usage and a peak value of disk utilization of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs;

[0026] A clustering unit, used to apply a clustering model corresponding to the clustering parameters of each server to perform clustering analysis on the clustering parameters of each server, and obtain a clustering analysis result corresponding to each server;

[0027] An adjustment unit is used to determine, for each of the servers, whether the server meets a preset first capacity adjustment condition based on a cluster analysis result of the server; if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the cluster analysis result on the server to update the capacity resource configuration of the server; calculate an updated resource usage score of the server, and determine whether the server meets a preset second capacity adjustment condition based on the resource usage score; if the server meets the preset second capacity adjustment condition, perform a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again.

[0028] In the above device, optionally, the clustering unit comprises:

[0029] a first clustering unit, configured to, when the clustering parameter of the server includes the CPU usage peak, apply a first clustering model corresponding to the CPU usage peak to perform cluster analysis on the CPU usage peak to obtain a first cluster analysis result;

[0030] a second clustering unit, configured to, when the clustering parameter of the server includes the disk utilization peak value, apply a second clustering model corresponding to the disk utilization peak value to perform cluster analysis on the disk utilization peak value to obtain a second cluster analysis result;

[0031] The third clustering unit is used to apply a third clustering model corresponding to the capacity normal rate to perform cluster analysis on the capacity normal rate when the clustering parameter of the server includes the capacity normal rate, so as to obtain a third clustering analysis result.

[0032] In the above device, optionally, the adjustment unit comprises:

[0033] The execution subunit is configured to determine that the server meets a preset first capacity adjustment condition if at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity.

[0034] In the above device, optionally, the adjustment unit comprises:

[0035] A monitoring subunit, configured to monitor the resource usage of the updated server within a preset observation duration to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage of the server is less than a preset first threshold value within the observation duration; the second abnormal time period is a time period during which the resource usage of the server is greater than a preset second threshold value within the observation duration;

[0036] A first calculation subunit, configured to calculate a first resource usage score of the server according to a ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration;

[0037] The second calculation subunit is used to calculate a second resource usage score of the server according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration.

[0038] In the above device, optionally, the adjustment unit comprises:

[0039] A judging subunit, used to judge whether the resource usage score is less than a preset score threshold;

[0040] A first determining subunit, configured to determine that the server satisfies the second capacity adjustment condition when the resource usage score is less than a preset score threshold;

[0041] The second determining subunit is configured to determine that the server does not satisfy the second capacity adjustment condition when the resource usage score is greater than or equal to a preset score threshold.

[0042] A storage medium includes storage instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned server capacity adjustment method.

[0043] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the server capacity adjustment method as described above.

[0044] Based on the above-mentioned implementation of the present invention, a server capacity adjustment method and device, storage medium and electronic device are provided, the method comprising: in response to a capacity analysis instruction, obtaining clustering parameters of each server to be analyzed, the clustering parameters of each server comprising at least one of the following: the CPU usage peak value, the disk utilization peak value of the server within a preset time period and the capacity normality rate of the instance of the application system to which the server belongs; applying the clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameters of each server to obtain the clustering analysis result corresponding to each server; for each server, determining whether the server meets a preset first capacity adjustment condition according to the clustering analysis result of the server, if the server meets the first capacity adjustment condition, executing a first capacity adjustment operation corresponding to the clustering analysis result on the server to update the capacity resource configuration of the server; calculating the updated resource usage score of the server, and judging whether the server meets a preset second capacity adjustment condition according to the resource usage score, if the server meets the preset second capacity adjustment condition, executing a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again. The clustering model can be used to analyze the capacity of the server, and then the capacity of the server can be adjusted. The server with unreasonable capacity adjustment can be adjusted again through negative feedback adjustment, and the capacity resources of the server can be adjusted accurately and reasonably. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A method flow chart of a method for adjusting the capacity of a server provided by the present invention;

[0047] Figure 2 A flowchart of a process for calculating an updated resource usage score of a server provided by the present invention;

[0048] Figure 3 An architectural diagram of a capacity analysis model of a cloud computing system provided by the present invention;

[0049] Figure 4 A flow chart of a capacity assessment process provided by the present invention;

[0050] Figure 5A flow chart of a process of negative feedback capacity regulation provided by the present invention;

[0051] Figure 6 A schematic diagram of the structure of a server capacity adjustment device provided by the present invention;

[0052] Figure 7 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0055] An embodiment of the present invention provides a method for adjusting the capacity of a server, which can be applied to an electronic device. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:

[0056] S101: In response to a capacity analysis instruction, obtain clustering parameters of each server to be analyzed, wherein the clustering parameters of each server include at least one of the following: a CPU usage peak value, a disk utilization peak value of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs.

[0057] In this embodiment, the preset time period may be a time period between a first time point and a historical moment before the first time point, and the first time point may be a time point at which the capacity analysis instruction is received. The CPU usage peak may be a maximum value of the CPU usage within the preset time period, the disk usage peak may be a maximum value of the disk usage within the preset time period, the capacity normality rate may be a ratio of the number of capacity normal instances to the total number of instances in the application system to which the server belongs, and the application system may be a cloud computing application system.

[0058] Optionally, the peak values ​​of CPU usage and disk usage within the preset period may be the peak values ​​of CPU usage and disk usage within the past three months.

[0059] In some embodiments, the server to be analyzed may be a server in a cloud computing system, and the servers in the cloud computing system may include a network server, a database server, an online application server, an offline application server, and a data analysis server. The servers in the cloud computing system specifically include three uses: network proxy, application, and database. Therefore, the servers in the cloud computing system can be divided into three types: network (WEB) servers, application (AP) servers, and database (DB) servers. Among them, the application server can be further divided into three types: online application server, offline application server, and data analysis server. The usage of CPU and disk storage space by servers with different uses is not the same.

[0060] In some embodiments, the servers may also be classified according to the size of their file systems. Specifically, the size of the total storage space may be divided into four levels, namely less than 2TB, 2TB to 5TB, 5TB to 10TB, and greater than 10TB.

[0061] S102: Applying the clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameter of each server, to obtain a clustering analysis result corresponding to each server.

[0062] In this embodiment, the cluster analysis results corresponding to the servers may represent the capacity status of the servers, and the capacity status may include one of insufficient capacity, normal capacity, and excess capacity.

[0063] Optionally, the clustering model can be constructed based on a preset clustering algorithm, which can be a density-based spatial clustering algorithm with noise (DBSCAN); it can be applicable to convex sample sets or non-convex sample sets. By classifying closely connected samples into one category, a cluster category can be obtained, and all groups of closely connected samples can be divided into different categories to obtain the final clustering result.

[0064] S103: For each of the servers, determine whether the server meets a preset first capacity adjustment condition based on the clustering analysis result of the server; if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the clustering analysis result on the server to update the capacity resource configuration of the server; calculate the updated resource usage score of the server, and determine whether the server meets a preset second capacity adjustment condition based on the resource usage score; if the server meets the preset second capacity adjustment condition, perform a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again.

[0065] In this embodiment, when the cluster analysis result is insufficient capacity or excess capacity, it can be determined that the server meets the first capacity adjustment condition, and then the first capacity adjustment operation corresponding to the cluster analysis result is performed on the server.

[0066] Optionally, when the cluster analysis result is insufficient capacity, the first capacity adjustment operation corresponding to the cluster analysis result may be a first capacity expansion operation, i.e., expanding the capacity of the server. When the cluster analysis result is excess capacity, the first capacity adjustment operation corresponding to the cluster analysis result may be a first capacity recovery operation, i.e., recovering the capacity of the server.

[0067] Optionally, the resource usage score may represent the resource usage effect of the server after the first capacity adjustment operation is performed.

[0068] By applying the method provided in the embodiment of the present invention, it is possible to use a clustering model to analyze the capacity of the server, and then adjust the capacity of the server, and re-adjust the server with unreasonable capacity adjustment through negative feedback adjustment, so as to accurately and reasonably adjust the capacity resources of the server.

[0069] In an embodiment provided by the present invention, based on the above implementation process, optionally, applying the clustering model corresponding to the clustering parameter of each server to perform cluster analysis on the clustering parameter of each server to obtain the clustering analysis result corresponding to each server includes:

[0070] In a case where the clustering parameter of the server includes the CPU usage peak, applying a first clustering model corresponding to the CPU usage peak, performing cluster analysis on the CPU usage peak, and obtaining a first cluster analysis result;

[0071] In the case where the clustering parameter of the server includes the disk utilization peak value, applying a second clustering model corresponding to the disk utilization peak value, performing cluster analysis on the disk utilization peak value, and obtaining a second cluster analysis result;

[0072] In the case that the clustering parameter of the server includes the capacity normal rate, a third clustering model corresponding to the capacity normal rate is applied to perform cluster analysis on the capacity normal rate to obtain a third cluster analysis result.

[0073] In this embodiment, the cluster analysis result can be obtained by clustering the clustering parameters using a clustering model, and specifically can include at least one of a first cluster analysis result, a second cluster analysis result, and a third cluster analysis result. The first cluster analysis result can represent whether the capacity of the server is normal, excess capacity, or insufficient capacity; the second cluster analysis result can represent whether the capacity of the server is normal, excess capacity, or insufficient capacity; and the third cluster analysis result can represent whether the capacity of the server is normal, excess capacity, or insufficient capacity.

[0074] Optionally, the first clustering model, the second clustering model and the third clustering model can be constructed according to the DBSCAN algorithm. DBSCAN is based on a set of neighborhoods to describe the compactness of the sample set, and the parameter (∈, MinPts) is used to describe the compactness of the sample distribution in the neighborhood. Among them, ∈ describes the neighborhood distance threshold of a certain sample, and MinPts describes the threshold of the number of samples in the neighborhood with a distance of ∈ for a certain sample.

[0075] Assume that the sample set is D = (x1, x2, ..., x n ), the density of DBSCAN is defined as follows:

[0076] 1.∈-neighborhood: for x j ∈D, whose ∈-neighborhood contains the sample set D that is related to x j The distance between N and N is not greater than ∈, that is, N ∈ (x j )={x i ∈D|distance(x i ,x j )≤∈}, the number of subsample sets is denoted by |N ∈ (x j )|.

[0077] 2. Core object: For any sample x j ∈D, if its ∈-neighborhood corresponds to N ∈ (x j ) contains at least MinPts samples, that is, if |N ∈ (x j )|≥MinPts, then x j Is the core object.

[0078] 3. Density direct access: If x i Located at x j ∈-neighborhood, and xj is a core object, then x i By x j Density direct.

[0079] 4. Density can be reached: for x i and x j , if there exists a sample sequence p1,p2,…,p T , satisfying p1=x i , p T =x j , and p t+1 By p t The density is directly proportional to x j By x i Density reachable. Density reachable satisfies transitivity, but does not satisfy symmetry.

[0080] 5. Density connection: for x i and x j , if there is a core object sample x i and x j All by x k The density can reach, then x i and x j Density connected. Among them, density connected satisfies symmetry.

[0081] The clustering process is as follows:

[0082] Input: Sample set D = (x1, x2, ..., x n ), neighborhood parameter (∈,MinPts).

[0083] Output: Cluster partition C.

[0084] (1) Initialize the core object collection Initialize the number of clusters k = 0, initialize the unvisited sample set Γ = D, and divide the clusters

[0085] (2) For j = 1, 2, ..., m, find all core objects as follows:

[0086] (a) Find the sample x by distance measurement j ∈-neighborhood subsample set N ∈ (x j ).

[0087] (b) If the number of subsample sets satisfies |N ∈ (x j )|≥MinPts, the sample x j Add the core object sample set Ω=Ω∪{x j}.

[0088] (3) If the core object set The algorithm ends, otherwise it goes to step (4).

[0089] (4) Randomly select a core object o from the core object set Ω and initialize the current cluster core object queue Ω cur = {o}, initialize category number k = k + 1, initialize the current cluster sample set C k ={o}, update the unvisited sample set Γ=Γ-{o}.

[0090] (5) If the current cluster core object queue The current cluster C k After generation, update the cluster partition C = {C1, C2, ..., C k}, update the core object set Ω = Ω-C k , go to step (3). Otherwise update the core object set Ω = Ω - C k .

[0091] (6) In the current cluster core object queue Ω cur Take out a core object o′ and find all ∈-neighborhood subsample sets N through the neighborhood distance threshold ∈ ∈ (o′), let Δ=N ∈ (o′)∩Γ, update the current cluster sample set C k =C k ∪Δ, update the unvisited set Γ=Γ-Δ, update Ω cur =Ω cur ∪(Δ∩Ω)-o′, go to step (5).

[0092] Output result: Cluster partition C = {C1, C2, ..., C k}.

[0093] In some embodiments, the evaluation index of the clustering algorithm may be as follows:

[0094]

[0095] Among them, disMean in is the average distance between this point and other points in this class, disMean out is the average distance between the point and points outside this category. The value range is [-1,1]. The closer it is to 1, the more accurate the classification.

[0096] Alternatively, in sklearn the function silhouette_score() calculates the average silhouette coefficient for all points, and silhouette_samples() returns the silhouette coefficient for each point.

[0097] In an embodiment provided by the present invention, based on the above implementation process, optionally, determining whether the server meets a preset first capacity adjustment condition according to the cluster analysis result of the server includes:

[0098] If at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity, it is determined that the server meets a preset first capacity adjustment condition.

[0099] In an embodiment of the present invention, the peak value of the CPU usage rate of the server, the peak value of the disk utilization rate, and the normal rate of the instance of the application system to which the server belongs can reflect the capacity status of the server. Under normal circumstances, the peak value of the CPU usage rate of the server, the peak value of the disk utilization rate, and the normal rate of the instance of the application system to which the server belongs are usually in the normal range. When some of these parameters are in the normal range, while other parameters are high; or all parameters are high, it can reflect that the capacity of the server is in short supply; when some of these parameters are in the normal range, while other parameters are low; or all parameters are low, it can reflect that the capacity of the server is remaining. Therefore, a clustering algorithm can be used to perform cluster analysis on at least one of the peak value of the CPU usage rate of the server, the peak value of the disk utilization rate, and the normal rate of the instance of the application system to which the server belongs, so that the capacity status of the server can be determined according to the clustering analysis results. If the capacity status of the server is insufficient or excessive, it is determined that the server meets the first capacity adjustment condition, that is, the capacity of the server can be adjusted.

[0100] In an embodiment provided by the present invention, based on the above implementation process, optionally, the resource usage score of the updated server is calculated, such as Figure 2 As shown, including:

[0101] S201: Monitor the resource usage of the updated server within a preset observation period to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage of the server is less than a preset first threshold value within the observation period; the second abnormal time period is a time period during which the resource usage of the server is greater than a preset second threshold value within the observation period.

[0102] In an embodiment of the present invention, the observation duration can be divided into multiple time periods, and the resource utilization rate of each time period can be compared with a preset first threshold and a second threshold. For each time period, if the resource utilization rate within the time period is less than the first threshold, the time period is determined to be a first abnormal time period; if the resource utilization rate of the time period is greater than the second threshold, the time period is determined to be a second abnormal time period; if the resource utilization rate of the time period is between the first threshold and the second threshold, the time period is determined to be a normal time period.

[0103] Optionally, the first threshold is smaller than the second threshold, the first threshold may be set to 20%, the second threshold may be set to 95%, the observation duration may be one month, and the period may be one day.

[0104] S202: Calculate a first resource usage score of the server according to the ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration.

[0105] In some embodiments, the first resource usage score is calculated as follows:

[0106]

[0107] Among them, score1 is the first resource usage score, n1 is the number of the first abnormal time period, and N is the total number of time periods in the observation duration.

[0108] S203: Calculate a second resource usage score of the server according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration.

[0109] In some embodiments, the second resource usage score is calculated as follows:

[0110]

[0111] Among them, score2 is the first resource usage score, n2 is the number of the second abnormal time period, and N is the total number of each time period in the observation duration.

[0112] Optionally, the resource usage score includes at least one of a first resource usage score and a second resource usage score.

[0113] In an embodiment provided by the present invention, based on the above implementation process, optionally, judging whether the server meets a preset second capacity adjustment condition according to the resource usage score includes:

[0114] Determining whether the resource usage score is less than a preset score threshold;

[0115] When the resource usage score is less than a preset score threshold, determining that the server meets the second capacity adjustment condition;

[0116] When the resource usage score is greater than or equal to a preset score threshold, it is determined that the server does not meet the second capacity adjustment condition.

[0117] In this embodiment, the resource usage score may include at least one of a first resource usage score and a second resource usage score, and the score threshold may include a first score threshold and a second score threshold.

[0118] In some embodiments, when the resource usage score includes a first resource usage score, the first resource usage score can be compared with a first scoring threshold; if the first resource usage score is less than the first scoring threshold, it can be determined that the server meets the second capacity adjustment condition. In this case, a corresponding second capacity adjustment operation can be performed on the server, which can specifically be capacity recovery of the server, that is, the capacity configuration of the current server can be determined, and the capacity configuration of the server can be reduced to 1 / 2 of the current capacity configuration.

[0119] In some embodiments, when the resource usage score includes a second resource usage score, the second resource usage score can be compared with a second scoring threshold; if the second resource usage score is greater than the second scoring threshold, it can be determined that the server meets the second capacity adjustment condition. In this case, a corresponding second capacity adjustment operation can be performed on the server, which can be specifically to expand the server, determine the capacity configuration of the current server, and expand the capacity configuration of the server to twice the current capacity configuration.

[0120] Optionally, the first scoring threshold and the second scoring threshold may be the same, specifically, may be 80%.

[0121] See also Figure 3 , is an architecture diagram of a capacity analysis model of a cloud computing system provided in an embodiment of the present invention. The capacity analysis model of the cloud computing system includes a data processing module, a clustering algorithm module, a post-evaluation module and a negative feedback module. Among them, the data processing module includes data collection, data cleaning, and data visualization. The clustering algorithm module includes a server module (computing resources, storage resources) and an application system module. The post-evaluation module includes result reception, data integration, comprehensive evaluation, and resource implementation. The negative feedback module includes resource implementation results, system scoring, and resource adjustment.

[0122] In some embodiments, the data processing module is the basic module of the clustering algorithm, which provides the peak data of the server CPU and disk utilization, and analyzes and processes the data. Specifically, by sending a request to the server cluster where the application system is located, the peak data of the application system server CPU and disk utilization within the current three months can be obtained by using relevant Shell script commands and visual monitoring dashboards. The data obtained in the data collection process is stored in the database, and relevant interfaces for data operations are provided to clean and uniformly manage the data. The peak data of the server CPU and disk utilization after data cleaning are analyzed, including data dimension reduction and data visualization, and the obtained standardized data is subjected to capacity analysis.

[0123] In some embodiments, the clustering algorithm module includes a server module and an application system module, wherein the server module includes two parts: computing resources and storage resources. Computing resources are divided into three types according to their uses: WEB proxy server, AP application server, and DB database server, wherein the AP application server is divided into three deployment units: online, offline, and data analysis. Storage resources are divided into four types according to the size of the file system: less than 2T, between 2T and 5T, between 5T and 10T, and greater than 10T. The DBSCAN clustering algorithm is used to perform capacity analysis on resource utilization data, and the clustering results are divided into three categories: excess capacity, normal capacity, and insufficient capacity, and server-level visual clustering is realized in two dimensions and three dimensions. The application system module can pass the server resources under the jurisdiction of the application system to the application system module, and also use the DBSCAN clustering algorithm for clustering analysis. The percentage of instances with normal capacity in the total number of data instances that have been obtained is taken as the normal rate, less than 60% is called poor capacity, between 60% and 70% is called medium capacity, between 70% and 80% is called good capacity, and greater than 80% is called excellent capacity.

[0124] In some embodiments, Figure 4 As shown, it is a flowchart of a capacity assessment process provided by an embodiment of the present invention. The post-assessment module can receive the capacity analysis results of the clustering algorithm and perform preliminary analysis. According to the capacity analysis results, the situation of excess capacity and insufficient capacity is judged. According to the capacity judgment results, an assessment opinion is given. The server resources with insufficient capacity and excess capacity are expanded and recycled.

[0125] In some embodiments, Figure 5 As shown, it is a flowchart of a process of negative feedback capacity adjustment provided by an embodiment of the present invention. The negative feedback module can use the resource implementation results of the post-evaluation module as input, including computing resources and storage resources. The system operation status within one month is scored, which is divided into two parts: above and below 80%. The system resource configuration with a score below 80% is adjusted to always keep the system capacity optimal.

[0126] Based on the collection of the peak data of CPU and disk utilization of different application system servers within three months, the capacity analysis of computing resources and storage resources is carried out through four modules: data processing, clustering algorithm, post-evaluation, and negative feedback. The resource allocation is adjusted according to the post-evaluation to achieve the management of server computing resources and storage resources. The results show that the capacity analysis model can effectively realize the resource adjustment of multiple application systems and multiple server clusters, and can dynamically improve the resource utilization of the cloud computing platform and reduce energy consumption according to the size of the task set.

[0127] This patent can accurately and quickly provide capacity analysis solutions and reasonably allocate server resources in different business scenarios. It can not only improve the efficiency of daily operation and maintenance, but also effectively ensure the stability and high availability of the cloud computing platform, laying a solid foundation for the safe and stable operation of multiple application systems.

[0128] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a capacity adjustment device for a server, Figure 1 In the specific implementation of the method, the capacity adjustment device of the server provided in the embodiment of the present invention can be applied to an electronic device, and its structural diagram is as shown in FIG. Figure 6 As shown, specifically including:

[0129] The acquisition unit 601 is used to respond to the capacity analysis instruction and acquire the clustering parameters of each server to be analyzed, wherein the clustering parameters of each server include at least one of the following: the peak value of the CPU usage rate and the peak value of the disk utilization rate of the server within a preset time period, and the capacity normality rate of the instance of the application system to which the server belongs;

[0130] A clustering unit 602 is used to apply a clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameter of each server to obtain a clustering analysis result corresponding to each server;

[0131] The adjustment unit 603 is used to determine, for each of the servers, whether the server meets a preset first capacity adjustment condition based on the clustering analysis result of the server; if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the clustering analysis result on the server to update the capacity resource configuration of the server; calculate the updated resource usage score of the server, and determine whether the server meets a preset second capacity adjustment condition based on the resource usage score; if the server meets the preset second capacity adjustment condition, perform a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again.

[0132] In an embodiment provided by the present invention, based on the above solution, optionally, the clustering unit includes:

[0133] a first clustering unit, configured to, when the clustering parameter of the server includes the CPU usage peak, apply a first clustering model corresponding to the CPU usage peak to perform cluster analysis on the CPU usage peak to obtain a first cluster analysis result;

[0134] a second clustering unit, configured to, when the clustering parameter of the server includes the disk utilization peak value, apply a second clustering model corresponding to the disk utilization peak value to perform cluster analysis on the disk utilization peak value to obtain a second cluster analysis result;

[0135] The third clustering unit is used to apply a third clustering model corresponding to the capacity normal rate to perform cluster analysis on the capacity normal rate when the clustering parameter of the server includes the capacity normal rate, so as to obtain a third clustering analysis result.

[0136] In an embodiment provided by the present invention, based on the above solution, optionally, the adjustment unit includes:

[0137] The execution subunit is configured to determine that the server meets a preset first capacity adjustment condition if at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity.

[0138] In an embodiment provided by the present invention, based on the above solution, optionally, the adjustment unit includes:

[0139] A monitoring subunit, configured to monitor the resource usage of the updated server within a preset observation duration to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage of the server is less than a preset first threshold value within the observation duration; the second abnormal time period is a time period during which the resource usage of the server is greater than a preset second threshold value within the observation duration;

[0140] A first calculation subunit, configured to calculate a first resource usage score of the server according to a ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration;

[0141] The second calculation subunit is used to calculate a second resource usage score of the server according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration.

[0142] In an embodiment provided by the present invention, based on the above solution, optionally, the adjustment unit includes:

[0143] A judging subunit, used to judge whether the resource usage score is less than a preset score threshold;

[0144] A first determining subunit, configured to determine that the server satisfies the second capacity adjustment condition when the resource usage score is less than a preset score threshold;

[0145] The second determining subunit is configured to determine that the server does not satisfy the second capacity adjustment condition when the resource usage score is greater than or equal to a preset score threshold.

[0146] The specific principles and execution processes of each unit and module in the server capacity adjustment device disclosed in the above embodiment of the present invention are the same as those of the server capacity adjustment method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the server capacity adjustment method provided in the above embodiment of the present invention, and will not be repeated here.

[0147] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned server capacity adjustment method.

[0148] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 7 As shown, it specifically includes a memory 701 and one or more instructions 702, wherein the one or more instructions 702 are stored in the memory 701 and are configured to be executed by one or more processors 703 to perform the following operations:

[0149] In response to the capacity analysis instruction, a clustering parameter of each server to be analyzed is obtained, wherein the clustering parameter of each server includes at least one of the following: a CPU usage peak value, a disk utilization peak value of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs;

[0150] Applying the clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameter of each server, to obtain a clustering analysis result corresponding to each server;

[0151] For each of the servers, determine whether the server meets a preset first capacity adjustment condition based on the cluster analysis result of the server; if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the cluster analysis result on the server to update the capacity resource configuration of the server; calculate the updated resource usage score of the server, and determine whether the server meets a preset second capacity adjustment condition based on the resource usage score; if the server meets the preset second capacity adjustment condition, perform a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again.

[0152] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0153] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0154] For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0155] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0156] The above is a detailed introduction to a server capacity adjustment method provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for adjusting the capacity of a server, characterized in that: include: In response to the capacity analysis instruction, a clustering parameter of each server to be analyzed is obtained, wherein the clustering parameter of each server includes at least one of the following: a CPU usage peak value, a disk utilization peak value of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs; Applying the clustering model corresponding to the clustering parameter of each server to perform clustering analysis on the clustering parameter of each server, to obtain a clustering analysis result corresponding to each server; The clustering model is constructed based on a preset clustering algorithm, and the clustering algorithm is a density-based clustering algorithm DBSCAN with noise; For each of the servers, determining whether the server meets a preset first capacity adjustment condition according to the cluster analysis result of the server, and if the server meets the first capacity adjustment condition, performing a first capacity adjustment operation corresponding to the cluster analysis result on the server to update the capacity resource configuration of the server; Calculating an updated resource usage score of the server, and judging whether the server meets a preset second capacity adjustment condition according to the resource usage score; if the server meets the preset second capacity adjustment condition, performing a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again; The step of calculating the updated resource usage score of the server includes: Monitoring the resource usage of the updated server within a preset observation duration to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage of the server is less than a preset first threshold value within the observation duration; the second abnormal time period is a time period during which the resource usage of the server is greater than a preset second threshold value within the observation duration; wherein the observation duration is divided into a plurality of time periods; Calculating a first resource usage score of the server according to a ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration; Calculating a second resource usage score of the server according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration; The resource usage score includes the first resource usage score and the second resource usage score.

2. The method according to claim 1, characterized in that The applying the clustering model corresponding to the clustering parameter of each server to perform cluster analysis on the clustering parameter of each server to obtain the clustering analysis result corresponding to each server includes: In a case where the clustering parameter of the server includes the CPU usage peak, applying a first clustering model corresponding to the CPU usage peak, performing cluster analysis on the CPU usage peak, and obtaining a first cluster analysis result; In the case where the clustering parameter of the server includes the disk utilization peak value, applying a second clustering model corresponding to the disk utilization peak value, performing cluster analysis on the disk utilization peak value, and obtaining a second cluster analysis result; In the case that the clustering parameter of the server includes the capacity normal rate, a third clustering model corresponding to the capacity normal rate is applied to perform cluster analysis on the capacity normal rate to obtain a third cluster analysis result.

3. The method according to claim 2, characterized in that The determining, according to the cluster analysis result of the server, whether the server meets a preset first capacity adjustment condition includes: If at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity, it is determined that the server meets a preset first capacity adjustment condition.

4. The method according to claim 1, characterized in that: The determining, according to the resource usage score, whether the server meets a preset second capacity adjustment condition includes: Determining whether the resource usage score is less than a preset score threshold; When the resource usage score is less than a preset score threshold, determining that the server meets the second capacity adjustment condition; When the resource usage score is greater than or equal to a preset score threshold, it is determined that the server does not meet the second capacity adjustment condition.

5. A server capacity adjustment device, characterized in that: include: An acquisition unit, configured to respond to the capacity analysis instruction and acquire the clustering parameters of each server to be analyzed, wherein the clustering parameters of each server include at least one of the following: a peak value of CPU usage and a peak value of disk utilization of the server within a preset time period, and a capacity normality rate of an instance of an application system to which the server belongs; A clustering unit, used to apply a clustering model corresponding to the clustering parameters of each server to perform clustering analysis on the clustering parameters of each server, and obtain a clustering analysis result corresponding to each server; The clustering model is constructed based on a preset clustering algorithm, and the clustering algorithm is a density-based clustering algorithm DBSCAN with noise; an adjustment unit, configured to determine, for each of the servers, whether the server meets a preset first capacity adjustment condition according to a cluster analysis result of the server, and if the server meets the first capacity adjustment condition, perform a first capacity adjustment operation corresponding to the cluster analysis result on the server to update the capacity resource configuration of the server; Calculating an updated resource usage score of the server, and judging whether the server meets a preset second capacity adjustment condition according to the resource usage score; if the server meets the preset second capacity adjustment condition, performing a second capacity adjustment operation corresponding to the resource usage score on the server to update the capacity resource configuration of the server again; Wherein, the adjustment unit comprises: A monitoring subunit, configured to monitor the resource usage rate of the updated server within a preset observation duration to determine the number of first abnormal time periods and the number of second abnormal time periods; the first abnormal time period is a time period during which the resource usage rate of the server is less than a preset first threshold value within the observation duration; the second abnormal time period is a time period during which the resource usage rate of the server is greater than a preset second threshold value within the observation duration; wherein the observation duration is divided into a plurality of time periods; A first calculation subunit, configured to calculate a first resource usage score of the server according to a ratio of the number of the first abnormal time periods to the total number of time periods of the observation duration; A second calculation subunit is used to calculate a second resource usage score of the server according to the ratio of the number of the second abnormal time periods to the total number of time periods of the observation duration; The resource usage score includes the first resource usage score and the second resource usage score.

6. The device according to claim 5, characterized in that The clustering unit comprises: a first clustering unit, configured to, when the clustering parameter of the server includes the CPU usage peak, apply a first clustering model corresponding to the CPU usage peak to perform cluster analysis on the CPU usage peak to obtain a first cluster analysis result; a second clustering unit, configured to, when the clustering parameter of the server includes the disk utilization peak value, apply a second clustering model corresponding to the disk utilization peak value to perform cluster analysis on the disk utilization peak value to obtain a second cluster analysis result; The third clustering unit is used to apply a third clustering model corresponding to the capacity normal rate to perform cluster analysis on the capacity normal rate when the clustering parameter of the server includes the capacity normal rate, so as to obtain a third clustering analysis result.

7. The device according to claim 6, characterized in that The adjustment unit comprises: The execution subunit is configured to determine that the server meets a preset first capacity adjustment condition if at least one cluster analysis result of the server indicates that the server has insufficient capacity or excessive capacity.

8. A storage medium, characterized in that: The storage medium includes storage instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the capacity adjustment method of the server according to any one of claims 1 to 4.

9. An electronic device, characterized in that: It comprises a memory and a processor, wherein one or more instructions are stored in the memory, and the processor is executed to implement the server capacity adjustment method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Cloud calculation system capacity evaluation method and device, equipment and storage medium

    CN113010576A