Server cluster deployment method, capacity detection method and electronic equipment
By establishing an association relationship between the server's resource occupancy and the processing amount per unit time, and selecting a suitable server based on this association relationship, the problem of inaccurate design capacity in server cluster deployment is solved, and the accuracy of deployment and resource utilization are improved.
Patent Information
- Application Number
- CN202411539543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-25
AI Technical Summary
During server cluster deployment, existing methods cannot accurately implement design capacity, resulting in waste of resources or failure to meet application needs, especially when servers with different core numbers exist.
By obtaining the server's processor cores and processor usage, determine the resource occupancy and establish an association between the resource occupancy and the processing amount per unit time. Based on this association and the number of processor cores and saturated processor usage of the server to be selected, select the appropriate server to deploy the server cluster to ensure that the design capacity is achieved.
It improves the accuracy of server cluster deployment, avoids waste of resources and inability to meet application needs, and ensures that the server cluster can effectively meet application capacity needs.
Smart Images

Figure CN119690456A_ABST
Abstract
Description
Background Art
[0002] With the development of cloud computing technology, the number of application requests has increased dramatically. It has become an industry need to run applications through server clusters to handle massive requests. When running applications in server clusters, it is necessary to detect the capacity of the server cluster for the application in real time to provide data for operation and maintenance. In some scenarios, it is also necessary to deploy or adjust the deployment of server clusters based on the capacity planning of the application. Summary of the invention
[0003] The purpose of the present disclosure is to provide a server cluster deployment method and capacity detection method, device and electronic device, which are used to improve the accuracy of server cluster deployment and server capacity detection.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for deploying a server cluster is provided, comprising: when a first server runs a first application, obtaining a processor usage rate and a request processing volume per unit time of the first server in a sampling period; determining a resource occupancy number of the first server in the sampling period according to the processor usage rate and the number of processor cores of the first server; establishing a correlation relationship between the resource occupancy number and the request processing volume per unit time according to the resource occupancy number and the request processing volume per unit time in multiple sampling periods; determining the number of processor cores and a saturated processor usage rate of a second server, wherein a difference between a single-core performance test value of the processor of the second server and a single-core performance test value of the processor of the first server is less than a preset value; selecting a third server from the second servers according to the correlation relationship, the number of processor cores and the saturated processor usage rate of the second server and the first capacity of the first application, and deploying a server cluster for running the first application based on the third server.
[0005] According to a second aspect of the present disclosure, a capacity detection method for a server cluster is provided, wherein the server cluster is used to run a first application and includes multiple servers, and the method includes: obtaining the number of processor cores of the server, as well as the processor usage rate and the request processing volume per unit time of the server during a sampling period; determining the resource occupancy of the server during the sampling period based on the processor usage rate of the server during the sampling period and the number of processor cores of the server; establishing an association relationship between the resource occupancy number corresponding to the server and the request processing volume per unit time based on the correspondence between the resource occupancy number and the request processing volume per unit time in multiple sampling periods; determining the existing capacity of the server cluster for the first application based on the saturated processor usage rate of each server in the server cluster, the number of processor cores and the association relationship.
[0006] According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the methods described above based on instructions stored in the memory.
[0007] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a program is stored, and when the program is executed by a processor, the method as described in any one of the above is implemented.
[0008] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the steps of any one of the methods described above when executed by a processor.
[0009] The disclosed embodiment determines the resource occupancy of the first server according to the number of processor cores and the processor usage of the first server, and then establishes a correlation relationship between the resource occupancy of the first server and the request processing volume per unit time according to the corresponding relationship between the processor usage of the first server in the sampling period and the request processing volume per unit time, so as to form a correlation relationship between the request processing volume per unit time and the resource occupancy of the first server that is independent of the number of cores of the first server. Finally, according to the number of processor cores and the saturated processor usage of the second server to be selected, the correlation relationship, and the first capacity (i.e., the design capacity) of the server cluster for the first application, the third server is selected from the second server to be added to the server cluster, so as to avoid the inability to accurately realize the first capacity during the server cluster deployment process caused by the different number of processor cores of the second server to be selected, thereby improving the accuracy of the server cluster deployment.
[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0012] Figure 1 is a flow chart of a method for deploying a server cluster in an exemplary embodiment of the present disclosure.
[0013] Figure 2 It is a sub-flowchart of step S15 in the exemplary embodiment of the present disclosure.
[0014] Figure 3It is a sub-flowchart of step S153 in the exemplary embodiment of the present disclosure.
[0015] Figure 4 The figure is a flow chart of a method for detecting the capacity of a server cluster in an exemplary embodiment of the present disclosure.
[0016] Figure 5A and Figure 5B It is a schematic diagram of the reliability of the association relationship in the exemplary embodiment of the present disclosure.
[0017] Figure 6 It is a block diagram of a deployment device of a server cluster in an exemplary embodiment of the present disclosure.
[0018] Figure 7 is a block diagram of an electronic device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0020] In addition, the accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0021] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0022] The deployment method of the server cluster is usually determined based on the CPU usage of the second server. However, as servers are upgraded, dual-core and multi-core servers are becoming the mainstream. In some cases, it is necessary to replace old servers in the server cluster with new ones or purchase new servers to expand capacity. The number of cores of the new server model is usually greater than that of the old server. Therefore, as the purchase date is different, the number of cores of the servers in the server cluster is gradually different.
[0023] In addition, the servers in the server cluster also need to be adjusted due to the discontinuation of the original server model or the use of older servers. Or, when deploying some applications, you may face restrictions on the use of physical or virtual machines, including high costs and the inability to easily use image cloning. In this case, you need to use servers with different numbers of cores and configure weights through a load balancer to control the distribution ratio of traffic. The above situations will cause the number of cores of the servers in the server cluster to be different.
[0024] The inventors of the present application have found in practice that when replacing old servers in a server cluster with new ones or purchasing new servers to expand capacity, the method of deploying servers into a cluster based on CPU usage cannot be used to accurately select new servers, and the newly purchased servers cannot accurately achieve the first capacity planned for the server cluster. The inventors analyzed and found that the reason for this phenomenon is that for servers with different numbers of cores, the capacity corresponding to the same CPU usage is not the same. Based on this, the embodiments of the present disclosure provide a method for deploying a server cluster to eliminate the impact of inaccurate deployment caused by different numbers of processor cores of different servers in the process of deploying a server cluster and meeting the first capacity of the server cluster for a first application. It can avoid the waste of resources caused by the capacity provided by the server cluster for the first application after deployment being far greater than the first capacity, and it can also avoid the failure of the server cluster to provide the first capacity for the first application after deployment, thereby improving the deployment accuracy of the server cluster. Please refer to the subsequent embodiments for the definition of the first application and the first capacity.
[0025] Figure 1 is a flow chart of a method for deploying a server cluster in an exemplary embodiment of the present disclosure. Figure 1 This is an overall flow chart of the deployment method 100 , and each step in the deployment method 100 will be described in subsequent locations in the text.
[0026] refer to Figure 1 , the server cluster deployment method 100 may include:
[0027] Step S11, when the first server runs the first application, obtaining the processor usage rate and the request processing volume per unit time of the first server during the sampling period;
[0028] Step S12, determining the resource occupancy of the first server in the sampling period according to the processor usage rate and the number of processor cores of the first server;
[0029] Step S13, establishing a correlation relationship between the resource occupancy number and the request processing volume per unit time according to the resource occupancy number and the request processing volume per unit time in a plurality of sampling periods;
[0030] Step S14, determining the number of processor cores and saturated processor usage of the second server, wherein the difference between the single-core performance test value of the processor of the second server and the single-core performance test value of the processor of the first server is less than a preset value;
[0031] Step S15: selecting a third server from the second servers according to the association relationship, the number of processor cores and the saturated processor usage of the second server, and the first capacity of the first application, and deploying a server cluster for running the first application based on the third server.
[0032] The disclosed embodiment determines the resource occupancy of the first server according to the number of processor cores and the processor usage of the first server, and then establishes a correlation relationship between the resource occupancy of the first server and the request processing volume per unit time according to the corresponding relationship between the processor usage of the first server in the sampling period and the request processing volume per unit time, so as to form a correlation relationship between the request processing volume per unit time and the resource occupancy of the first server that is independent of the number of cores of the first server. Finally, according to the number of processor cores and the saturated processor usage of the second server to be selected, the correlation relationship, and the first capacity (i.e., the design capacity) of the server cluster for the first application, the third server is selected from the second server to be added to the server cluster, so as to avoid the inability to accurately realize the first capacity during the server cluster deployment process caused by the different number of processor cores of the second server to be selected, thereby improving the accuracy of the server cluster deployment.
[0033] Next, each step of the server cluster deployment method 100 is described in detail.
[0034] In step S11, when the first server runs the first application, the processor usage rate and the request processing volume per unit time of the first server in the sampling period are obtained.
[0035] In the embodiment of the present disclosure, the server cluster is designed to include multiple servers, and the multiple servers in the server cluster perform distributed work to run the first application.
[0036] The first application can run independently and serve a specific goal or user need. The first application may be composed of multiple applications, components or services that work together to provide specific functions or services. For example, a web application may include multiple components such as the front-end user interface, the back-end server logic, and the database service. The multiple components as a whole are called an application.
[0037] The first capacity is the design capacity of the server cluster for the first application, that is, the sum of the maximum request processing volume per unit time provided by multiple servers in the server cluster when running the first application under normal working conditions (also called saturated working conditions). Assume that there are three servers A, B, and C in the server cluster, and servers A, B, and C jointly run the first application. The maximum request processing volume per unit time that servers A, B, and C can provide for the first application is QA, QB, and QC, respectively. Then, the capacity Q of the server cluster for the first application is Q=QA+QB+QC. The design capacity of the server cluster for the first application, i.e., the first capacity, can be planned according to demand, and servers can be purchased or selected according to the first capacity to deploy the server cluster.
[0038] The application scenario for planning the first capacity of the server cluster can be to build a server cluster for the first application from scratch, or to expand the server cluster based on the expansion target of the first application, and to purchase new servers to join the existing server cluster. In some embodiments, the servers in the server cluster can also be replaced with new ones based on the expansion target of the first application, so as to achieve the expansion of the server cluster without increasing the number of servers as much as possible.
[0039] The process of determining the first capacity of the server cluster for the first application can be implemented based on the estimated access volume. For example, in an application scenario where a server cluster is built from scratch, the access volume of the first application can be estimated based on the user group, usage scenario, function and other attributes corresponding to the first application to determine the first capacity of the server cluster for the first application; in an application scenario where the server cluster is expanded or replaced based on the expansion target of the first application, the capacity gap of the first application can be analyzed based on the historical data of the existing access volume changes of the first application, and then the first capacity of the server cluster for the first application can be determined based on the existing capacity and capacity gap of the server cluster.
[0040] Those skilled in the art may determine the first capacity of the server cluster for the first application according to the actual situation of the first application, and the present disclosure does not impose any special limitation on this.
[0041] After determining the first capacity of the server cluster for the first application, the target of the server cluster deployment is determined. Next, the operation data of the first application can be sampled to implement the server cluster deployment of the first application based on the operation data of the first application. It can be understood that even on the same server cluster, the operation data corresponding to different first applications are different. When deploying server clusters for different first applications, each first application should be sampled independently.
[0042] It should be noted that, although the application node running the first application is named as server in the exemplary embodiment, in other embodiments, the application node running the first application may also be named in other ways, and the present disclosure does not impose any special limitation on this.
[0043] In an exemplary embodiment, the operation data of the first application can be sampled based on the first server, and the first server is the server that samples the operation data of the first application. In the application scenario of building a server cluster from scratch, the first server can be an existing server with short-term or long-term use rights, and may or may not join the server cluster in the future; in the application scenario of expanding or replacing the server cluster based on the expansion target of the first application, the first server can be an existing server in the server cluster, and similarly, the first server can exist in the adjusted server cluster or not in the adjusted server cluster.
[0044] It should be noted that the hardware type and operating system of the first server need to be consistent with the servers in the server cluster after the deployment, or at least ensure that the difference between the processor single-core performance test value (benchmark) of the servers in the server cluster after the deployment and the processor single-core performance test value of the first server is less than the preset value (that is, the two are close to or equal) to ensure the validity of the sampled data. Among them, the processor single-core performance test value (benchmark) is one of the test results of the benchmark test program for computer products shipped from the factory, which is used to evaluate the computing speed of the computer, and the influencing factors are, for example, the CPU's computing efficiency or memory efficiency. The processor single-core performance test value (benchmark) can be determined based on the product performance parameters provided by the processor supplier.
[0045] In the process of sampling the first server, the first application can be run only through at least one first server, and server parameters such as the request processing volume per unit time and the processor utilization rate of each first server can be collected during the sampling period. Alternatively, the first application can be run through a server cluster including the first server, and server parameters such as the request processing volume per unit time and the processor utilization rate of only the first server can be collected during the sampling period.
[0046] After sampling the first server, the correspondence between the request processing volume per unit time of the first application by the first server and the server parameters can be determined based on the running data of the first application, where the server parameters include the number of processor cores and the processor usage rate.
[0047] In some embodiments, the request processing volume per unit time is, for example, a query rate per second (QPS), transactions per second (TPS), requests per second (RPS), events per second (EPS), frames per second (FPS), etc. The request processing volume per unit time is used to indicate the processing capability of the server for the first application, and those skilled in the art can set the specific meaning of the request processing volume per unit time according to actual needs.
[0048] Next, the number of processing cores of the first server is determined.
[0049] In an exemplary embodiment, the processor is, for example, a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a TPU (Tensor Processing Unit), an NPU (Neural Processing Unit), etc. Correspondingly, the number of processor cores is, for example, the number of CPU cores, GPU cores, TPU cores, NPU cores, etc. of the server, and the processor usage is, for example, the CPU usage, GPU usage, TPU usage, NPU usage, etc. of the server.
[0050] It can be understood that a server can be provided with one or more processors, each processor can have multiple cores, and the number of processor cores of the server in the embodiment of the present disclosure refers to the sum of the number of processor cores in the server, and the processor utilization rate of the server refers to the processor utilization rate obtained by combining the processor utilization rates of each processor in the server. The parameters provided by the server to the outside usually include the number of processor cores and the processor utilization rate. Therefore, in step S12, the number of processor cores and the processor utilization rate of the first server can be determined by reading the parameters of the first server.
[0051] It should be noted that in each step of the embodiment of the present disclosure, the processor types of various servers (such as the first server, the second server, etc.) are the same, and the meaning of the request processing amount per unit time used when performing each step is the same.
[0052] The sampling period can be determined according to the deployment requirements of the server cluster. In an exemplary embodiment, after determining that the first application needs to be deployed in a server cluster, a sampling period can be set to sample the operation data of the first server.
[0053] Taking the first server running the Linux system and the processor chip being the CPU as an example, the Linux system regularly samples the usage of each CPU core at a sampling time point, and the sampling interval is determined by the number of beats generated by the clock metronome per second. Exemplarily, the clock metronome can generate 1000 beats per second to form a 1 millisecond time slice. The tool (such as top) for calculating the CPU usage rate in the Linux system samples the usage of the time slices of each CPU core at each sampling time point corresponding to the sampling period to obtain the number of time slices of each CPU core between two sampling time points (for example, an interval of 30 seconds), and the number of time slices of each CPU core in each usage state between the two sampling time points. The usage state may include, for example, user (user state), nice (user state with higher priority), system (kernel state), idle (idle state), iowait (waiting for I / O state), irq (hard interrupt), softirq (soft interrupt), steal (virtualization stealing time), guest (guest state) and other usage states. In the disclosed embodiment, the usage states other than the idle (idle state) state are collectively referred to as non-idle states.
[0054] The Linux system accumulates the results of each sampling to obtain the number of used time slices and the number of time slices in a non-idle state for each CPU core of the first server at two sampling time points. The values of each core are summed to obtain the number of used time slices and the number of time slices in a non-idle state for the first server at two sampling time points. The difference between the number of used time slices and the difference between the number of time slices in a non-idle state for two consecutive samplings is calculated to obtain the total slice increment of all cores of the first server between the two sampling time points and the increment of used slices of all cores. According to the formula:
[0055]
[0056] The CPU usage of the first server between the two sampling points is determined. At the same time, the request processing volume per unit time of the first server can be read at the two sampling points to determine the corresponding relationship between the CPU usage and the request processing volume per unit time (QPS) between the two sampling points (i.e., within a time interval).
[0057] When sampling the first server, the sampling period can be divided into several time intervals, and the QPS and CPU usage of all application nodes (ie, first servers) in these time intervals, as well as the number of CPU cores of each first server, are obtained to perform processing in step S12.
[0058] In step S12, the resource occupancy of the first server in the sampling period is determined according to the processor usage rate and the number of processor cores of the first server.
[0059] By transforming formula (1), we can get:
[0060]
[0061] After further conversion, we can get:
[0062]
[0063] In the embodiment of the present disclosure, the number of CPU cores used in a time interval is referred to as the resource occupancy number. As can be seen from formula (3), for servers with different numbers of cores, the meaning of the resource occupancy number is the same, that is, it is equivalent to the number of CPU cores used in the time interval. For example, the CPU utilization rate of an 8-core server is 60%. According to formula (3), it is equivalent to using 8*0.6=4.8 cores at this time.
[0064] Therefore, the resource occupancy is a parameter that is independent of the number of processor cores set on each server. For example, assume that the processor cores of server A and server B are of the same model, and server A is provided with 8 processor cores, and server B is provided with 80 processor cores. During the sampling process, server A and server B both run the first application. When the unit time request processing volume of server A for the first application is 1000qps, the CPU utilization rate is 60%, and the resource occupancy number is 4.8 cores; when the unit time request processing volume of server B for the first application is 1000qps, the CPU utilization rate is 6%, and the resource occupancy number is 4.8 cores. That is, for the same unit time request processing volume of the same application, servers with different numbers of processor cores have different CPU utilization rates, but the resource occupancy number is the same. The resource occupancy number used by each server for the unit time request processing volume of 1000qps of the first application has nothing to do with the number of CPU cores set on the server, but is only related to the first application. Therefore, using the resource occupancy number to determine the processing capacity, i.e., capacity, of different servers for the first application can eliminate the differences between servers with different numbers of cores.
[0065] Next, the sampled data may be processed to establish a correlation relationship, ie, a function, between the resource occupancy number and the request processing volume per unit time.
[0066] In step S13, a correlation relationship between the resource occupancy number and the request processing volume per unit time is established according to the resource occupancy number and the request processing volume per unit time in a plurality of sampling periods.
[0067] Exemplarily, the QPS and resource occupancy of each sampling period and each first server can be paired in pairs to form a set of sample data, and then regression calculation is performed on the sample data to form a correlation relationship of y=f(x), where x can be the resource occupancy number, y can be the request processing volume per unit time (for example, QPS), and f(x) is the correlation relationship between the resource occupancy number and the request processing volume per unit time.
[0068] In some embodiments, the regression calculation method based on sample data includes but is not limited to univariate linear regression, polynomial regression, ridge regression, lasso regression, generalized additive model (GAM), kernel ridge regression, etc. In an exemplary embodiment, univariate linear regression can be selected to obtain a function in the form of y=kx+b, where x is the number of resource occupancy, y is the request processing volume per unit time (for example, QPS), k is the regression coefficient or slope, b is the intercept, and k and b are both constants.
[0069] After forming the correlation, the coefficient of determination R2 can be used to evaluate the model quality, that is, the reliability of the correlation. If the model quality meets the standard (such as R2 greater than 0.9), it can be determined that the correlation is reliable and can be used in subsequent steps; if the model quality does not meet the standard (such as R2 less than or equal to 0.9), other regression methods can be used to process the sample data, or resample to form new sample data. Repeat the above steps until the model quality meets the standard.
[0070] In step S14, the number of processor cores and the saturated processor usage of the second server are determined, wherein the difference between the single-core performance test value of the processor of the second server and the single-core performance test value of the processor of the first server is less than a preset value.
[0071] Next, the parameters of the second server can be converted. The second server refers to a candidate server that can be added to the server cluster. In an exemplary embodiment, the second server can be a server that has been purchased but has not yet joined the server cluster, or a server that has not yet been purchased and only knows the basic parameters. The second server and the first server have the same processor type and operating system. Exemplarily, the difference between the single-core performance test value of the processor of the second server and the single-core performance test value of the processor of the first server is less than a preset value, and the preset value can be set to a smaller value according to the specific value of the single-core performance test value of the processor to constrain the single-core processing speed of the second server to be as close or equal as possible to the first server.
[0072] The disclosed embodiments are particularly suitable for application scenarios in which the number of processor cores between second servers is not completely the same, and the number of processor cores of the second server and existing servers in a server cluster is not completely the same.
[0073] The saturated processor usage of the second server refers to the CPU usage corresponding to when the server is in a saturated operation state. The saturated operation state means that the CPU is close to or reaches the critical value of its processing capacity limit. If the critical value is exceeded, there may be a risk of performance degradation, response delay, or even service interruption. In some scenarios, the saturated processor usage is also called the high level experience value of CPU usage.
[0074] In an exemplary embodiment, the saturated processor usage rate identifies the upper limit of a server's carrying capacity for the first application. Under the saturated processor usage rate, the server's request processing volume per unit time is the server's maximum request processing volume per unit time for the first application. If the saturated processor usage rate is exceeded, the server may experience response delays or even downtime.
[0075] Different types of systems (such as servers, desktop computers, embedded devices, etc.) and different application scenarios (such as database services, Web servers, scientific computing, etc.) may have different CPU usage expectations and limits, that is, different saturated processor usage. The saturated processor usage of a server can be determined through information provided by the server manufacturer or by directly testing the server.
[0076] When the second server is a purchased server, the number of processor cores and the saturated processor usage of the second server can be determined in step S14 by directly reading the parameters of the second server; when the second server is a server not yet purchased, the number of processor cores and the saturated processor usage of the second server can be determined in step S14 by manually inputting parameters.
[0077] In step S15, a third server is selected from the second servers according to the association relationship, the number of processor cores and the saturated processor usage of the second server, and the first capacity of the first application, and a server cluster for running the first application is deployed based on the third server.
[0078] Figure 2 It is a sub-flowchart of step S15 in the exemplary embodiment of the present disclosure.
[0079] refer to Figure 2 In an exemplary embodiment, step S15 may include:
[0080] Step S151, determining the upper limit of resource occupancy of the second server according to the number of processor cores of the second server and the saturated processor usage rate;
[0081] Step S152, determining the upper limit of the request processing amount per unit time of the second server according to the association relationship and the upper limit of the resource occupation of the second server;
[0082] Step S153: Select a third server from the second servers according to the upper limit of the request processing volume per unit time of the second server and the first capacity.
[0083] According to formula (3), the resource occupancy of the second server at saturated processor usage can be determined without being affected by the number of processor cores of the second server, that is, the maximum resource occupancy allowed under normal operation of the second server, also known as the upper limit of resource occupancy.
[0084] Next, based on the above-mentioned association relationship, for example, y=f(x), substitute x=upper limit of resource occupancy into f(x) to obtain the request processing volume per unit time corresponding to the upper limit of resource occupancy, that is, the upper limit of the request processing volume per unit time of the second server for the first application, that is, the capacity upper limit.
[0085] In the application scenario of the embodiment of the present disclosure, the number of processor cores of the second servers is not exactly the same, and the upper limit of the request processing volume per unit time of each second server for the first application needs to be determined separately to determine the upper limit of the capacity of each second server for the first application.
[0086] Figure 3 It is a sub-flowchart of step S153 in the exemplary embodiment of the present disclosure.
[0087] refer to Figure 3 In an application scenario where the server cluster is expanded based on the expansion target of the first application, step S153 may include:
[0088] Step S1531, obtaining the sum of the upper limits of the request processing volume per unit time of the fourth server in the server cluster, where the fourth server is an existing server in the server cluster;
[0089] Step S1532, determining the capacity gap according to the sum of the first capacity and the upper limit of the request processing volume per unit time of the fourth server;
[0090] Step S1533: Select at least one second server among the second servers whose sum of upper limits of request processing volume per unit time is greater than the capacity gap as the third server.
[0091] exist Figure 3 In the illustrated embodiment, the server that the server cluster must include after deployment can be first determined as the fourth server. This is because, in some capacity expansion scenarios, a batch of servers may be determined to be eliminated, and the eliminated servers should not be determined as the fourth server; in other capacity expansion scenarios, a batch of servers may be determined to be purchased, and this batch of servers that have been determined to join the server cluster should be regarded as the fourth server even if they have not been purchased. Correspondingly, the second server is a candidate server that is not determined whether it will join the server cluster.
[0092] The method of obtaining the upper limit of the number of requests per unit time of the fourth server in step S1531 is the same as the method of obtaining the upper limit of the number of requests per unit time of the second server described above, which will not be described in detail in this disclosure.
[0093] After obtaining the upper limit of the request amount per unit time of each fourth server, the sum of the upper limits of the request amounts per unit time of all fourth servers is calculated to determine the existing capacity of the server cluster for the first application.
[0094] Next, in step S1522, the capacity gap of the server cluster for the first application is determined based on the difference between the first capacity of the server cluster for the first application and the existing capacity, and then in step S1533, at least one second server whose sum of the upper limits of request processing volume per unit time is greater than the capacity gap is selected as the third server from the second servers.
[0095] In step S1533, the second servers may be sorted from largest to smallest according to the upper limit of the request processing volume per unit time, and the sum of the upper limits of the request processing volume per unit time of the first n second servers in the sorting is calculated, where n is a variable, such as 1, 2, 3, etc. When it is determined that the sum of the upper limits of the request processing volume per unit time of the first N second servers is greater than the capacity gap, the first N second servers are determined as the third servers to be added to the server cluster, where N is a natural number.
[0096] In addition, in step S1533, the selection priority of the second server can be determined according to factors such as price, volume, other performances other than the number of cores, and supply cycle, and then sorted from high to low according to the selection priority, and the sum of the upper limits of the unit time request processing volume of the first n second servers in the sorting is calculated. When it is determined that the sum of the upper limits of the unit time request processing volume of the first N second servers is greater than the capacity gap, the first N second servers are determined as the third servers to join the server cluster.
[0097] For example, suppose an application is initially deployed using five 80-core physical machines (the fourth server), and after running for half a year, the capacity is insufficient, and a new 106-core physical machine (the second server) needs to be purchased for capacity expansion. According to the embodiment of the present disclosure, it is possible to determine how many 106-core physical machines need to be purchased based on the first capacity of the application and the existing capacity of the five existing servers.
[0098] In the application scenario of building a server cluster from scratch, or replacing the old with the new, one or more second servers whose sum of upper limits of request processing per unit time is greater than or equal to the first capacity can be selected as the third server from the second servers. In these scenarios, there is no need to consider whether some servers must be retained or eliminated. All servers (including those purchased and those not purchased) can be regarded as second servers, and second servers that can meet the first capacity can be selected from the second servers to join the server cluster.
[0099] The process of selecting the third server may be determined automatically by the computer after receiving the relevant information of the second server, or may be determined manually, and the present disclosure does not impose any special limitation on this.
[0100] To summarize, the disclosed embodiment determines the upper limit of the request processing volume per unit time of the second server for the first application based on the resource occupancy (rather than the processor utilization rate), and then selects the third server from the second server based on the upper limit of the request processing volume per unit time of the second server for the first application to implement server cluster deployment. This can eliminate the impact of different numbers of processor cores on different servers, accurately select the third server that can meet the first capacity, improve the deployment efficiency of the server cluster, avoid wasting capacity or the inability to meet the first capacity after the cluster is deployed, and greatly save the deployment cost of the server cluster.
[0101] Corresponding to method 100, the embodiment of the present disclosure also provides a capacity detection method capable of routinely detecting the capacity of a server cluster for a first application.
[0102] Capacity detection is one of the daily tasks of operation and maintenance. By monitoring the capacity of the server cluster, it can be ensured that the server cluster can maintain stable operation under current and future workloads and meet user needs. In addition, the performance of the system can be evaluated to discover and solve performance bottlenecks and optimize resource allocation. Since capacity detection needs to be performed regularly (generally speaking, it needs to be performed every day), and the capacity detection solutions for server clusters in related technologies are all based on the same server models in the server cluster, when the server models in the server cluster are inconsistent, accurate detection results cannot be provided, and testing each model of server separately is inefficient. Therefore, there is a lack of a method that can quickly and accurately implement regular server cluster capacity detection.
[0103] Figure 4 The figure is a flow chart of a method for detecting the capacity of a server cluster in an exemplary embodiment of the present disclosure.
[0104] refer to Figure 4 The server cluster is used to run the first application and includes multiple servers. The capacity detection method 400 of the server cluster may include:
[0105] Step S41, obtaining the number of processor cores of the server, as well as the processor usage rate and request processing volume per unit time of the server during the sampling period;
[0106] Step S42, determining the resource occupancy of the server during the sampling period according to the processor usage rate of the server during the sampling period and the number of processor cores of the server;
[0107] Step S43, establishing a correlation relationship between the resource occupancy number corresponding to the server and the request processing volume per unit time according to the corresponding relationship between the resource occupancy number and the request processing volume per unit time in multiple sampling periods;
[0108] Step S44: determining the existing capacity of the server cluster for the first application according to the saturated processor usage rate, the number of processor cores and the association relationship of each server in the server cluster.
[0109] Figure 4 The principle of the illustrated method 400 is similar to that of the method 100 .
[0110] In step S41, sampling is performed based on existing servers in the server cluster. Since there is no second server to be selected in the application scenario of method 400, the existing servers in the server cluster are referred to as servers herein.
[0111] In step S41, when the difference between the single-core performance test values of multiple processors in the server cluster is less than a preset value, a small number of servers may be selected for sampling.
[0112] In an exemplary embodiment, the first application can be first run through a server cluster, and then, among multiple servers whose processor single-core performance test value difference is less than a preset value, a preset number of servers are selected as the first server for sampling, and the number of processor cores of the first server, as well as the processor usage rate and the request processing volume per unit time of the first server during the sampling period are obtained. The preset number is greater than or equal to 1. Since the processor single-core performance test value of each server, i.e., the single-core performance, is nearly the same, the performance of one server can represent the performance of all servers. In order to enrich the sampling data and provide more accurate detection results, the preset number of servers used for sampling can be set to be greater than 1.
[0113] That is, in the embodiments of the present disclosure, all servers in the server cluster can be sampled, or a portion of all servers can be selected for sampling. The more servers sampled, the more accurate the calculation result, but the longer the calculation time; the fewer servers sampled, the shorter the calculation time, and accordingly, the accuracy of the calculation result decreases. Those skilled in the art can determine how many servers to sample according to actual needs, and the present disclosure does not impose any special restrictions on this.
[0114] The specific sampling method is the same as that in method 100 and will not be described again here.
[0115] Next, in step S42 and step S43, using the same method as step S12 and step S13 in method 100, an association relationship in the form of y=f(x) is obtained based on the sampled data, where x is the number of resource occupancy and y is the request processing volume per unit time.
[0116] In step S44, different from method 100, when the number of processor cores of the servers in the server cluster is not exactly the same, the upper limit of resource occupancy of each server can be determined based on the saturated processor usage and the number of processor cores of each server in the server cluster, and the upper limit of request processing volume per unit time of each server is determined based on the above-mentioned association relationship and the upper limit of resource occupancy, and then the existing capacity of the server cluster for the first application is determined based on the sum of the upper limits of request processing volume per unit time of multiple servers.
[0117] Exemplarily, the QPS and CPU usage of 10 servers per minute in the previous natural day, as well as the number of CPU cores of each server, can be collected. Then, the CPU usage of each server is multiplied by the number of cores of the server to obtain the resource occupancy of the server, and the resource occupancy of a server is paired with the QPS of the time interval in which it is located, to obtain a total of 14,400 sample data. Linear regression is used to derive the formula for calculating QPS by resource occupancy, and the product of the number of CPU cores of each server and the high water mark experience value of CPU usage (i.e., saturated processor usage) of 0.6 (i.e., the upper limit of resource occupancy) is substituted into the formula to obtain the upper limit of QPS of each server for the first application. Finally, the QPS upper limits of all servers in the server cluster are added together to obtain the total QPS upper limit of the server cluster for the application, i.e., the capacity.
[0118] Figure 5A and Figure 5B It is a schematic diagram of the reliability of the association relationship in the exemplary embodiment of the present disclosure.
[0119] refer to Figure 5A , sample a 106-core server and an 80-core server to obtain the sample data of CPU usage-QPS corresponding to different time periods, perform linear regression on these sample data, and obtain the corresponding relationship between the server's CPU usage and QPS. Figure 5A It can be seen that the model quality is only 0.4807 when R2 is used to evaluate the model quality, which is completely unreliable.
[0120] refer to Figure 5B , sample the same 106-core server and 80-core server mentioned above to obtain sample data of CPU usage (QPS) corresponding to different time periods, and convert the sample data according to formula (3) to obtain sample data of resource usage (QPS) corresponding to different time periods. Perform linear regression on the newly formed sample data to obtain the corresponding relationship between the server's resource usage and QPS. Figure 5B It can be seen that the discreteness of the samples is greatly reduced. The model quality is evaluated using R2, which increases from 0.4807 to 0.714, and the model quality has been significantly improved.
[0121] Therefore, the method of the embodiment of the present disclosure is used to calculate the capacity of the server cluster for the first application with high accuracy.
[0122] To summarize, by determining the upper limit of the request processing volume per unit time of each server for the first application based on the number of resource occupancy rather than the processor utilization rate, and then determining the capacity of the server cluster for the first application based on the sum of the upper limits of the request processing volume per unit time of each server in the server cluster for the first application, the number of cores is eliminated from the calculation formula, so that the calculation formula can be applied to servers with different numbers of processor cores. When calculating capacity on a daily basis, the obstacle of different numbers of processor cores of new and old servers is eliminated. A unified model can be used to evaluate application capacity, eliminating the impact of different numbers of processor cores of different servers, and quickly and accurately calculating the capacity of the server cluster for the first application, which is suitable for daily use.
[0123] Corresponding to the above method embodiments, the present disclosure also provides a server cluster deployment device, which can be used to execute the above method embodiments.
[0124] Figure 6 It is a block diagram of a deployment device of a server cluster in an exemplary embodiment of the present disclosure.
[0125] refer to Figure 6 , the server cluster deployment device 600 may include:
[0126] The data acquisition module 61 is configured to acquire the number of processor cores of the server, and the processor usage rate and the request processing volume per unit time of the server during a sampling period;
[0127] A unit conversion module 62, configured to determine the resource occupancy of the server in the sampling period according to the processor usage rate of the server in the sampling period and the number of processor cores of the server;
[0128] A relationship determination module 63 is configured to establish an association relationship between the resource occupation number corresponding to the server and the request processing volume per unit time according to the corresponding relationship between the resource occupation number and the request processing volume per unit time in multiple sampling periods;
[0129] The capacity determination module 64 is configured to determine the existing capacity of the server cluster for the first application according to the saturated processor usage rate of each of the servers in the server cluster, the number of processor cores, and the association relationship.
[0130] Since the functions of the device 600 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0131] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0132] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0133] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0134] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0135] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device, such as a server in a server cluster, or a computer independent of the server cluster. The electronic device 700 can communicate with multiple servers to obtain sampling data, processor core numbers and other parameters of the multiple servers. In some embodiments, the electronic device 700 itself can also serve as the first server or the second server, or a server in a server cluster.
[0136] The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710 mentioned above, the at least one storage unit 720 mentioned above, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
[0137] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps corresponding to the method 100 or the method 400 to obtain the server cluster deployment result or the capacity detection result of the server cluster. For example, the processing unit 710 can execute the method shown in the embodiment of the present disclosure.
[0138] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0139] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0140] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0141] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0142] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0143] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0144] The program product for implementing the above method according to an embodiment of the present invention can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0145] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 above.
[0146] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0147] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0148] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0149] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0150] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and concept of the present disclosure are indicated by the claims.
Claims
1. A method for deploying a server cluster, characterized in that: include: When the first server runs the first application, obtaining the processor usage rate and the request processing volume per unit time of the first server during the sampling period; Determine the resource occupancy of the first server during the sampling period according to the processor usage rate and the number of processor cores of the first server; Establishing a correlation relationship between the resource occupancy number and the request processing volume per unit time according to the resource occupancy number and the request processing volume per unit time in a plurality of sampling periods; Determining the number of processor cores and saturated processor usage of the second server, wherein a difference between a single-core performance test value of the processor of the second server and a single-core performance test value of the processor of the first server is less than a preset value; A third server is selected from the second servers according to the association relationship, the number of processor cores and the saturated processor usage of the second server, and the first capacity of the first application, and a server cluster for running the first application is deployed based on the third server.
2. The server cluster deployment method according to claim 1, characterized in that: The selecting a third server from the second servers according to the association relationship, the number of processor cores and the saturated processor usage rate of the second server, and the first capacity of the first application includes: Determining an upper limit of resource usage of the second server according to the number of processor cores of the second server and its saturated processor usage rate; Determining an upper limit of the request processing amount per unit time of the second server according to the association relationship and an upper limit of the resource occupation of the second server; The third server is selected from the second servers according to the upper limit of the request processing volume per unit time of the second server and the first capacity.
3. The server cluster deployment method according to claim 2, characterized in that: The selecting the third server from the second servers according to the upper limit of the request processing amount per unit time of the second server and the first capacity includes: Obtaining a sum of upper limits of request processing volume per unit time of a fourth server in the server cluster, where the fourth server is an existing server in the server cluster; Determine the capacity gap according to the sum of the first capacity and the upper limit of the request processing volume per unit time of the fourth server; At least one second server whose sum of upper limits of request processing volume per unit time is greater than the capacity gap is selected from the second servers as the third server.
4. The server cluster deployment method according to claim 2, characterized in that: The selecting the third server from the second servers according to the upper limit of the request processing amount per unit time of the second server and the first capacity includes: Among the second servers, at least one second server whose sum of upper limits of request processing volume per unit time is greater than or equal to the first capacity is selected as the third server.
5. A method for detecting the capacity of a server cluster, characterized in that: The server cluster is used to run a first application and includes a plurality of servers, and the method includes: Obtaining the number of processor cores of the server, as well as the processor usage rate and request processing volume per unit time of the server during a sampling period; Determine the resource occupancy of the server in the sampling period according to the processor usage rate of the server in the sampling period and the number of processor cores of the server; According to the correspondence between the resource occupancy number and the request processing volume per unit time in multiple sampling periods, establishing an association relationship between the resource occupancy number corresponding to the server and the request processing volume per unit time; The existing capacity of the server cluster for the first application is determined according to the saturated processor usage rate of each of the servers in the server cluster, the number of processor cores, and the association relationship.
6. The server cluster deployment method according to claim 5, characterized in that: Determining, according to the saturated processor usage rate of each of the servers in the server cluster, the number of processor cores, and the association relationship, the existing capacity of the server cluster for the first application includes: Determining an upper limit of resource occupancy of the server according to a saturated processor usage rate of the server and the number of processor cores; Determining an upper limit of the request processing volume per unit time of the server according to the association relationship and the upper limit of the resource occupation number; The existing capacity of the server cluster for the first application is determined according to the sum of the upper limits of the request processing volume per unit time of each of the servers in the server cluster.
7. The server cluster deployment method according to claim 5, characterized in that: The difference between the single-core performance test values of the multiple processors is less than a preset value, and obtaining the number of processor cores of the server, and the processor usage rate and the request processing volume per unit time of the server during the sampling period include: Running the first application through the server cluster; Among the multiple servers, a preset number of servers are selected as first servers for sampling, and the number of processor cores of the first server, as well as the processor usage rate and request processing volume per unit time of the first server during the sampling period are obtained.
8. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the method according to any one of claims 1 to 7 based on instructions stored in the memory.
9. A computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.