A dynamic load balancing method based on request classification processing of heterogeneous clusters
By using a performance measurement model and a dynamic load balancing method for request classification processing in heterogeneous server clusters, the problems of uneven load and performance degradation are solved, and the efficient utilization of heterogeneous cluster resources and the improvement of response speed are achieved.
Patent Information
- Application Number
- CN202110179041.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing load balancing algorithms cannot obtain cluster performance in detail when dealing with heterogeneous server clusters, resulting in uneven load and performance degradation. Moreover, traditional methods fail to effectively consider server performance differences and request type distinctions, resulting in poor resource utilization.
A dynamic load balancing method based on request classification processing in heterogeneous clusters is proposed. The weight of each node is calculated through the performance measurement model, and classification processing is performed according to the request type (static and dynamic). Static and dynamic load models are designed to optimize cache and Scheduling strategy combines historical and current data for dynamic feedback cycle optimization.
It achieves efficient utilization of heterogeneous cluster resources, improves response speed and resource utilization, avoids excessive local load in the cluster, and ensures load balancing and performance optimization.
Smart Images

Figure CN112835698B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of server load balancing, and in particular relates to a load optimization method based on dynamic scheduling technology for heterogeneous web server cluster requests. Background Art
[0002] Nowadays, Internet communication technology is constantly developing. my country has built the world's largest optical fiber and mobile communication network, with the proportion of optical fiber and 4G exceeding 98%. At the same time, various network applications have also lowered the threshold for Internet use. As of March 2020, the number of Internet users in my country was 904 million. Therefore, the daily active volume of Internet users is also very large, which puts huge pressure on the server. Faced with this problem, many companies choose to solve this problem through cluster technology. Cluster technology is a technology that allows multiple servers to work together and provide services to the outside world in a unified manner. It is transparent to the outside world and is no different from accessing a single server in the eyes of users. Clustering can solve the performance limitation problem of a single server when encountering a large number of requests. Among them, load balancing is the key technology to realize clustering. Load balancing technology is a method of distributing loads among computer clusters, networks, CPUs, disk drives or other resources to achieve the purpose of optimizing resource utilization, maximizing throughput, minimizing response time, and avoiding overload. Load balancing services are usually completed by load balancers based on physical devices or dedicated load balancing software or protocols. The main function is to reasonably distribute a large number of jobs to multiple operation units for execution, which is used to solve the high concurrency and high availability problems in the Internet architecture, thereby improving the overall throughput and response time. Commonly used load balancing servers include hardware load server F5, and soft load Nginx, LVS, etc.
[0003] From an algorithmic perspective, load balancing implementation technologies can be divided into static load balancing and dynamic load balancing.
[0004] The advantage of static load balancing algorithms is that they are simple, but since they do not consider the performance of server nodes and the current load status, they are prone to load imbalance after long-term operation. Representative algorithms include the round-robin algorithm and the consistent hashing algorithm.
[0005] The round-robin algorithm forwards requests to each server one by one in a certain order. If the performance of the cluster servers is the same, the resource utilization rate will also be very high. However, heterogeneous clusters are very common in actual environments, and the performance of servers also changes in real time during operation. In this case, the algorithm is not well balanced and the cluster performance utilization rate is low. The consistent hashing algorithm calculates the virtual hash ring space by designing a hash function, maps the server nodes in the cluster to the ring through the hash function, etc. The key value of the user request is calculated through the hash function, the first server node is found in the hash ring in a clockwise direction, and the request is assigned to the server, as shown in the figure below. This algorithm will cause load skew when there are fewer server nodes.
[0006] Dynamic algorithms can obtain server status in real time or periodically, and adaptively adjust the order of requests to cluster servers, thereby improving cluster performance and resource utilization. Common algorithms include the minimum connection number algorithm and the weighted minimum connection scheduling algorithm. The minimum connection algorithm assigns requests to the server with the least number of connections for processing based on the number of connections on the server. Although the algorithm dynamically obtains the server load, it only focuses on the number of connections and ignores other factors such as the server hardware environment. When the weighted minimum connection algorithm is initialized, it calculates the corresponding weights based on the server hardware performance. During operation, the algorithm will forward requests to the server with the smaller number of current connections and weights. Although this algorithm takes the server hardware environment into consideration, it still only focuses on the number of connections during operation. The reference point factor is single, and if it runs for a long time, the number of connections will be small but the server resource consumption will be high.
[0007] From the above introduction, we can understand the shortcomings of the currently commonly used load balancing algorithms, that is, the static algorithm only tries to hash the tasks at the algorithm level, and the cluster performance cannot be obtained in detail. Although the dynamic algorithm takes cluster nodes into consideration, the measurement standard is single and lacks certain objectivity. There is a possibility of load imbalance and performance degradation in local time.
[0008] In addition, with the popularization of network communication and the rapid increase in the number of users, the iteration cycle of enterprise server hardware has also shortened. Therefore, the problem of performance heterogeneity in server clusters has become increasingly serious. Traditional load balancing strategies do not take into account the performance differences between servers. At present, when performing load balancing, mainstream load balancing methods only balance tasks based on written load algorithms or use the number of connections as an evaluation criterion, and do not take into account the heterogeneity of servers. Therefore, these load balancing strategies cannot exert the overall performance of the cluster in this scenario.
[0009] The performance heterogeneity in the cluster is mainly reflected in the following aspects:
[0010] (1) There are differences in the performance of the servers themselves, such as CPU, memory, and I / O performance, which leads to differences in the load-bearing capacity of different servers.
[0011] (2) The performance of a server may vary at different times. Even if the performance indicators of the server hardware can be evaluated, if the network conditions change or other applications in the system occupy the CPU or memory resources, the same server may exhibit different performance characteristics at different time points.
[0012] (3) The server may be built on a cloud platform, that is, the server itself can be a virtual machine. In the era of cloud computing, many server functions have been migrated to the cloud. Different cloud platforms generally use elastic mechanisms for virtual machine resources, so it is also difficult to determine the performance of a virtual machine.
[0013] On the other hand, in normal user requests, most of the load borne by the server is the sum of the loads generated when providing static resources and dynamic resources to users, that is,
[0014] Load=Load s +Load d
[0015] Dynamic resources and static resources are very different in data structure and storage, and the business processing of related resource requests is also very different. Due to their different request processing characteristics, if they are not treated differently, the performance and resource utilization of the backend cluster will not reach the optimal state.
[0016] Logically, http requests are divided into static requests and dynamic requests. Static requests obtain static resources, such as images, js, css, etc.; dynamic requests obtain dynamic resources, such as metadata, parameter calculation results, etc. The following two figures are timing diagrams of a single node and a heterogeneous cluster processing user requests over a period of time without distinguishing between dynamic and static requests. The yellow solid line indicates the time consumed to process dynamic requests, and the green solid line indicates the time consumed to obtain static resources. Figure 1 For example, the server receives Xd dynamic requests and Xs static requests at time t1, and receives X'd dynamic requests and X's static requests at time t2.
[0017] The response time is different because the logical processing for dynamic and static requests is different. The response time for dynamic requests is often related to factors such as business logic and the amount of requested data, while the response time for static requests is often related to factors such as the size of static resources and storage location (memory, external storage). If various requests are not classified and considered, it is easy to cause the problem of excessive local load in the cluster, affecting cluster performance.
[0018] The server's load level at any time is the accumulation of newly received tasks and previously unprocessed tasks. Static resource access is random, and the size of resource files and the amount of calculation of dynamic request processing logic result in different server load processing times. Therefore, the server should distinguish between static and dynamic requests and then calculate the load comprehensively. If the load balancing does not distinguish between static and dynamic requests, it will be difficult to avoid the problem of high local load in the cluster. Figure 2 As shown, when dynamic / static requests are mixed and processed, the entire system does not distinguish between request types. At time t3, the number of requests processed by the centralized server node 1 is much greater than that of the server node n. Summary of the invention
[0019] The present invention proposes a dynamic load balancing method based on request classification processing in a heterogeneous cluster to solve the following problems:
[0020] (1) Traditional static algorithms only try to hash tasks at the algorithm level, and the cluster performance cannot be obtained in detail. Although dynamic algorithms take cluster nodes into consideration, their measurement criteria are single and there are problems of uneven load and performance degradation in local time.
[0021] (2) The performance of each server node in the cluster varies, which results in different servers having different load bearing capabilities. During operation, the performance of the server varies at different times. For example, when the instantaneous concurrent traffic is large, the performance characteristics of the same server vary greatly.
[0022] (3) Static resources are classified and stored, and a request-node mapping table is established to improve the cache hit rate and reduce the static resource response time.
[0023] (4) Dynamic resources and static resources are very different in data structure and storage, and the business processing of related resource requests is also very different. If they are not treated differently, the performance and resource utilization of the backend cluster will not reach the optimal state.
[0024] The technical solution of the present invention to solve the above technical problem includes the following steps: A dynamic load balancing method based on request classification processing of heterogeneous clusters, the method includes the following steps:
[0025] Step 1: Comprehensively consider the factors affecting server performance and propose a performance measurement model.
[0026] Step 2: Calculate the performance ratio of each node in the heterogeneous cluster based on the performance measurement model function, and initialize the load weight of each node before the system runs.
[0027] Step 3: Based on the performance optimization of Steps 1 and 2, a load balancing algorithm model that can adapt to dynamic / static requests is proposed. That is, according to the characteristics of different resource types and different processing methods, the requests are logically divided into dynamic and static types, so that the algorithm model can classify dynamic / static requests during the operation of the system.
[0028] Step 4: In the classification algorithm model proposed in step 3, cache optimization is performed for static type requests.
[0029] Step 5, up to step 4, if the resource information of each node is collected and uploaded frequently, the node's allocatable weight will not change significantly before and after the modification, and the load information is collected and reported in real time, and the cluster performance will also be consumed more; if the interval is too long, it is easy to cause inaccurate allocatable weights, resulting in uneven load. Therefore, a dynamic feedback cycle is designed.
[0030] Preferably, step 1 specifically comprises the following steps:
[0031] Step 1.1: Analyze the usage of server resources for different network applications and find the indicator that best reflects the server's busyness.
[0032] As a preferred solution, the indicators described in step 1.1 include CPU performance, memory performance, disk IO performance, network bandwidth and number of request connections.
[0033] Step 1.2, and use a linear weighting function to integrate these indicators to obtain a performance measurement model for evaluating server nodes.
[0034] Step 1.3: Use the weighted comprehensive method of product average mentioned in fuzzy set theory to measure the current status of the server node, and then modify the performance measurement model in 1.2 to make it comprehensively and objectively describe the impact of each resource on the server measurement results.
[0035] As a preferred solution, the measurement function described in step 1.3 is specifically:
[0036] W=1-(1-λ1C)*(1-λ2M)*(1-λ3D)*(1-λ4B)*(1-λ5Co),
[0037] λ i ≥0, and 0≤(1-λ i X i )≤1.
[0038] Among them, W represents the measurement result of the server node, C, M, D, B, and Co represent the relevant data of CPU, memory, disk I / O, network bandwidth, and number of requested connections respectively. The measurement function can be expressed in various forms according to the needs. For example, if it is regarded as the utilization rate, W represents the load rate of the current server node; if it is regarded as the maximum processing capacity, W represents the maximum load of the current server node. λ1-λ5 represent the influence coefficient of each indicator on the server measurement.
[0039] Preferably, step 2 specifically comprises the following steps:
[0040] Step 2.1: Calculate the overall performance of each indicator in the cluster.
[0041] As the preferred solution, the functional formula of the total performance of each indicator obtained in step 2.1 is as follows:
[0042]
[0043] Among them, P c , P m , P d , P b , P co Represents the entire cluster in terms of CPU, memory, disk I / O, network bandwidth, and total number of cluster connections. i 、m i , d, b i 、c oi They represent the CPU, memory, disk I / O, network bandwidth performance and number of requested connections of the i-th server node respectively.
[0044] Step 2.2: Based on the performance measurement model described in step 1, calculate the actual proportion of the performance of nodes with different performance in the heterogeneous cluster.
[0045] As a preferred solution, the performance weight function described in step 2.2 is specifically:
[0046]
[0047] Because W P (i)∈[0,1], in order to facilitate writing the initial node initial value, multiply it by a coefficient A. Therefore, any node in the heterogeneous cluster can obtain its initial weight before the cluster runs through the above formula.
[0048] As a preferred method, the algorithm model is used to enable the system to classify dynamic / static requests during operation. Therefore, step 3 specifically includes the following steps:
[0049] Step 3.1: Design a static load model based on the characteristics of the processing performed by requesting static resources and the performance measurement model function. The specific model function is:
[0050]
[0051] Among them, W s (i) represents the static load rate of the i-th node in the cluster. They represent the CPU, memory, disk I / O and network bandwidth loads of server node i under static requests in period T. α represents whether the current request hits the cache. If it hits the cache, its value is 0, otherwise it is 1.
[0052] Step 3.2: Design a dynamic load model based on the characteristics of the processing performed by requesting dynamic resources and the performance measurement model function. The specific model function is:
[0053]
[0054] Among them, set W d (i) is the resource load rate under dynamic request. i 、Um i , Ud i ,Ub i , They respectively represent the load of node i in CPU, memory, disk I / O, network bandwidth and number of connections within period T when the system is running.
[0055] Step 3.3: Combine the static model and the dynamic model to comprehensively calculate the actual load rate of any node in the heterogeneous cluster during operation:
[0056] W L (i) = W d (i)+W s (i)
[0057] Step 3.4: Calculate the weight correction parameters of each node during operation according to the load rate:
[0058]
[0059] Step 3.5: The weight function can be dynamically calculated by modifying the parameters in step 3.4. The specific function formula is:
[0060]
[0061] As a preferred method, step 4 - based on the classification algorithm model proposed in step 3, cache optimization is performed for static type requests. Specifically, the following steps are included:
[0062] Step 4.1: Static resource classification.
[0063] Step 4.2: Build static resources and server hash tables.
[0064] When the algorithm is running, since the resource information of each node is frequently collected and uploaded each time, the node's allocatable weight will not change significantly before and after the modification, and the load information is collected and reported in real time, which consumes a lot of cluster performance; and if the interval is too long, it is easy to cause inaccurate allocation of weights, resulting in uneven load. Therefore, a dynamic feedback cycle is designed. Therefore, as a preferred embodiment, step 5 specifically includes the following steps:
[0065] Step 5.1: Run the system based on the above steps and set the recent n response times of the backend server;
[0066] T i =[t i1 , t i1 ,…,t in ]
[0067] Step 5.2: Based on step 5.1, obtain the most recent n response times of the entire cluster;
[0068]
[0069] Step 5.3: Obtain the average response time and variance value of each server node through the matrix.
[0070]
[0071]
[0072] j is the number of response times.
[0073] Step 5.4: Create a dynamic feedback periodic table based on the above steps and stress testing experiments.
[0074] <![CDATA[D i ]]> 0.72 1.74 3.41 5.56 12.37 T(unit:s) 9 7 5 3 1 .
[0075] Compared with the prior art, the present invention has the following obvious advantages:
[0076] Based on the idea of dynamic load balancing, the present invention proposes a load balancing method for request classification processing applicable to heterogeneous clusters. This method can periodically obtain cluster node performance information as server performance changes, and classify requests based on different requested resources, so it is sensitive to dynamic / static resource requests, selects corresponding processing modes for different types of requests, improves response speed, and accurately calculates the global load status of related types.
[0077] Design a request scheduler to accurately evaluate the performance of each node in the heterogeneous cluster in the next cycle through historical cycle data and current cycle data, and balance the requests based on node performance and request type to fully utilize the resources of the heterogeneous cluster.
[0078] While optimizing the traditional load balancing strategy, which is prone to problems such as uneven load and low resource utilization in heterogeneous cluster scenarios, a dynamic load model for mixed dynamic / static requests is established. For requests for static resources, a static load model is constructed based on its resource consumption characteristics to accurately calculate the static load status of the node. At the same time, similar static resources are allocated to the same server and a request-node mapping relationship is established to improve the cache hit rate and response speed. For dynamic resource requests, a periodic performance evaluation model is used to calculate the relevant data after each node is allocated dynamic / static resources, and the load rate of each node in the next cycle is predicted. Finally, the allocation weight of each node is calculated and the dynamic requests are allocated according to this weight, avoiding the use of real-time measurement data. The lag in load allocation and the accumulation of errors lead to errors. By classifying the request type, modeling and processing, and comprehensively calculating the load rate, the problem of excessive local load in the cluster is finally solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings and tables required for use in the embodiments or the description of the prior art. Obviously, the drawings and tables in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and tables can be obtained based on these drawings without creative work.
[0080] Figure 1 To introduce the consistent hashing algorithm with virtual nodes in the static load balancing algorithm;
[0081] Figure 2 This is a timing diagram of the node processing request status when HTTP requests dynamic resources and static resources on a single node;
[0082] Figure 3 This is a timing diagram of the status of each node in the cluster processing requests when HTTP requests dynamic resources and static resources in a heterogeneous cluster;
[0083] Figure 4 This is an algorithm flow chart of the dynamic load balancing method proposed by the present invention;
[0084] Figure 5 This is a diagram of the implementation architecture of the present invention;
[0085] Figure 6 It is a line graph of average response time after applying the present invention as a load balancing solution and comparing it with other solutions, wherein the yellow curve CWA is the line where the present invention is located;
[0086] Figure 7It is a line graph of concurrent number after applying the present invention as a load balancing solution and comparing it with other solutions, wherein the yellow curve CWA is the line where the present invention is located. DETAILED DESCRIPTION
[0087] The present invention is further described in detail below in conjunction with some drawings, specific implementation methods and experimental results.
[0088] like Figure 5 As shown in the implementation framework, in the verification system of the present invention, nginx is used as the algorithm load balancing server, and redis is used as the storage for each node performance index data and node weight data. In addition, a server weight calculation module, a weight modification module, and a request classification scheduling module are designed in the load balancing server, and a data collection module is designed in each server node of the cluster.
[0089] The data collection module periodically collects data from the server and provides analysis data to the weight calculation module. In order to ensure the efficiency, persistence and traceability of data pulling by the data load balancer, the present invention uses redis as a collection device for each server node. The weight calculation module calculates the weight value that should be set for each node in the next cycle based on the algorithm function described above, and the modification module updates the weight. The request classification and scheduling module classifies the requests and schedules the relevant requests to the appropriate server.
[0090] like Figure 4 The algorithm flow chart shows the overall process of the implementation of this algorithm.
[0091] Finally Figure 6 , 7 The figure shows the result of comparing the present invention with the weighted round-robin algorithm (WRR) and an improved dynamic weighted algorithm (DUW) of Zhang Yao through an experiment simulating a multi-user scenario using jmeter, which shows the good effect of the present invention in terms of response time and actual number of connections.
[0092] Implementation method:
[0093] Step 1: Comprehensively consider the factors affecting server performance and propose a performance measurement model.
[0094] Step 1.1: Analyze the usage of server resources for different network applications and find the indicator that best reflects the server's busyness.
[0095] As a preferred solution, the indicators described in step 1.1 include CPU performance, memory performance, disk IO performance, network bandwidth, and number of request connections.
[0096] Step 1.2, and use a linear weighting function to integrate these parameters to obtain a performance measurement model for evaluating server nodes.
[0097] Step 1.3: Use the weighted comprehensive method of product average mentioned in fuzzy set theory to measure the current status of the server node, and then modify the performance measurement model in 1.2 to make it comprehensively and objectively describe the impact of each resource on the server measurement results.
[0098] As a preferred solution, the measurement function described in step 1.3 is specifically:
[0099] W=1-(1-λ1C)*(1-λ2M)*(1-λ3D)*(1-λ4B)*(1-λ5Co),
[0100] λ i ≥0, and 0≤(1-λ i X i )≤1.
[0101] Among them, W represents the measurement result of the server node, C, M, D, B, and Co represent the relevant data of CPU, memory, disk I / O, network bandwidth, and number of requested connections respectively. The measurement function can be expressed in various forms according to the needs. For example, if it is regarded as the utilization rate, W represents the load rate of the current server node; if it is regarded as the maximum processing capacity, W represents the maximum load of the current server node. λ1-λ5 represent the influence coefficient of each indicator on the server measurement.
[0102] Step 2: Calculate the performance ratio of each node in the heterogeneous cluster based on the performance measurement model function, and initialize the load weight of each node before the system runs.
[0103] Step 2.1: Calculate the total performance of each indicator in the cluster. The function of the total performance of each indicator is as follows:
[0104]
[0105] Among them, P c , P m , P d , P b , P co Represents the entire cluster in terms of CPU, memory, disk I / O, network bandwidth, and total number of cluster connections. i 、m i , d, b i 、c oi They represent the CPU, memory, disk I / O, network bandwidth performance and number of requested connections of the i-th server node respectively.
[0106] Step 2.2: Calculate the actual proportion of the performance of nodes with different performance in the heterogeneous cluster based on the performance measurement model described in step 1. Obtain the performance proportion function, specifically:
[0107]
[0108] Because W P (i)∈[0,1], in order to facilitate writing the initial node, the initial value can be multiplied by a coefficient A. Therefore, any node in the heterogeneous cluster can use the above formula to calculate its initial weight before the cluster runs.
[0109] Step 3: Based on the performance optimization of Steps 1 and 2, a load balancing algorithm model that can adapt to dynamic / static requests is proposed. That is, according to the characteristics of different resource types and different processing methods, the requests are logically divided into dynamic and static types, so that the algorithm model can classify dynamic / static requests during the operation of the system.
[0110] Step 3.1: Design a static load model based on the characteristics of the processing performed by requesting static resources and the performance measurement model function. The specific model function is:
[0111]
[0112] Among them, W s (i) represents the static load rate of the i-th node in the cluster. They represent the CPU, memory, disk I / O and network bandwidth loads of server node i under static requests in period T. α represents whether the current request hits the cache. If it hits the cache, its value is 0, otherwise it is 1.
[0113] Step 3.2: Design a dynamic load model based on the characteristics of the processing performed by requesting dynamic resources. The specific model function is:
[0114]
[0115] Among them, set W d (i) is the resource load rate under dynamic request. i 、Um i , Ud i ,Ub i , They respectively represent the load of node i in CPU, memory, disk I / O, network bandwidth and number of connections within period T when the system is running.
[0116] Step 3.3: Combine the static model and the dynamic model to comprehensively calculate the actual load rate of any node in the heterogeneous cluster during operation:
[0117] W L (i) = W d (i)+W s (i)
[0118] Step 3.4: Calculate the weight correction parameters of each node during operation according to the load rate:
[0119]
[0120] Step 3.5: The weight function can be dynamically calculated by modifying the parameters in step 3.4.
[0121] When β=1, the current node i is in the load balancing state with the highest resource utilization.
[0122] When 0<β<1, the resource utilization of node i is low and the load is light, so the weight of request allocation can be appropriately increased.
[0123] When β>1, it means that node i is overloaded and the weight of request allocation needs to be reduced quickly.
[0124] Based on this, a formula for dynamically adjusting the weight of each server node can be obtained.
[0125]
[0126] Step 4: In the classification algorithm model proposed in step 3, cache optimization is performed for static type requests.
[0127] Step 4.1: Static resource classification
[0128] When processing static requests, a hash table of static resources and server nodes is constructed to speed up the load balancer's search for servers that have cached the resources required for the current static request. The key is the type of the size range of the resource required for the current static request, and the value is the latest record of the server where the resource of this type is cached.
[0129] Step 4.2: Build static resources and server hash tables
[0130] Because static resources can be divided into fewer types by size (manually controllable), the memory capacity occupied by the hash table is very small and will not affect the load balancer's request processing
[0131] Table 1 Comparison table of static resources and servers
[0132]
[0133] Step 5, up to step 4, if the resource information of each node is collected and uploaded frequently, the node's allocatable weight will not change significantly before and after the modification, and the load information is collected and reported in real time, and the cluster performance will also be consumed more; if the interval is too long, it is easy to cause inaccurate allocatable weights, resulting in uneven load. Therefore, a dynamic feedback cycle is designed.
[0134] Step 5.1: Run the system based on the above steps and set the response time of the backend server in the recent n times.
[0135] T i =[t i1 , t i1 ,…,t in ]
[0136] Step 5.2: Based on step 5.1, get the response time of the entire cluster for the last n times
[0137]
[0138] Step 5.3: Obtain the average response time and variance value of each server node through the matrix
[0139]
[0140]
[0141] j is the number of response times.
[0142] Step 5.4: According to the above steps and the stress test experiment, a dynamic feedback period table is formulated. The initial value of the feedback period T is set to 10s, and the response time variance D corresponding to the node is calculated. i , according to D i Determine the size of the next feedback cycle T. i The smaller it is, the lower the load on node i is and the more stable the operation is. i The larger it is, the smaller T should be adjusted. The feedback period table is obtained from the stress test experiment.
[0143]
[0144]
[0145] When the variance value of any backend server is lower than 0.72, T remains unchanged. If it increases, T is adjusted according to the above table. Assuming that the minimum value of T is 1, it is considered that the load condition of the cluster has reached a critical state.
[0146] The above embodiments are only exemplary embodiments of the present invention and are not intended to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present invention within the essence and protection scope of the present invention, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present invention.
Claims
1. A dynamic load balancing method based on request classification processing of heterogeneous clusters, characterized by: The method comprises the following steps: Step 1: Comprehensively consider the factors affecting server performance and propose a performance measurement model; Step 2: Calculate the performance ratio of each node in the heterogeneous cluster based on the performance measurement model function, and initialize the load weight of each node before the system runs; Step 3: Based on step 1 and step 2, the performance is optimized and a load balancing algorithm model that can adapt to dynamic / static requests is proposed; in view of the different processing methods of requests of different resource types, the requests are logically divided into dynamic and static types, so that the algorithm model can classify and process dynamic / static requests during the operation of the system; Step 4: In the load balancing algorithm model that can adapt to dynamic / static requests proposed in step 3, cache optimization is performed for static type requests; Step 5. From step 4 to step 4, if the resource information of each node is collected and uploaded frequently, the allocatable weight of the node will not change much before and after the modification, and the load information will be collected and reported in real time, and the cluster performance will also be consumed more; If the interval is too long, the allocable weights will be inaccurate, resulting in uneven load, so a dynamic feedback cycle is designed; Step 1 specifically includes the following steps: Step 1.1, analyzing the usage of server resources for different network applications, and finding out the indicators that best reflect the busyness of the server; the indicators include CPU performance, memory performance, disk IO performance, network bandwidth and number of request connections; Step 1.2, and use a linear weighting function to combine these indicators to obtain a performance measurement model for evaluating server nodes; Step 1.3: Use the weighted comprehensive method of product average mentioned in fuzzy set theory to measure the current status of the server node, and then modify the performance measurement model in 1.2 to make it comprehensively and objectively describe the impact of each resource on the server measurement result; The measurement function described in step 1.3 is specifically: W=1-(1-λ1C)*(1-λ2M)*(1-λ3D)*(1-λ4B)*(1-λ5Co), λ i ≥ 0, and 0 ≤ (1 - λ i X i ) ≤ 1; Among them, W represents the measurement result of the server node, C, M, D, B, Co represent the relevant data of CPU, memory, disk I / O, network bandwidth, and number of request connections respectively; the measurement function is expressed in various forms according to the needs; if it is regarded as the utilization rate, W represents the load rate of the current server node; if it is regarded as the maximum processing capacity, W represents the maximum load of the current server node; λ1-λ5 represent the influence coefficient of each indicator on the server measurement; Step 2 specifically includes the following steps: Step 2.1, calculate the total performance of each indicator in the cluster; The functional formula of the overall performance of each indicator obtained in step 2.1 is as follows: Among them, P c , P m , P d , P b , P co Represents the entire cluster in terms of CPU, memory, disk I / O, network bandwidth, and total number of cluster connections. i 、m i , d, b i , Respectively represent the CPU, memory, disk I / O, network bandwidth performance and number of requested connections of the i-th server node; Step 2.2: Calculate the actual proportion of the performance of nodes with different performance in the heterogeneous cluster based on the performance measurement model described in step 1; The performance weighting function described in step 2.2 is specifically: W P (i)∈[0,1], in order to facilitate writing the initial node initial value, a coefficient A is multiplied; thus, any node in the heterogeneous cluster can use the above formula to calculate its initial weight before the cluster runs.
2. According to claim 1, a dynamic load balancing method based on request classification processing of heterogeneous clusters is characterized by: The algorithm model enables the system to classify dynamic / static requests during operation; therefore, step 3 specifically includes the following steps: Step 3.1: Design a static load model based on the characteristics of the processing performed by requesting static resources and the performance measurement model function. The specific model function is: Among them, W s (i) represents the static load rate of the i-th node in the cluster; They represent the load of CPU, memory, disk I / O and network bandwidth resources of server node i in period T under static request respectively; α represents whether the current request hits the cache. If it hits the cache, its value is 0, otherwise it is 1; Step 3.2: Design a dynamic load model based on the characteristics of the processing performed by requesting dynamic resources and the performance measurement model function. The specific model function is: Among them, set W d (i) is the resource load rate under dynamic requests; They represent the load of CPU, memory, disk I / O, network bandwidth and number of connections of node i in period T when the system is running; Step 3.3: Combine the static model and the dynamic model to comprehensively calculate the actual load rate of any node in the heterogeneous cluster during operation: IN L (i)=In d (i)+In s (and) Step 3.4: Calculate the weight correction parameters of each node during operation according to the load rate: Step 3.5: The weight function can be dynamically calculated by modifying the parameters in step 3.
4. The specific function formula is:
3. The dynamic load balancing method based on request classification processing of heterogeneous clusters according to claim 1 is characterized in that: Step 4: Based on the classification algorithm model proposed in step 3, cache optimization is performed for static type requests; specifically, the following steps are included: Step 4.1, static resource classification; Step 4.2: Build static resources and server hash tables.
4. The dynamic load balancing method based on request classification processing of heterogeneous clusters according to claim 1 is characterized in that: Step 5 specifically includes the following steps: Step 5.1: Run the system based on the above steps and set the recent n response times of the backend server; T i =[t i1 ,t i1 ,…,t in ] Step 5.2: Based on step 5.1, obtain the most recent n response times of the entire cluster; Step 5.3, obtain the average response time and variance value of each server node through the matrix; j is the number of response times; Step 5.4: Create a dynamic feedback cycle based on the above steps and stress testing experiments.
Citation Information
Patent Citations
Load balancing method and system of WEB server cluster
CN107426332A
Network transmission control method and device, computer equipment and storage medium
CN111756646A
Automated load balancing across the distributed system of hybrid storage and compute nodes
US9378067B1
