A load balancing scheduling method and system, electronic equipment and readable storage medium

By obtaining server lease renewal information from the ETCD database, calculating weights using multiple performance metrics, constructing a max heap, and dynamically adjusting server weights, the problem of load imbalance was solved, achieving more efficient load balancing and resource utilization.

CN116107741BActive Publication Date: 2026-02-03CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211734948.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-03
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing load balancing strategies cannot dynamically adjust according to the working status of the server cluster, resulting in load imbalance, wasted resources and potential reduction in overall performance.

Method used

By obtaining lease renewal information of the server cluster from the ETCD database, the weight of the server is calculated using multiple performance indicators such as CPU, memory utilization and IO pressure. A max heap is constructed to select the target server, and the weight of the server is dynamically adjusted to achieve load balancing.

Benefits of technology

It improves the load balancing balance, saves resource consumption, and enhances the overall performance and response speed of the server cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107741B_ABST
    Figure CN116107741B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a load balancing scheduling method and system, electronic equipment and readable storage medium. The method comprises: obtaining lease renewal information of each server in a server cluster from an ETCD database; wherein the lease renewal information of a server comprises values of multiple performance indicators of the server; the lease renewal information of the server is used for lease renewal to the ETCD database; determining the weight of each server according to the values of the multiple performance indicators of each server; wherein the weight of a server represents the number of available resources of the server; determining a target server from the servers according to the weight of each server, the target server being used to respond to requests issued by a client. The purpose is to improve the balance of load balancing and save resource overhead in the process of load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of load balancing technology, and in particular to a load balancing scheduling method, system, electronic device, and readable storage medium. Background Technology

[0002] With the development of computer and internet technologies, more and more service providers face enormous access pressure every day, posing a severe challenge to the normal operation of their systems. To meet the requirements of high concurrency and low latency, server-side systems have adopted server clusters instead of single servers, which has become the mainstream architecture in the industry. Through the collaborative cooperation between server nodes within the cluster, stable services are provided to the outside world. However, this approach also brings new problems. Server clusters may experience load imbalances, resulting in a significant waste of available resources, and in some scenarios, it may even reduce the overall performance of the server cluster.

[0003] The advent of load balancing technology effectively solves the problem of uneven load distribution among nodes in a server cluster. By combining load balancing with a reasonable strategy, the system forwards requests to a specific server node in the cluster, ensuring a balanced load across all nodes, thereby increasing system throughput and reducing request response time. Therefore, researching and exploring superior load balancing scheduling strategies is crucial for achieving higher performance in cluster systems.

[0004] Currently, many mature load balancing scheduling strategies exist, such as those based on round-robin, weight, IP or URL, least connections, and minimum response time. However, these strategies still have certain limitations when applied to backup service scenarios: for example, most current load balancing strategies are static and cannot be dynamically adjusted according to the working status of the server cluster, such as round-robin, weight, and IP scheduling methods; when existing scheduling strategies adjust according to the working status of nodes in the server cluster, the performance metrics for scheduling evaluation are too simplistic, such as the least connections method; and while there has been much research on optimizing load balancing strategies, most algorithms are quite complex and have long response times for client load distribution. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a load balancing scheduling method, system, electronic device, and readable storage medium, aiming to improve the balance of load balancing and save resource overhead in the load balancing process.

[0006] The first aspect of this invention provides a load balancing scheduling method, applied to a load balancing module, comprising:

[0007] Retrieve lease renewal information for each server in the server cluster from the ETCD database; the lease renewal information for each server includes the values ​​of multiple performance indicators for that server; the lease renewal information for each server is used to renew leases in the ETCD database;

[0008] The weight of each server is determined based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server.

[0009] Based on the weights of each server, a target server is determined from the servers, and the target server is used to respond to requests issued by the client.

[0010] Optionally, the method further includes:

[0011] Determine the weighting factors corresponding to each of the multiple performance indicators, which at least include: CPU, memory utilization, and I / O pressure;

[0012] The weight of the i-th server is determined based on the values ​​of multiple performance metrics of the i-th server among the various servers, including:

[0013] The weight of the i-th server is determined based on the CPU utilization of the i-th server at the target time, the memory usage of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weight factors corresponding to CPU, memory usage, and IO pressure, where the target time is any time and i is an integer greater than or equal to 1.

[0014] Optionally, determining the weighting factors corresponding to each of the multiple performance indicators includes:

[0015] Based on the relative importance of each pair of performance indicators among the aforementioned multiple performance indicators, a judgment matrix is ​​constructed, wherein the element a in the judgment matrix is... ij Condition a is met ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix;

[0016] Based on the judgment matrix, calculate the m-th power of the product in the i-th row to obtain the m-dimensional vector in the i-th row;

[0017] The m-dimensional vector in the i-th row is standardized into a weight vector, which is used as the weight factor for the performance index corresponding to the i-th row.

