A method for calculating standard instance specifications of a proprietary cloud server
Through the clustering analysis algorithm, the resource usage data of proprietary cloud servers is processed, and the cloud server resource allocation is optimized, which solves the problem of low utilization of proprietary cloud resources, and achieves optimal allocation of resources and reduced waste.
Patent Information
- Application Number
- CN202210280482.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-03-22
AI Technical Summary
The standard instance specifications of proprietary cloud servers are designed with reference to the public cloud, resulting in low resource utilization and waste of resources.
By obtaining the maximum CPU and memory usage of the target cloud server, using DBSCAN and K-means clustering analysis algorithms for data processing, eliminating discrete points and removing noise, selecting the maximum CPU and memory values for clustering and grouping, and rounding up the quasi- Combined with the final example standard specifications.
The cloud server resource allocation is optimized, the excess CPU and memory resources are released, and the optimal allocation of resources is achieved.
Smart Images

Figure CN114861752B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server resource allocation, and in particular to a method for calculating standard instance specifications of a proprietary cloud server. Background Art
[0002] At present, the design method of standard specifications of private cloud servers is to refer to the design method of public cloud servers, which has the following disadvantages: 1. There are many standard instance specifications of public cloud servers. In actual private cloud operations, for the convenience of management, only 4-10 standard instance specifications are set. 2. Most applications deployed in private clouds only provide services to a limited number of users and do not require high concurrent performance of applications. The resource utilization rate (CPU, memory) of private cloud servers for the same type of applications is lower than that of public cloud applications. Therefore, using the instance specifications recommended by the public cloud for private cloud resource allocation will cause a certain degree of resource waste. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a method for calculating the standard instance specifications of a proprietary cloud server.
[0004] In order to solve the above technical problems, the technical solution of the present invention is:
[0005] A method for calculating the standard instance specifications of a proprietary cloud server, characterized by comprising the following steps:
[0006] A data acquisition step, acquiring a maximum CPU usage and a maximum memory usage of each target cloud service within a continuous first preset period;
[0007] The measured specification calculation step calculates the expected CPU specification and the expected memory specification of each target cloud server according to the maximum CPU usage and the maximum memory usage of each target cloud server to generate expected specification data, and defines the expected specification data of all target cloud servers as an expected specification data set;
[0008] A cluster screening step, performing cluster analysis on the expected specification data set by using a DBSCAN cluster analysis algorithm to remove the expected specification data as discrete points from the original expected specification data set to generate a new expected specification data set, so that the data scale of the original expected specification data set and the data scale of the new expected specification data set have a preset first proportional relationship;
[0009] A clustering and grouping step, clustering and grouping the new expected specification data set by using a K-means clustering analysis algorithm to obtain a plurality of clustering and grouping data sets, and selecting the maximum value of the CPU specification and the maximum value of the memory specification in each clustering and grouping data set to obtain the first instance standard specification;
[0010] The rounding and fitting step rounds up the data in the first instance standard specification to obtain the second instance standard specification, and fits the expected specification data in the second instance standard specification through a preset fitting ratio to obtain the final instance standard specification.
[0011] Furthermore, the value range of the first preset period is between 85 days and 95 days.
[0012] Furthermore, in the data acquisition step, a first collection duration is configured, and the average CPU usage and average memory usage of the target cloud server in each first collection duration are obtained and calculated within a first preset period with the first collection duration as the collection time interval to obtain the maximum CPU usage and maximum memory usage.
[0013] Furthermore, the data acquisition step also includes eliminating the average CPU usage and average memory usage whose values are null or invalid values.
[0014] Furthermore, in the measured specification calculation step, the CPU expected specification is calculated by the first formula. The first formula is E c =(H c *A c ) / Sta c , where E c is the expected CPU specification, H c is the highest CPU usage, A c Assign CPU specifications to the target cloud server, Sta c The preset CPU alarm water level value.
[0015] Furthermore, in the measured specification calculation step, the expected memory specification is calculated by a second formula, and the second formula is E m =(H m *A m ) / Sta m , E m is the expected memory specification, H m is the highest memory usage, A m Allocate memory specifications for the target cloud server, Sta m It is the preset memory alarm water level value.
[0016] Furthermore, the first proportional relationship is 85%-95%.
[0017] Furthermore, in the cluster screening step, the first proportional relationship is achieved by configuring a data object number threshold of the DBSCAN cluster analysis algorithm.
[0018] Furthermore, in the clustering grouping step, the number of data of the first instance standard specification is configured as a preset grouping requirement number.
[0019] Furthermore, the random number seed in the K-means clustering analysis algorithm is configured as 42.
[0020] The technical effects of the present invention are mainly reflected in the following aspects: through such settings, the resource usage of the actual target cloud server is obtained, the monitoring data of massive cloud servers is processed, and then the data noise is removed by the clustering analysis algorithm. At the same time, the instance standard specifications of the master right are obtained through clustering grouping, and then the data format is processed and fitted for output. In this way, the allocated cloud server resources can be optimized according to several standard specifications, the optimal resource allocation is obtained, and the over-allocated CPU and memory resources are released. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 : A flow chart of a method for calculating the standard instance specifications of a proprietary cloud server in the present invention.
[0022] Figure 2 A data set of specifications expected for embodiments of the present invention;
[0023] Figure 3 The desired specification data set after denoising by using the DBSCAN algorithm in the embodiment of the present invention;
[0024] Figure 4 1767 expected specification data sets after denoising according to the embodiment of the present invention;
[0025] Figure 5 This is a data set after the clustering and grouping steps and the integer fitting steps of an embodiment of the present invention.
[0026] Figure numerals: S1, data acquisition step; S2, measured specification calculation step; S3, cluster screening step; S4, cluster grouping step; S5, integer fitting step. DETAILED DESCRIPTION
[0027] The specific implementation modes of the present invention are further described below in conjunction with the accompanying drawings to make the technical solutions of the present invention easier to understand and grasp.
[0028] A method for calculating the standard instance specifications of a proprietary cloud server, characterized by comprising the following steps:
[0029] Data acquisition step S1, obtains the highest CPU usage and the highest memory usage of each target cloud service within a continuous first preset period; the value range of the first preset period is between 85 days and 95 days. In the data acquisition step, the first collection duration is configured, and the first collection duration is used as the collection time interval to obtain and calculate the average CPU usage and the average memory usage of the target cloud server in each first collection duration within the first preset period to obtain the highest CPU usage and the highest memory usage. The data acquisition step also includes eliminating the average CPU usage and the average memory usage that are null or invalid values. Specifically, the average CPU and memory usage of all powered-on cloud servers in the dedicated cloud unified construction mode can be monitored in hours for 90 consecutive days. After eliminating invalid values and null values, the highest CPU usage and the highest memory usage of each cloud server in this monitoring time interval are obtained.
[0030] The measured specification calculation step S2 is to calculate the expected CPU specification and the expected memory specification of each target cloud server according to the maximum CPU usage and the maximum memory usage of each target cloud server to generate expected specification data, and define the expected specification data of all target cloud servers as the expected specification data set; in the measured specification calculation step, the first formula for calculating the expected CPU specification is E c =(H c *A c ) / Sta c , where E c is the expected CPU specification, H c is the highest CPU usage, A c Assign CPU specifications to the target cloud server, Sta c is the preset CPU alarm water level value. The cloud server CPU allocation specification is a known quantity. The CPU alarm water level value can be pre-entered according to user needs. In this solution, it is preferably 40%. In the measured specification calculation step, the expected memory specification is calculated by the second formula. The second formula is E m =(H m *A m ) / Sta m , E m is the expected memory specification, H m is the highest memory usage, A m Allocate memory specifications for the target cloud server, Sta m The memory allocation specification of the cloud server is a known quantity, and the memory alarm water level value can be pre-entered according to user needs, preferably 60%.
[0031] Cluster screening step S3, cluster analysis is performed on the expected specification data set through the DBSCAN cluster analysis algorithm to remove the expected specification data as discrete points from the original expected specification data set to generate a new expected specification data set, so that the data scale of the original expected specification data set and the data scale of the new expected specification data set have a preset first proportional relationship; the first proportional relationship is 85%-95%. The machine learning cluster analysis algorithm DBSCAN is applied to perform cluster analysis on the two-dimensional data sets of the expected instance specifications of all cloud servers (CPU and memory specifications: XCXG), remove discrete points, and obtain a dense data set composed of 90% (the first proportional relationship, which can be defined by the user according to actual conditions) of relatively dense data points in the data set. Set the neighborhood radius (Usually 2C2G is the stepping unit of the specification, so the neighborhood radius Eps is the value of the radius of the circumscribed circle of the stepping unit). In the cluster screening step, the value (integer) of the data object number threshold MinPts parameter of the DBSCAN clustering analysis algorithm is configured to achieve the first proportional relationship.
[0032] Clustering and grouping step S4, clustering and grouping the new expected specification data set through the K-means clustering analysis algorithm to obtain several groups of clustering and grouping data sets, respectively selecting the maximum value of the CPU specification and the maximum value of the memory specification in each group of clustering and grouping data sets to obtain the first instance standard specification; in the clustering and grouping step, the number of data of the first instance standard specification is configured as the preset grouping requirement number. The maximum value of the CPU specification and the maximum value of the memory specification in each group of data sets are respectively selected to obtain the optimal cloud server instance standard specification (the number of data in the standard specification data set is the grouping number parameter n_cluster of the K-means algorithm). The random number seed random_state in the K-means clustering analysis algorithm is configured to 42.
[0033] In the rounding and fitting step S5, the data in the first instance standard specification is rounded up to obtain the second instance standard specification, and the expected specification data in the second instance standard specification is fitted by a preset fitting ratio to obtain the final instance standard specification. The fitting ratio is 1:2 / 1:4 / 1:8, and then the duplicate data in the final instance standard specification set is removed to obtain the final instance standard specification as the cloud server instance standard specification.
[0034] Examples:
[0035] The standard instance specifications of 1952 proprietary cloud Linux cloud server instances were analyzed and processed according to the data acquisition steps, measured specification calculation steps, cluster screening steps, cluster grouping steps, and integer fitting steps.
[0036] The CPU water level is selected to be 60%, the memory water level is selected to be 40%, and the neighborhood radius of the DBSCAN algorithm is selected to be The DBSCAN algorithm object number threshold MinPts parameter = 20 (fitting the first proportional relationship ≈ 90.5%, that is, a data set of 1767 cloud server instances is obtained after denoising), the K-means parameter grouping number parameter n_cluster = 8, and the random number seed random_state = 42.
[0037] in conclusion:
[0038] Group 0: The number is 736, the original average instance specifications (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 5C11G, the instance specifications are rounded up, that is, the first instance standard specifications: 2C2G, and the instance specifications of the private cloud are fitted according to the ratio of 1:2, that is, the final instance standard specifications: 2C4G; the number of CPU cores saved is (5-2)*736=2208; the memory saved is (11-4)*736=5152;
[0039] Group 1: The number is 118, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 7C16G, the instance specification is rounded up, that is, the first instance standard specification: 3C11G, and the instance specification of the private cloud is fitted according to the ratio of 1:4, that is, the final instance standard specification: 4C16G; the number of CPU cores saved is (7-4)*118=354; the memory saved is (16-16)*118=0;
[0040] Group 2: The number is 305, the original average instance specifications (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 6C14G, the instance specifications rounded up, that is, the first instance standard specifications: 3C4G, the instance specifications of the fitted private cloud, that is, the final instance standard specifications: 4C8G; the number of CPU cores saved is (6-4)*305=610; the memory saved is (14-8)*305=1830;
[0041] Group 3: The number is 71, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 8C20G, the instance specification is rounded up, that is, the first instance standard specification: 3C15G, and the instance specification of the private cloud is fitted according to the ratio of 1:4, that is, the final instance standard specification: 4C16G; the number of CPU cores saved is (8-4)*71=284; the memory saved is (20-16)*71=284;
[0042] Group 4: The number is 172, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 6C13G, the instance specification is rounded up, that is, the first instance standard specification: 4C8G, and the instance specification of the private cloud is fitted according to the ratio of 1:2, that is, the final instance standard specification: 4C8G; the number of CPU cores saved is (6-4)*172=344; the memory saved is (13-8)*172=860;
[0043] Group 5: The number is 61, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 8C21G, the instance specification is rounded up, that is, the first instance standard specification: 7C15G, and the instance specification of the private cloud is fitted according to the ratio of 1:4, that is, the final instance standard specification: 8C16G; the number of CPU cores saved is (8-8)*61=0; the memory saved is (21-16)*61=305;
[0044] Group 6: The number is 54, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 9C26G, the instance specification is rounded up, that is, the first instance standard specification: 3C21G, and the instance specification of the private cloud is fitted according to the ratio of 1:8, that is, the final instance standard specification: 4C32G; the number of CPU cores saved is (9-4)*54=270; the memory saved is (26-32)*54=-324;
[0045] Group 7: The number is 250, the original average instance specification (the sum of the original instance specifications of all private cloud servers in the group is divided by the number of groups and rounded up): 6C15G, the instance specification is rounded up, that is, the first instance standard specification: 4C6G, and the instance specification of the private cloud is fitted according to the ratio of 1:2, that is, the final instance standard specification: 4C8G; the number of CPU cores saved is (6-4)*250=500; the memory saved is (15-8)*250=1750;
[0046] The standard instance specifications after deduplication and fitting are: 2C4G, 4C8G, 4C16G, 4C32G, 8C16G (5 pieces).
[0047] like Figure 2 , 3 ,4, and 5 show that the horizontal axis is the number of CPU cores, the vertical axis is the memory capacity, and each point represents the specification (XCXG) of each private cloud server;
[0048] Figure 2The expected specification dataset is calculated based on the maximum CPU and memory and the CPU and memory watermarks for all 1952 dedicated cloud Linux cloud servers within 90 days;
[0049] Figure 3 To apply the DBSCAN algorithm for denoising, select the 90.5% expected specification dataset, which is the most dense dataset in the lower left corner;
[0050] Figure 4 It is the denoised 1767 expected specification dataset;
[0051] Figure 5 The kmeans algorithm is used to divide the data into 8 groups. The × points are standard specifications for rounding up. The standard specifications after fitting are based on the points (the fitting ratio is 1:2 / 1:4 / 1:8).
[0052] In the above, data noise is removed through cluster analysis algorithm, and the instance standard specifications of the main rights are obtained through clustering grouping. Then the data format is processed and fitted for output. In this way, the allocated cloud server resources can be optimized according to several standard specifications to obtain the optimal resource allocation and release the over-allocated CPU and memory resources.
[0053] Of course, the above are only typical examples of the present invention. In addition, the present invention may also have many other specific implementations. All technical solutions formed by equivalent replacement or equivalent transformation fall within the scope of protection required by the present invention.
Claims
1. A method for calculating the standard instance specifications of a proprietary cloud server, characterized by: The following steps are involved: A data acquisition step, acquiring a maximum CPU usage and a maximum memory usage of each target cloud service within a continuous first preset period; The measured specification calculation step calculates the expected CPU specification and the expected memory specification of each target cloud server according to the maximum CPU usage and the maximum memory usage of each target cloud server to generate expected specification data, and defines the expected specification data of all target cloud servers as an expected specification data set; A cluster screening step, performing cluster analysis on the expected specification data set by using a DBSCAN cluster analysis algorithm to remove the expected specification data as discrete points from the original expected specification data set to generate a new expected specification data set, so that the data scale of the original expected specification data set and the data scale of the new expected specification data set have a preset first proportional relationship; A clustering and grouping step, clustering and grouping the new expected specification data set by using a K-means clustering analysis algorithm to obtain a plurality of clustering and grouping data sets, and selecting the maximum value of the CPU specification and the maximum value of the memory specification in each clustering and grouping data set to obtain the first instance standard specification; The rounding and fitting step rounds up the data in the first instance standard specification to obtain the second instance standard specification, and fits the expected specification data in the second instance standard specification through a preset fitting ratio to obtain the final instance standard specification.
2. A method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: The value range of the first preset period is between 85 days and 95 days.
3. The method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: In the data acquisition step, a first collection duration is configured, and the average CPU usage and average memory usage of the target cloud server in each first collection duration are obtained and calculated within a first preset period with the first collection duration as the collection time interval to obtain the maximum CPU usage and maximum memory usage.
4. A method for calculating the standard instance specifications of a dedicated cloud server according to claim 3, characterized in that: The data acquisition step also includes eliminating the average CPU usage and average memory usage that are null values or invalid values.
5. The method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: In the measured specification calculation step, the CPU expected specification is calculated by the first formula. The first formula is E c =(H c *A c ) / Sta c , where E c is the expected CPU specification, H c is the highest CPU usage, A c Assign CPU specifications to the target cloud server, Sta c The preset CPU alarm water level value.
6. A method for calculating the standard instance specifications of a dedicated cloud server according to claim 5, characterized in that: In the measured specification calculation step, the expected memory specification is calculated by a second formula, and the second formula is E m =(H m *A m ) / Sta m , E m is the expected memory specification, H m is the highest memory usage, A m Allocate memory specifications for the target cloud server, Sta m It is the preset memory alarm water level value.
7. The method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: The first ratio relationship is 85%-95%.
8. A method for calculating the standard instance specifications of a dedicated cloud server according to claim 1 or 7, characterized in that: In the cluster screening step, the first proportional relationship is achieved by configuring the data object number threshold of the DBSCAN cluster analysis algorithm.
9. The method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: In the clustering grouping step, the number of data of the first instance standard specification is configured as a preset grouping requirement number.
10. The method for calculating the standard instance specifications of a dedicated cloud server according to claim 1, characterized in that: The rounding and fitting step also includes removing duplicates from the standard specifications of the final instance.
