Load balancing optimization method suitable for server cluster
By building a request response model and resource occupancy index model, real-time analysis and scheduling requests, the problems of uneven load allocation and response time delay of server clusters are solved, and the optimal utilization of resources and improvement of system performance are achieved.
Patent Information
- Application Number
- CN202411633747.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing load balancing strategies cannot effectively deal with the challenges brought about by the increase in the number of servers in the server cluster, especially in high concurrency environments, which can easily lead to unbalanced resource utilization and delayed response time.
By building a request response model and a server node resource occupancy index model, we analyze the request response time and server node load changes in real time, build a request optimization scheduling strategy, and schedule the request to the appropriate server node for processing.
It realizes optimal resource utilization, improves the performance and stability of the server cluster, and significantly improves the overall response capability of the system.
Smart Images

Figure CN119576547A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the computer field, relates to the technical field of server cluster control, and specifically relates to a load balancing optimization method suitable for a server cluster. Background Art
[0002] With the rapid development of cloud computing and big data technology, the scale of server clusters continues to expand, and enterprises have an increasingly urgent need for efficient load balancing. However, existing load balancing strategies often cannot effectively cope with the challenges brought about by the increase in the number of servers in the cluster, especially in high-concurrency environments. Traditional load balancing methods are prone to problems such as uneven resource utilization and delayed response time. In practical applications, the load of server clusters often fluctuates, and the performance indicators of different servers (such as CPU, memory, network bandwidth, etc.) also vary significantly. This requires that load balancing strategies can be monitored and adjusted in real time to adapt to different workloads. In addition, the loads caused by different requests on the server are different. Some requests may consume a lot of resources, while others are relatively light. Therefore, there is an urgent need for a load balancing optimization strategy for server clusters. This strategy can dynamically monitor the load status of each server and schedule requests according to the type and access frequency of the request to achieve optimal resource utilization and improve the performance and stability of the overall system. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a load balancing optimization method suitable for server clusters to solve the current problems of uneven load distribution, high response time delay and unreasonable resource utilization in server clusters. By constructing a request response model and a server node resource occupancy rate index model, the request response time and the load change of the server node are analyzed in real time, and a request optimization scheduling strategy is constructed, so that the request is scheduled to the appropriate server node for processing, so as to meet the performance requirements in a high concurrency environment and improve the stability and responsiveness of the server cluster.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] A load balancing optimization method applicable to a server cluster specifically comprises the following steps:
[0006] S1: Build a cluster request response model based on the frequency of service requests arriving at the cluster and the frequency of the cluster processing the requests;
[0007] S2: CPU occupancy, memory occupancy, disk occupancy and network occupancy are used as input indicators of the entropy method to calculate their impact on the comprehensive load of the server, and then the comprehensive load calculation model of the server node is constructed by combining various resource occupancy indicators;
[0008] S3: Based on the request response model, the response time of the request is calculated in real time in combination with the comprehensive load of the server node;
[0009] S4: Construct a request scheduling strategy: By taking the weighted sum of the server's comprehensive load and the request response time, the comprehensive selectivity of the service request being scheduled to different servers is calculated, and then the server with the largest selectivity value is used as the target node to schedule the request.
[0010] Further, in step S1, a cluster request response model is constructed, which specifically includes: assuming that there are m server nodes e j The server cluster E is constructed, and the frequency f of service requests arriving at the server cluster E and the transaction processing frequency ν are used to describe the load brought to the cluster by service requests, so that the cluster request response model expression is constructed as follows:
[0011]
[0012] Where, t (t = 0, 1, ...) represents time t; F j (t) represents the server node e j The frequency set of various requests at time t; V j (t) represents the server node e j The processing frequency set of various requests at time t; n represents the types of requests existing in the cluster.
[0013] Further, in step S2, a comprehensive load calculation model of the server node is constructed, which specifically includes the following steps:
[0014] S1: Calculate the influence of resource utilization index on the comprehensive load of server nodes through entropy method;
[0015] Server Node j The resource occupancy index U at the tth moment j (t) is expressed as follows:
[0016] U j (t) = {μ j,1 (t),μ j,2 (t),μ j,3 (t),μ j,4 (t)}
[0017] Among them, μ j,1 (t)~μ j,4 (t) respectively represent the server node e j CPU usage, memory usage, disk usage, and network usage at time t;
[0018] Collect resource occupancy rate index data of each server node and construct the evaluation matrix Xc×4 There are a total of c groups of observations, collected from m server nodes, and the average number of observations collected from each server node is Group data, each group of observations contains 4 resource occupancy indicators; the calculation model is as follows:
[0019]
[0020] Where q represents the qth group of observations, q∈c; y represents the yth resource occupancy index, y=1,2,3,4; p q,y represents the proportion of the qth sample under the yth resource occupancy index, satisfying r y represents the entropy value of the y-th resource occupancy index. When p q,y = 0, let r y =0; α y Indicates the influence of the yth resource utilization index on the comprehensive load of the server node, satisfying
[0021] S2: Dynamic calculation server node e j The weight of the resource occupancy rate indicator at time t is expressed as:
[0022]
[0023] in, Represents the server node e j The resource occupancy rate index μ of the yth item on the j,y The upper threshold of (t) is in the range of (0,1], if Then directly change A j (t) is set to 1; α′ j,y (t) represents the service node e j The proportion of the y-th resource occupancy index at time t that satisfies α′ j ' ,y (t) represents the weight of the yth resource occupancy rate indicator on the service node at time t;
[0024] S3: Computing server nodes j The total load A at time t j (t), the calculation formula is:
[0025] Further, in step S3, the response time of the request is calculated, specifically including: when the request arrives at the server cluster, based on the type of request on the server node e j The request frequency f at the previous moment j,i (t-1), transaction processing frequency v j,i(t-1) and the comprehensive load A j (t-1) Calculate the response time W j,i (t), calculated as follows:
[0026]
[0027] Among them, σ represents the correction coefficient of the impact of the comprehensive load of the server node on the response time. It is obtained by collecting request response time, comprehensive load of server nodes, request frequency and server processing frequency of requests to construct data samples, and fitting them using the least squares method.
[0028] Further, in step S4, constructing a request scheduling strategy specifically includes the following steps:
[0029] 1) Construct the selectivity R(t) of the request to the cluster server node, which is calculated as follows:
[0030]
[0031] Among them, G j,i (t) indicates that a request of type i is received at server node e j The relative response time at the previous moment t, i∈n; and They represent the minimum and maximum response times of the request of type i on the candidate server node at time t respectively; λ1 and λ2 represent the weights of the comprehensive load of the server node and the relative response time, satisfying λ1+λ2=1;
[0032] Calculate the weights λ1 and λ2, and calculate the weights in R(t) according to the cluster load. The calculation formula is as follows:
[0033]
[0034] Among them, ψ represents the correction coefficient, ψ∈(0,5], which is used to control the speed of change of the function and should be set according to the actual system;
[0035] 2) Build a request scheduling strategy;
[0036] Strategy 1: Cluster A jThe server nodes whose R(t) is not 1 are used as candidate server nodes for request scheduling; Strategy 2: Calculate the selectivity R(t) of the service request for the candidate server nodes. When scheduling the request, give priority to the server node with the largest R(t) as the service node; Strategy 3: When the R(t) values of different server nodes are equal, determine the indicator corresponding to the higher weight, and give priority to the server node with the smallest value of the indicator for scheduling. If the indicator values corresponding to different server nodes are also equal at this time, randomly select one of the server nodes for scheduling; Strategy 4: When the R(t) values of different server nodes are equal and the two weights are equal, give priority to G j,i (t) The smallest server node is scheduled. If the G corresponding to different server nodes j,i If the (t) values are also equal, one of the server nodes is randomly selected for scheduling.
[0037] The beneficial effects of the present invention are as follows: the present invention constructs a request response model in a server cluster to accurately evaluate the impact of different requests on system performance; establishes a resource occupancy index model to monitor the usage of server resources in real time to ensure the effectiveness of load balancing; designs a response time calculation model for different types of requests on different servers to optimize the processing efficiency of various types of requests; in addition, formulates a request optimization scheduling strategy, which significantly improves the overall performance and responsiveness of the system by intelligently allocating resources and adjusting request flows.
[0038] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0040] Figure 1 A flow chart of a load balancing optimization method applicable to a server cluster provided by the present invention;
[0041] Figure 2 It is a schematic diagram of the server node comprehensive load calculation process in the present invention;
[0042] Figure 3 It is a schematic diagram of the scheduling request process in the present invention. DETAILED DESCRIPTION
[0043] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0044] See also Figure 1 to Figure 3 ,like Figure 1 As shown, the present invention provides a load balancing optimization strategy suitable for a server cluster, including constructing a request response model and a server node resource occupancy model, constructing a server node comprehensive load calculation model, constructing a request response time calculation model and constructing a request scheduling strategy. The specific methods of each part are as follows:
[0045] 1. Building a request response model and server node resource occupancy rate model
[0046] 1) Assume there are m server nodes e j The server cluster E is constructed, and the frequency f of service requests arriving at the server cluster E and the transaction processing frequency ν are used to describe the load brought to the cluster by service requests, so as to construct the cluster request response model as follows:
[0047]
[0048] Where, t (t = 0, 1, ...) represents the tth moment; F j (t) represents the server node e j The frequency set of various requests at time t; V j (t) represents the server node e j The processing frequency set of each type of request at time t; n represents the type of request existing in the cluster.
[0049] 2) Construct the server node resource occupancy rate indicator to describe the load of the server node. j The resource occupancy index U at the tth moment j (t) is constructed as follows:
[0050] U j (t) = {μ j,1 (t),μ j,2 (t),μ j,3 (t),μ j,4 (t)}
[0051] Among them, μj,1 (t)~μ j,4 (t) respectively represent the server node e j CPU usage, memory usage, disk usage, and network usage at time t.
[0052] 2. Server Node Comprehensive Load Calculation Method
[0053] like Figure 2 As shown, the comprehensive load calculation method of the server node includes two parts: static calculation and dynamic calculation. The static calculation part will calculate the impact of the cluster resource occupancy index data on the comprehensive load, while the dynamic calculation part will calculate the real-time proportion of each resource occupancy index, and combine the results of the static calculation part to comprehensively calculate the weight of the resource occupancy index, and finally obtain the comprehensive load of the server node.
[0054] Based on the above resource occupancy indicators, server node e is constructed j The comprehensive load A at time t j (t) Calculation model, the steps are as follows:
[0055] S1: Calculate the impact of resource utilization index on the comprehensive load of server nodes through entropy method. Collect resource utilization index data of each server node and construct evaluation matrix X c×4 There are a total of c groups of observations, collected from m server nodes, and the average number of observations collected from each server node is Each group of observations contains four resource utilization indicators. The calculation model is as follows:
[0056]
[0057] Where q(q∈c) represents the qth group of observations; y(y=1,2,3,4) represents the yth resource occupancy rate indicator; p q,y represents the proportion of the qth sample under the yth resource occupancy index, satisfying r y represents the entropy value of the y-th resource occupancy index. When p q,y = 0, let r y =0; α y Indicates the influence of the yth resource utilization index on the comprehensive load of the server node, satisfying
[0058] S2: Dynamic computing server j The weight of the resource utilization index at time t:
[0059]
[0060] in, Represents the server node e j The upper threshold of the y-th resource utilization index is in the range of (0,1]. Then directly change A j (t) is set to 1; α′ j,y (t) represents the service node e j The proportion of the y-th resource occupancy index at the t-th moment satisfies α′ j ' ,y (t) represents the service node e j The weight of the y-th resource occupancy index at the t-th time;
[0061] S3: Computing server nodes j The comprehensive load A at time t j (t), the calculation formula is:
[0062] 3. Response time calculation method
[0063] When a request arrives at the server cluster, it is dispatched on the server node e based on the type of request. j The request frequency f at the previous moment j,i (t-1), transaction processing frequency v j,i (t-1) and the comprehensive load A j (t-1) Calculate the response time W j,i (t). The calculation formula is as follows:
[0064]
[0065] Among them, σ represents the correction coefficient of the impact of the comprehensive load of the server node on the response time. It is obtained by collecting request response time, comprehensive load of server nodes, request frequency and server processing frequency of requests to construct data samples, and fitting them using the least squares method.
[0066] 4. Building a request scheduling strategy
[0067] like Figure 3 As shown, when a service request arrives at the cluster, the load balancer will comprehensively consider the load conditions of each server node in the cluster and the selectivity of the request to each server node to select the target server node for optimal scheduling of the request.
[0068] 1) The selectivity R(t) of the construction request to the cluster server node is as follows:
[0069]
[0070] Among them, G j,i(t) indicates that the request of type i (i∈n) is received at server node e j The relative response time at the last moment t; and They respectively represent the minimum and maximum response times of the request of type i on the candidate server node at time t; λ1 and λ2 represent the weights of the comprehensive load of the server node and the relative response time, satisfying λ1+λ2=1.
[0071] Calculate the weights λ1 and λ2. Calculate the weights in R(t) according to the cluster load. The calculation formula is as follows:
[0072]
[0073] Where ψ represents the correction coefficient, ψ∈(0,5], which is used to control the speed of change of the function and should be set according to the actual system.
[0074] 2) Build a request scheduling strategy.
[0075] Strategy 1: Cluster A j The server nodes whose R(t) is not 1 are used as candidate server nodes for request scheduling; Strategy 2: Calculate the selectivity R(t) of the service request for the candidate server nodes. When scheduling the request, give priority to the server node with the largest R(t) as the service node; Strategy 3: When the R(t) values of different server nodes are equal, determine the indicator corresponding to the higher weight, and give priority to the server node with the smallest value of the indicator for scheduling. If the indicator values corresponding to different server nodes are also equal at this time, randomly select one of the server nodes for scheduling; Strategy 4: When the R(t) values of different server nodes are equal and the two weights are equal, give priority to G j,i (t) The smallest server node is scheduled. If the G corresponding to different server nodes j,i If the (t) values are also equal, one of the server nodes is randomly selected for scheduling.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A load balancing optimization method applicable to a server cluster, characterized in that: The method specifically comprises the following steps: S1: Build a cluster request response model based on the frequency of service requests arriving at the cluster and the frequency of the cluster processing the requests; S2: CPU occupancy, memory occupancy, disk occupancy and network occupancy are used as input indicators of the entropy method to calculate their impact on the comprehensive load of the server, and then the comprehensive load calculation model of the server node is constructed by combining various resource occupancy indicators; S3: Based on the request response model, the response time of the request is calculated in real time in combination with the comprehensive load of the server node; S4: Construct a request scheduling strategy: By taking the weighted sum of the server's comprehensive load and the request response time, the comprehensive selectivity of the service request being scheduled to different servers is calculated, and then the server with the largest selectivity value is used as the target node to schedule the request.
2. The load balancing optimization method according to claim 1, characterized in that: In step S1, a cluster request response model is constructed, which specifically includes: assuming that there are m server nodes e j The server cluster E is constructed, and the frequency f of service requests arriving at the server cluster E and the transaction processing frequency ν are used to describe the load brought to the cluster by service requests, so that the cluster request response model expression is constructed as follows: Where, t represents time t; F j (t) represents the server node e j The frequency set of various requests at time t; V j (t) represents the server node e j The processing frequency set of various requests at time t; n represents the types of requests existing in the cluster.
3. The load balancing optimization method according to claim 2, characterized in that: In step S2, a comprehensive load calculation model of the server node is constructed, which specifically includes the following steps: S1: Calculate the influence of resource utilization index on the comprehensive load of server nodes through entropy method; Server Node j The resource occupancy index U at the tth moment j (t) is expressed as follows: U j (t)={μ j,1 (t),μ j,2 (t),μ j,3 (t),μ j,4 (t)} Among them, μ j,1 (t)~μ j,4 (t) respectively represent the server node e j CPU usage, memory usage, disk usage, and network usage at time t; Collect resource occupancy rate index data of each server node and construct the evaluation matrix X c×4 There are a total of c groups of observations, collected from m server nodes, and the average number of observations collected from each server node is Group data, each group of observations contains 4 resource occupancy indicators; the calculation model is as follows: Where q represents the qth group of observations, q∈c; y represents the yth resource occupancy index, y=1,2,3,4; p q,y represents the proportion of the qth sample under the yth resource occupancy index, satisfying r y represents the entropy value of the y-th resource occupancy index. When p q,y = 0, let r y =0; α y Indicates the influence of the yth resource utilization index on the comprehensive load of the server node, satisfying S2: Dynamic calculation server node e j The weight of the resource occupancy rate indicator at time t is expressed as: in, Represents the server node e j The resource occupancy rate index μ of the yth item on the j,y The upper threshold of (t) is in the range of (0,1], if Then directly change A j (t) is set to 1; α′ j,y (t) represents the service node e j The proportion of the y-th resource occupancy index at time t that satisfies α′ j ' ,y (t) represents the weight of the yth resource occupancy rate indicator on the service node at time t; S3: Computing server nodes j The total load A at time t j (t), the calculation formula is:
4. The load balancing optimization method according to claim 3, characterized in that: In step S3, the response time of the request is calculated, which specifically includes: when the request arrives at the server cluster, based on the type of request, the response time of the request is calculated on the server node e j The request frequency f at the previous moment j,i (t-1), transaction processing frequency v j,i (t-1) and the comprehensive load A j (t-1) Calculate the response time W j,i (t), calculated as follows: Among them, σ represents the correction coefficient of the impact of the comprehensive load of the server node on the response time. It is obtained by collecting request response time, comprehensive load of server nodes, request frequency and server processing frequency of requests to construct data samples, and fitting them using the least squares method.
5. The load balancing optimization method according to claim 4, characterized in that: In step S4, constructing a request scheduling strategy specifically includes the following steps: 1) Construct the selectivity R(t) of the request to the cluster server node, which is calculated as follows: Among them, G j,i (t) indicates that a request of type i is received at server node e j The relative response time at the previous moment t, i∈n; and They represent the minimum and maximum response times of the request of type i on the candidate server node at time t respectively; λ1 and λ2 represent the weights of the comprehensive load of the server node and the relative response time, satisfying λ1+λ2=1; Calculate the weights λ1 and λ2, and calculate the weights in R(t) according to the cluster load. The calculation formula is as follows: Among them, ψ represents the correction coefficient, ψ∈(0,5], which is used to control the speed of change of the function and should be set according to the actual system; 2) Build a request scheduling strategy; Strategy 1: Cluster A j The server nodes whose R(t) is not 1 are used as candidate server nodes for request scheduling; Strategy 2: Calculate the selectivity R(t) of the service request for the candidate server nodes. When scheduling the request, give priority to the server node with the largest R(t) as the service node; Strategy 3: When the R(t) values of different server nodes are equal, determine the indicator corresponding to the higher weight, and give priority to the server node with the smallest value of the indicator for scheduling. If the indicator values corresponding to different server nodes are also equal at this time, randomly select one of the server nodes for scheduling; Strategy 4: When the R(t) values of different server nodes are equal and the two weights are equal, give priority to G j,i (t) The smallest server node is scheduled. If the G corresponding to different server nodes j,i If the (t) values are also equal, one of the server nodes is randomly selected for scheduling.
Citation Information
Patent Citations
Dynamic load balancing method under cloud environment
CN109120715A
Server load balancing method and device and storage medium
CN110389841A
Finite load consistency hash load balancing strategy based on virtual nodes
CN110830562A
Dynamic load balancing method for request classification processing based on heterogeneous cluster
CN112835698A
Heterogeneous cluster energy efficiency optimization-oriented load balancing system and method
CN114915631A
Cited By
Heterogeneous BIM model lightweight server intelligent scheduling method and system
CN120653452A