[0018] Optionally, the method further includes:

[0019] A max-heap is constructed based on the weights of the servers. Each node in the max-heap is one of the servers. Each node in the max-heap includes at least two fields: the server's IP address and the server's weight.

[0020] Based on the weights of each server, the target server is determined from the servers, including:

[0021] Whenever a load distribution request is received, the server corresponding to the top node of the constructed max heap is identified as the target server;

[0022] Send the IP address of the target server to the client.

[0023] Optionally, the method further includes:

[0024] Establish monitoring events for a specified server in the ETCD database, where the specified server is any one of the servers;

[0025] When an update to the information of the specified server is detected, the latest values ​​of multiple performance indicators of the specified server are obtained through the fecad-etcd interface;

[0026] The latest weight of the specified server is determined based on the latest values ​​of multiple performance metrics of the specified server.

[0027] The maximum heap constructed is adjusted based on the latest weight of the specified server.

[0028] A second aspect of the present invention provides a load balancing scheduling method applied to an ETCD database, comprising:

[0029] The storage server cluster contains lease renewal information for each server; the lease renewal information for each server includes values ​​of multiple performance metrics for that server; the lease renewal information for each server is used to renew leases with the ETCD database.

[0030] In response to a read request from the load balancing module, the lease renewal information of each server is returned to the load balancing module. The load balancing module then parses the values ​​of multiple performance indicators of each server from the lease renewal information, determines the weight of each server, and then determines a target server from the servers based on the weight of each server. The target server is used to respond to the request issued by the client, and the weight of the server represents the amount of available resources of the server.

[0031] Optionally, the method further includes:

[0032] The system stores the registration information of newly started servers in the server cluster, including the IP address and lease validity period of the newly started servers.

[0033] When the lease of any server in the server cluster expires, the lease renewal information for that server is deleted.

[0034] A third aspect of the present invention provides a load balancing scheduling method, applied to any server in a server cluster, the method comprising:

[0035] Get the values ​​of multiple server performance metrics;

[0036] The system sends lease renewal information to the ETCD database. This lease renewal information includes values ​​for multiple performance metrics of the server. The server's lease renewal information is used to renew the lease with the ETCD database, enabling the ETCD database to respond to the load balancing module's read request by returning the lease renewal information of each server to the load balancing module. The load balancing module then parses the values ​​of multiple performance metrics of each server from the lease renewal information, determines the weight of each server, and, based on the weight of each server, determines a target server from among the servers. The target server is used to respond to requests from clients, and the server's weight represents the amount of available resources on that server.

[0037] Optionally, after obtaining the values ​​of multiple server performance metrics at preset intervals, the method further includes:

[0038] When the values ​​of multiple performance indicators obtained exceed the preset threshold, the latest values ​​of the server's multiple performance indicators are sent to the ETCD database.

[0039] Optionally, obtain values ​​for multiple server performance metrics, including:

[0040] Get the values ​​of multiple server performance metrics at preset intervals;

[0041] The lease renewal information sent to the ETCD database includes the values ​​of multiple performance metrics obtained by the server in the most recent preset period.

[0042] A fourth aspect of the present invention provides a load balancing scheduling system, the system comprising: a load balancing module, wherein the load... The module includes a lease renewal information acquisition module, a server weight determination module, and a target server determination module;

[0043] The lease renewal information acquisition module is used to obtain lease renewal information of each server in the server cluster from the ETCD database; wherein, the lease renewal information of the server includes the values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease in the ETCD database;

[0044] The server weight determination module is used to determine the weight of each server based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server;

[0045] The target server determination module is used to determine a target server from the servers according to the weight of each server, and the target server is used to respond to the request issued by the client.

[0046] Optionally, the system further includes:

[0047] The weighting factor determination module is used to determine the weighting factor corresponding to each of the multiple performance indicators, which at least include: CPU, memory utilization, and IO pressure.

[0048] The server weight determination submodule is used to determine the weight of the i-th server based on the CPU utilization of the i-th server at the target time, the memory usage of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weight factors corresponding to CPU, memory usage, and IO pressure, where the target time is any time and i is an integer greater than or equal to 1.

[0049] Optionally, the weighting factor determination module includes:

[0050] The judgment matrix construction module is used to construct a judgment matrix based on the relative importance between any two performance indicators among the multiple performance indicators, wherein the element a in the judgment matrix is... ij Condition a is met ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix;

[0051] The multidimensional vector determination module is used to calculate the m-th power of the product of the i-th row based on the judgment matrix to obtain the m-dimensional vector of the i-th row.

[0052] The weight factor determination submodule is used to standardize the m-dimensional vector in the i-th row into a weight vector, which serves as the weight factor for the performance index corresponding to the i-th row.

[0053] The fifth aspect of the present invention provides an electronic device, characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0054] Memory, used to store computer programs;

[0055] When a processor executes a program stored in memory, it implements the steps of the load balancing scheduling method described in the first aspect of the present invention.

[0056] The sixth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, is a load balancing scheduling method as described in the first aspect of the present invention.

[0057] The embodiments of the present invention have the following advantages:

[0058] This invention provides a load balancing scheduling method. The load balancing module obtains lease renewal information for each server in a server cluster from an ETCD database. This lease renewal information includes values ​​of multiple performance metrics for each server. Based on these performance metric values, the load balancing module determines the weight of each server. Based on these weights, a target server is selected from the remaining servers, and the target server responds to client requests. This invention adds multiple performance metric values ​​to the lease renewal information. The load balancing module can directly obtain these performance metric values ​​for server weight calculation by parsing the lease renewal information, avoiding additional system overhead and saving resource consumption during the load balancing process. Furthermore, by calculating weights for each server based on the performance metric values ​​and selecting the target server to respond to client requests based on the weight, the load balancing balance is improved, resulting in a better balancing effect. Attached Figure Description

[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0060] Figure 1 This is a flowchart illustrating a load balancing scheduling method according to an embodiment of the present invention;

[0061] Figure 2 This is a backup flowchart illustrating a load balancing scheduling method according to an embodiment of the present invention;

[0062] Figure 3 This is a schematic diagram of a max-heap in a load balancing scheduling method according to an embodiment of the present invention;

[0063] Figure 4 This is a schematic diagram of a load balancing scheduling system according to an embodiment of the present invention. Detailed Implementation

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] In this invention, Figure 1 This is a flowchart illustrating a load balancing scheduling method according to an embodiment of the present invention. (Refer to...) Figure 1 The present invention provides a load balancing scheduling method, applied to a load balancing module, comprising:

[0066] Step S11: Obtain the lease renewal information of each server in the server cluster from the ETCD database; wherein, the lease renewal information of the server includes the values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease in the ETCD database;

[0067] Step S12: Determine the weight of each server based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server;

[0068] Step S13: Determine the target server from the servers according to the weight of each server. The target server is used to respond to the request issued by the client.

[0069] In embodiments of the present invention, the load balancing scheduling method provided by the present invention is particularly applicable to load balancing scheduling during backup services. The main modules involved in the backup service include: a web server, a client, a server, a load balancing module (MDS), an ETCD database, and a storage database. In the backup system, each time a server is started, it registers a piece of information with the ETCD database. This information is used to uniquely identify the started server. The registered information mainly includes the server's IP address and lease details. Then, the load balancing module (MDS) obtains the working status of the backend servers from the ETCD database through the fecad-etcd interface. After the web server issues a backup policy to the MDS, the MDS assigns a server IP address to the specified client according to the load balancing policy. After receiving the server IP address, the client establishes a connection with the server corresponding to that server IP address and completes the corresponding backup task. It should be understood that the load balancing scheduling method provided by the present invention can also be applied to other load balancing scheduling scenarios.

[0070] In embodiments of the present invention, such as Figure 2 As shown, the key modules for load balancing in the backup service include the load balancing module MDS, the server, and the ETCD database. The ETCD database serves as the medium for interaction between the load balancing module and the server used for backup services, playing a crucial role in the overall system load balancing scheduling. ETCD is a reliable distributed key-value storage system. Each node in the server cluster refreshes the key in the ETCD database periodically via a lease agreement using PUT{key=service, value="ip"}. Due to differences in task execution among nodes, the refresh times of different nodes in the ETCD database also differ. The most recently refreshed value, i.e., the node's IP address, can be obtained using etcdctl get. If a node in the server cluster goes offline, the corresponding key will not be refreshed, so etcdctl get will not retrieve the IP address of the offline node, thus ensuring service availability. This avoids obtaining the IP address of an offline server, which could lead to the client sending an offline server and preventing the client from completing the backup operation through that offline server. The server and the ETCD database communicate via the etcdctl interface to perform functions such as registration and renewal. Information about all active servers is stored in the ETCD database. The functional commands that the Server registers with the ETCD database include:

[0071] (1) etcdctl lease grant 60: Creates a lease that expires in 60 seconds;

[0072] (2) etcdctl put --lease=38877f89cfe9153e / testdir / testkey"apple": Inserts a key with a lease into etcd;

[0073] (3) etcdctl lease keep-alive 38877f89cfe9153e: Renew the lease before it expires;

[0074] (4)etcdctl watch / testdir / testkey--rev=0: watch mode to get all historical changes to the key.

[0075] In an embodiment of the invention, when the server sends lease renewal information to the ETCD database, the values ​​of multiple performance indicators of the server are incorporated into the lease renewal information. The load balancing module MDS listens for and obtains the lease renewal information of each server in the ETCD database through the fecad-etcd interface. The load balancing module parses the lease renewal information of each server in the obtained server cluster to obtain the values ​​of multiple performance indicators for each server. For any one of the servers, the load balancing module can calculate and determine the weight of that server based on the values ​​of its multiple performance indicators. This weight represents the amount of available resources of that server; more available resources mean less resource consumption for that server, making it more likely that client requests will be sent to that server. The lease renewal information is used by the user to renew leases with the ETCD database.

[0076] In an embodiment of the present invention, a target server for responding to a client's request is determined from among the servers based on the weight of each server. The IP address of the determined target server is sent to the client so that the client can complete the backup operation through the target server.

[0077] This invention provides a load balancing scheduling method. The load balancing module obtains lease renewal information for each server in a server cluster from an ETCD database. This lease renewal information includes values ​​of multiple performance metrics for each server. Based on these performance metric values, the load balancing module determines the weight of each server. Based on these weights, a target server is selected from the remaining servers, and the target server responds to client requests. This invention adds multiple performance metric values ​​to the lease renewal information. The load balancing module can directly obtain these performance metric values ​​for server weight calculation by parsing the lease renewal information, avoiding additional system overhead and saving resource consumption during the load balancing process. Furthermore, by calculating weights for each server based on the performance metric values ​​and selecting the target server to respond to client requests based on the weight, the load balancing balance is improved, resulting in a better balancing effect.

[0078] In this invention, the method further includes: determining the weighting factors corresponding to each of the plurality of performance indicators, wherein the plurality of performance indicators include at least: CPU, memory utilization, and IO pressure; determining the weight of the i-th server based on the values ​​of the plurality of performance indicators of the i-th server, including: determining the weight of the i-th server based on the CPU utilization of the i-th server at the target time, the memory utilization of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weighting factors corresponding to CPU, memory utilization, and IO pressure, wherein the target time is any time, and i is an integer greater than or equal to 1.

[0079] In embodiments of this invention, the hardware configuration of each server in the server cluster is fixed. Most current load balancing strategies assign weights based on the server's hardware configuration, making it impossible to dynamically adjust the weight parameters of servers in operation. For fixed-weight load balancing strategies, since the available resources of an operating server may already deviate significantly from its corresponding weight, continuing to allocate load according to a fixed weight will not improve the overall system's processing capacity; it may even reduce the average processing capacity of the entire server cluster. Therefore, adjusting the corresponding weights in real-time based on the load of each server in the server cluster is crucial for improving the overall performance of the server cluster. Therefore, this invention proposes a new implementation method for calculating server weights: determining the weight factor corresponding to each of the server's multiple performance indicators. The server's weight is determined based on the weight factors corresponding to each performance indicator and the values ​​of each performance indicator. The multiple performance indicators of the server include at least: CPU, memory utilization, and IO pressure.

[0080] Specifically, the weight of each server is calculated and determined based on the following formula:

[0081]

[0082] Among them, E i Let W1 be the weight of the i-th server, W2 be the weight factor for the server's CPU performance parameter, W3 be the weight factor for the server's memory performance parameter, and C be the weight factor for the server's I / O performance parameter. i / C represents the CPU utilization of the i-th server at the target time, M i / M represents the memory usage of the i-th server at the target time, I i / I represents the IO pressure of the i-th server at the target time; the target time is any time, and i is an integer greater than or equal to 1; the larger the weight index of the server, the more backup tasks can be assigned to the corresponding server.

[0083] In this invention, the calculation of the server's weight is related to the weighting factors of various performance parameters of the server. This invention mainly focuses on the calculation and analysis of three performance indicators (CPU, memory usage, and IO pressure). For other business scenarios, more performance parameters can be added for similar calculations.

[0084] In this invention, determining the weighting factor corresponding to each of the multiple performance indicators includes: constructing a judgment matrix based on the relative importance between each pair of performance indicators, wherein the element a in the judgment matrix... ij Condition a is met ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix; based on the judgment matrix, calculate the m-th power of the product of the i-th row to obtain the m-dimensional vector of the i-th row; normalize the m-dimensional vector of the i-th row into a weight vector, which serves as the weight factor of the performance index corresponding to the i-th row.

[0085] In embodiments of the present invention, for calculating the weighting factors of different performance parameters, the present invention employs a preset algorithm to calculate the weighting factors of each performance parameter.

[0086] Specifically, a judgment matrix is ​​constructed based on the relative importance of each pair of performance indicators among the server's multiple performance metrics. The judgment matrix takes the following form:

[0087]

[0088] Where A represents the judgment matrix.

[0089] Based on the data in Table 1, the values ​​of each element in the judgment matrix are determined, as shown in Table 2. Judgment matrices are created based on the three server performance metrics, as shown in Table 2. The element aij in the judgment matrix satisfies the condition: a ij >0, a ij =1 / a ji a ii =1; where i represents the i-th row of the judgment matrix, corresponding to a type of server performance indicator, such as the CPU performance parameter in the first row of the judgment matrix shown in Table 2; j represents the performance indicator in the j-th column of the judgment matrix, corresponding to a type of server performance indicator, such as the memory performance parameter in the second row of the judgment matrix shown in Table 2.

[0090] In an embodiment of the present invention, based on the constructed judgment matrix, the m-th power of the product in the i-th row of the judgment matrix is ​​calculated to obtain the m-dimensional vector of the i-th row, as shown in the following formula:

[0091]

[0092] in, That is, the m-dimensional vector in the i-th row.

[0093] Then, the m-dimensional vector in the i-th row is standardized to obtain the weight factor corresponding to the performance parameter in the i-th row of the judgment matrix, as shown in the following formula:

[0094]

[0095] Among them, W i That is, the weighting factor of the performance parameter corresponding to the i-th row.

[0096]

[0097]

[0098]

[0099] In this invention, a max-heap is constructed based on the weights of the servers, where each node in the max-heap is one of the servers, and each node in the max-heap includes at least two fields: the server's IP address and the server's weight. The target server is determined from the servers based on their weights, including: whenever a load balancing request is received, identifying the server corresponding to the top node of the constructed max-heap as the target server; and sending the IP address of the target server to the client.

[0100] In an embodiment of the present invention, after calculating the weights of each server, a max-heap is constructed based on the server weights. Each node in the max-heap corresponds to one server, and each node includes at least two fields: the server's IP address and its weight. After constructing the max-heap, whenever a load balancing module sends a load distribution request, the top node of the max-heap is selected as the target server, and the IP address of the target server is sent to the client, enabling the client to perform backup operations through the target server.

[0101] In embodiments of the present invention, such as Figure 3 As shown in the diagram, W1 to W7 represent the weights of the seven server nodes. A higher weight indicates more available resources for the corresponding server, resulting in a higher allocation priority. Furthermore, the nodes in the max-heap satisfy the following conditions: W1≥W2 & W1≥W3; W2≥W4 & W2≥W5; W3≥W6 & W3≥W7.

[0102] When the load balancer MDS receives a backup policy from the web server, it directly obtains the IP address of the top node of the heap and returns it to the client specified in the backup policy. Upon receiving the assigned server IP, the client establishes a connection with that server and completes the backup task. By maintaining a max-heap, server IPs can be quickly assigned to clients, reducing response time for client load balancing.

[0103] In this invention, the method further includes: establishing a monitoring event for a specified server in the ETCD database, wherein the specified server is any one of the servers; when the information of the specified server is updated, obtaining the latest values ​​of multiple performance indicators of the specified server through the fecad-etcd interface; determining the latest weight of the specified server based on the latest values ​​of the multiple performance indicators of the specified server; and adjusting the constructed max heap based on the latest weight of the specified server.

[0104] In an embodiment of the present invention, the load balancing scheduling method further includes a load balancing module establishing monitoring events for a specified server in the ETCD database via e_watch. The specified server is any one of the servers. When an update to the performance metrics data of a specified server is detected, the load balancing module obtains the latest values ​​of multiple performance metrics for that specified server through the fecad-etcd interface. Based on the obtained latest values ​​of these performance metrics, the latest weight of the specified server is recalculated. Since the weight of the specified server has changed, the max-heap previously constructed based on the weights of each server will no longer be accurate; therefore, the constructed max-heap is adjusted based on the latest weight of the specified server.

[0105] Specifically, the load balancing module MDS establishes monitoring events for the key of a specified server in the ETCD database through e_watch. If the information of the key of the specified server is updated, the load balancing module MDS can detect it in time and obtain the latest relevant information of the key of the specified server through the fecad-etcd interface. Then, by parsing the value field corresponding to the key value, the latest performance indicators of the specified server can be obtained.

[0106] In an embodiment of the present invention, after the backup service on the server starts, it first registers lease renewal information with the ETCD database. The lease renewal information includes a key, a value, and a lease agreement. The server refreshes the lease information corresponding to the key to renew the lease within its validity period. The server can periodically obtain its own performance metrics and store them in its memory. These performance metrics are then appended to the corresponding value string when renewing the lease. The ETCD database retains relevant lease and performance metric information for each server in operation.

[0107] This invention provides a load balancing scheduling method that modifies the data structure when servers send lease renewal information to the ETCD database. It transmits server performance metrics, including CPU, memory, and disk I / O, to the ETCD database. The load balancing module (MDS) parses this information when retrieving lease renewal data from the ETCD database to obtain the real-time performance metrics of each server. By using an existing lease renewal information transmission method, the transmission of server performance metrics does not incur significant additional overhead on the entire system. Furthermore, this invention defines a method for calculating the allocation weights of servers. Combined with a preset algorithm, it calculates the weight factor for each parameter. After obtaining the real-time performance metrics of each server, the load balancing module (MDS) can perform a weighted evaluation of server performance. This weight calculation method significantly improves the accuracy and effectiveness of the load balancing allocation strategy. The load balancing module (MDS) maintains a max-heap based on the weight of each server. Each node in the heap represents a server, and the max-heap is sorted according to the weight of each server. When a backup task request arrives, it can directly return the server corresponding to the top node of the heap, reducing the response time for load balancing.

[0108] A second aspect of the present invention provides a load balancing scheduling method applied to an ETCD database, comprising: storing lease renewal information of each server in a server cluster; wherein the lease renewal information of a server includes values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease with the ETCD database; in response to a read request from a load balancing module, returning the lease renewal information of each server to the load balancing module, so that the load balancing module can parse the values ​​of multiple performance indicators of each server from the lease renewal information of each server, determine the weight of each server, and then determine a target server from the servers according to the weight of each server, wherein the target server is used to respond to requests issued by clients, and the weight of the server represents the amount of available resources of the server.

[0109] In embodiments of the present invention, the ETCD database is used to receive and store lease renewal information sent by each server in the server cluster. The lease renewal information of a server includes values ​​of multiple performance metrics for that server; this information is used to renew leases with the ETCD database. Simultaneously, in response to a read request from the load balancing module, the ETCD database returns the lease renewal information of each server to the load balancing module, allowing the module to parse the values ​​of multiple performance metrics for each server from this information. Based on these performance metrics, the module calculates and determines the weight of each server, and then, according to these weights, identifies a target server so that the client can perform backup operations through that target server. The server weight represents the amount of available resources available on that server.

[0110] In this invention, the method further includes: storing the registration information of newly started servers in the server cluster, the registration information including: the IP address and lease validity period of the newly started server; and deleting the lease renewal information of any server in the server cluster when the lease validity period expires.

[0111] In embodiments of the present invention, the ETCD database is also used to store registration information of newly started servers in the server cluster. This registration information includes the IP address and lease validity period of the newly started server. When the lease validity period of any server in the server cluster expires, the lease renewal information of that server is deleted from the ETCD database to prevent the allocation of servers with expired leases that cannot be backed up to clients, thus preventing clients from completing backup tasks.

[0112] A third aspect of the present invention provides a load balancing scheduling method, applied to any server in a server cluster. The method includes: obtaining values ​​of multiple performance indicators of the server; sending lease renewal information to an ETCD database; wherein the lease renewal information of the server includes values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease in the ETCD database, so that the ETCD database responds to a read request from the load balancing module and returns the lease renewal information of each server to the load balancing module, so that the load balancing module can parse the values ​​of multiple performance indicators of each server from the lease renewal information of each server, determine the weight of each server, and then determine a target server from the servers according to the weight of each server. The target server is used to respond to requests issued by clients, and the weight of the server represents the amount of available resources of the server.

[0113] In an embodiment of the present invention, the server obtains the values ​​of multiple performance indicators of itself and combines these values ​​with lease renewal information, sending the lease renewal information together with the lease renewal information to the ETCD database. The server's lease renewal information is used to renew leases with the ETCD database, enabling the ETCD database to respond to read requests from the load balancing module by returning lease renewal information for each server to the load balancing module. The load balancing module then parses the values ​​of multiple performance indicators for each server from the lease renewal information, determines the weight of each server, and, based on the weight of each server, determines the target server from among the servers to respond to requests from clients. The server's weight represents the amount of available resources available to that server.

[0114] In this invention, after obtaining the values ​​of multiple performance indicators of the server at preset intervals, the method further includes: when the obtained values ​​of multiple performance indicators exceed preset thresholds, sending the latest values ​​of the multiple performance indicators of the server to the ETCD database.

[0115] In this invention, obtaining the values ​​of multiple performance indicators of the server includes: obtaining the values ​​of multiple performance indicators of the server at preset intervals; the lease renewal information sent to the ETCD database includes: the values ​​of multiple performance indicators obtained by the server in the most recent preset interval.

[0116] In embodiments of the present invention, since the performance indicators of each server will frequently change when the server cluster is under heavy load during actual operation, and in order to prevent the servers from frequently returning their multiple performance indicator values ​​to the ETCD database, the present invention sets a preset period. The servers periodically retrieve their multiple performance indicator values ​​and send them to the ETCD database at this preset period. Simultaneously, to prevent a sudden change in a server's performance indicator within a short period before the preset period has elapsed, thus preventing ETCD from receiving the latest performance indicator value of the server that has experienced the change and would affect load balancing, the present invention sets a corresponding preset threshold for each performance indicator. When the value of a server's performance indicator exceeds its corresponding preset threshold, the server immediately returns the latest value of that performance indicator to the ETCD database.

[0117] A fourth aspect of the present invention provides a load balancing scheduling system, such as... Figure 4 As shown, the system 400 includes: a load balancing module 401, the load... The module includes a lease renewal information acquisition module 4011, a server weight determination module 4012, and a target server determination module 4013;

[0118] The lease renewal information acquisition module is used to obtain lease renewal information of each server in the server cluster from the ETCD database; wherein, the lease renewal information of the server includes the values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease in the ETCD database;

[0119] The server weight determination module is used to determine the weight of each server based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server;

[0120] The target server determination module is used to determine a target server from the servers according to the weight of each server, and the target server is used to respond to the request issued by the client.

[0121] Optionally, the system further includes:

[0122] The weighting factor determination module is used to determine the weighting factor corresponding to each of the multiple performance indicators, which at least include: CPU, memory utilization, and IO pressure.

[0123] The server weight determination submodule is used to determine the weight of the i-th server based on the CPU utilization of the i-th server at the target time, the memory usage of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weight factors corresponding to CPU, memory usage, and IO pressure, where the target time is any time and i is an integer greater than or equal to 1.

[0124] Optionally, the weighting factor determination module includes:

[0125] The judgment matrix construction module is used to construct a judgment matrix based on the relative importance between any two performance indicators among the multiple performance indicators, wherein the element a in the judgment matrix is... ij Condition a is met ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix;

[0126] The multidimensional vector determination module is used to calculate the m-th power of the product of the i-th row based on the judgment matrix to obtain the m-dimensional vector of the i-th row.

[0127] The weight factor determination submodule is used to standardize the m-dimensional vector in the i-th row into a weight vector, which serves as the weight factor for the performance index corresponding to the i-th row.

[0128] The fifth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the load balancing scheduling method described in the first aspect of the present invention.

[0129] A sixth aspect of the present invention provides a readable storage medium storing a program that, when executed by a processor, implements the steps of a load balancing scheduling method described in the first aspect of the present invention.

[0130] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0131] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0132] The above provides a detailed description of the load balancing scheduling method, system, electronic device, and readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A load balancing scheduling method, characterized in that, Applications in load balancing modules include: Retrieve lease renewal information for each server in the server cluster from the ETCD database; the lease renewal information for each server includes the values ​​of multiple performance indicators for that server; the lease renewal information for each server is used to renew leases in the ETCD database; The weight of each server is determined based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server. Based on the weights of each server, a target server is determined from the servers, and the target server is used to respond to requests issued by the client. A max-heap is constructed based on the weights of the servers. Each node in the max-heap is one of the servers. Each node in the max-heap includes at least two fields: the server's IP address and the server's weight. The step of determining the target server from the servers according to the weight of each server includes: whenever a load allocation request is received, determining the server corresponding to the top node of the constructed max heap as the target server; Send the IP address of the target server to the client.

2. The load balancing scheduling method according to claim 1, characterized in that, The method further includes: Determine the weighting factors corresponding to each of the multiple performance indicators, which at least include: CPU, memory utilization, and I / O pressure; The weight of the i-th server is determined based on the values ​​of multiple performance metrics of the i-th server among the various servers, including: The weight of the i-th server is determined based on the CPU utilization of the i-th server at the target time, the memory usage of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weight factors corresponding to CPU, memory usage, and IO pressure, where the target time is any time and i is an integer greater than or equal to 1.

3. The load balancing scheduling method according to claim 2, characterized in that, Determining the weighting factors for each of the aforementioned performance metrics includes: Based on the relative importance of each pair of performance indicators among the aforementioned multiple performance indicators, a judgment matrix is ​​constructed, wherein the element a in the judgment matrix is... ij Condition a is satisfied ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix; Based on the judgment matrix, calculate the m-th power of the product in the i-th row to obtain the m-dimensional vector in the i-th row; The m-dimensional vector in the i-th row is standardized into a weight vector, which is used as the weight factor for the performance index corresponding to the i-th row.

4. The load balancing scheduling method according to claim 1, characterized in that, The method further includes: Establish monitoring events for a specified server in the ETCD database, where the specified server is any one of the servers; When an update to the information of the specified server is detected, the latest values ​​of multiple performance indicators of the specified server are obtained through the fecad-etcd interface. The latest weight of the specified server is determined based on the latest values ​​of multiple performance metrics of the specified server. The maximum heap constructed is adjusted based on the latest weight of the specified server.

5. A load balancing scheduling method, characterized in that, Applied to the ETCD database, including: The storage server cluster contains lease renewal information for each server; the lease renewal information for each server includes values ​​of multiple performance metrics for that server; the lease renewal information for each server is used to renew leases with the ETCD database. In response to a read request from the load balancing module, the lease renewal information of each server is returned to the load balancing module so that the load balancing module can parse the values ​​of multiple performance indicators of each server from the lease renewal information of each server, determine the weight of each server, and then determine the target server from the servers based on the weight of each server. The target server is used to respond to the request issued by the client, and the weight of the server represents the amount of available resources of the server. A max-heap is constructed based on the weights of the servers. Each node in the max-heap is one of the servers. Each node in the max-heap includes at least two fields: the server's IP address and the server's weight. Based on the weights of each server, the target server is determined from the servers, including: whenever a load allocation request is received, the server corresponding to the top node of the constructed max heap is determined as the target server; Send the IP address of the target server to the client.

6. The load balancing scheduling method according to claim 5, characterized in that, The method further includes: The system stores the registration information of newly started servers in the server cluster, including the IP address and lease validity period of the newly started servers. When the lease of any server in the server cluster expires, the lease renewal information for that server is deleted.

7. A load balancing scheduling method, characterized in that, The method, applied to any server in a server cluster, includes: Obtain the values ​​of multiple server performance metrics; The system sends lease renewal information to the ETCD database. This lease renewal information includes values ​​for multiple performance metrics of the server. The server's lease renewal information is used to renew the lease in the ETCD database, so that the ETCD database, in response to a read request from the load balancing module, returns the lease renewal information of each server to the load balancing module. The load balancing module then parses the values ​​of multiple performance metrics of each server from the lease renewal information, determines the weight of each server, and, based on the weight of each server, determines a target server from among the servers. The target server is used to respond to requests from clients, and the server's weight represents the amount of available resources on that server. A max-heap is constructed based on the weights of the servers. Each node in the max-heap is one of the servers. Each node in the max-heap includes at least two fields: the server's IP address and the server's weight. Based on the weights of each server, the target server is determined from the servers, including: whenever a load allocation request is received, the server corresponding to the top node of the constructed max heap is determined as the target server; Send the IP address of the target server to the client.

8. The load balancing scheduling method according to claim 7, characterized in that, After acquiring the values ​​of multiple server performance metrics at preset intervals, the method further includes: When the values ​​of multiple performance indicators obtained exceed the preset threshold, the latest values ​​of the server's multiple performance indicators are sent to the ETCD database.

9. The load balancing scheduling method according to claim 7, characterized in that, Obtain values ​​for multiple server performance metrics, including: Get the values ​​of multiple server performance metrics at preset intervals; The lease renewal information sent to the ETCD database includes the values ​​of multiple performance metrics obtained by the server in the most recent preset period.

10. A load balancing scheduling system, characterized in that, The system includes a load balancing module, which includes a lease renewal information acquisition module, a server weight determination module, and a target server determination module. The lease renewal information acquisition module is used to obtain lease renewal information of each server in the server cluster from the ETCD database; wherein, the lease renewal information of the server includes the values ​​of multiple performance indicators of the server; the lease renewal information of the server is used to renew the lease in the ETCD database; The server weight determination module is used to determine the weight of each server based on the values ​​of multiple performance indicators of each server; wherein, the weight of a server represents the amount of available resources of that server; The target server determination module is used to determine a target server from the servers according to the weight of each server, and the target server is used to respond to the request sent by the client. A module for constructing a max-heap based on the weights of the servers, wherein each node in the max-heap is one of the servers and each node in the max-heap includes at least two fields: the server's IP address and the server's weight; and determining a target server from the servers based on their weights, including: whenever a load balancing request is received, determining the server corresponding to the top node of the constructed max-heap as the target server; and sending the IP address of the target server to the client.

11. The load balancing scheduling system according to claim 10, characterized in that, The system also includes: The weighting factor determination module is used to determine the weighting factor corresponding to each of the multiple performance indicators, which at least include: CPU, memory utilization, and IO pressure. The server weight determination submodule is used to determine the weight of the i-th server based on the CPU utilization of the i-th server at the target time, the memory usage of the i-th server at the target time, the IO pressure of the i-th server at the target time, and the weight factors corresponding to CPU, memory usage, and IO pressure, where the target time is any time and i is an integer greater than or equal to 1.

12. The load balancing scheduling system according to claim 11, characterized in that, The weight factor determination module includes: The judgment matrix construction module is used to construct a judgment matrix based on the relative importance between any two performance indicators among the multiple performance indicators, wherein the element a in the judgment matrix is... ij Condition a is satisfied ij >0, a ij =1 / a ji a ii =1, where i represents the i-th row of the judgment matrix and j represents the j-th column of the judgment matrix; The multidimensional vector determination module is used to calculate the m-th power of the product of the i-th row based on the judgment matrix to obtain the m-dimensional vector of the i-th row. The weight factor determination submodule is used to standardize the m-dimensional vector in the i-th row into a weight vector, which serves as the weight factor for the performance index corresponding to the i-th row.

13. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of a load balancing scheduling method according to any one of claims 1-4.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a load balancing scheduling method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Load balancing scheduling method and device

    CN110602156A

  • Distributed storage system scheduling method based on intelligent heuristic algorithm

    CN110990129A

  • Dynamic weight load balancing system and method based on Nginx

    CN111277648A