Load balancing method and device
By dividing the client into multiple packets, each packet uses a different load balancing strategy, the distributed system resonance problem that is prone to occur in the load balancing process of distributed storage systems is solved, improving system performance and reducing the possibility of resonance.
Patent Information
- Application Number
- CN202311648488.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-28
- Filing Date
- 2023-12-04
- Publication Date
- 2025-02-28
AI Technical Summary
Distributed storage systems are prone to distributed system resonance during load balancing, resulting in excessive pressure on the server side or excessive growth of single node capacity, affecting system performance.
By dividing clients into multiple packets, each using a different load balancing policy, all clients avoid using the same load balancing policy, thereby mitigating distributed system resonance.
It effectively alleviates the resonance of distributed systems, improves the performance of distributed storage systems, and can quickly converge to a stable state, reducing the possibility of system resonance.
Smart Images

Figure CN119536981A_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on August 28, 2023, with application number 202311092342.6 and invention name “A method, device and other equipment for load balancing”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a load balancing method and device. Background Art
[0003] In current distributed storage systems, each client of the distributed storage system uses the same load balancing strategy to determine the data access object, that is, which server processes the data access request to achieve data writing or reading, etc. However, each client usually does not change the weight of different servers in the load balancing strategy for a period of time, which makes the behavior of the clients the same or extremely similar, leading to distributed system resonance, that is, the server of the distributed storage system is overloaded or the capacity of a single node grows too fast, and the input / output (I / O) is intensive, which affects the performance of the distributed storage system. Summary of the invention
[0004] The present application provides a load balancing method and device, thereby solving the distributed system resonance problem in the load balancing process of the distributed storage system.
[0005] In a first aspect, a load balancing method is provided, which is applied to a distributed storage system, wherein the distributed storage system includes multiple clients and multiple servers, wherein the multiple clients are divided into multiple groups, wherein the multiple groups include a first group and a second group, and the load balancing method can be executed by a first client in the first group and a second client in the second group. The load balancing method includes: a first client receives a first data write request, wherein the first data write request includes first data to be written. Then, the first client determines a first partition for processing the data write request according to a load balancing strategy of the group to which it belongs, namely, the first group. Finally, the first client sends the first data to be written to the first server included in the first partition, so that the first server writes the first data to be written to the memory. Similarly, the second client receives the first data write request, and determines a second partition for processing the data write request according to the load balancing strategy of the second group, and sends the second data to be written to the second server included in the second partition, so that the second server writes the second data to be written to the memory.
[0006] In the traditional storage load balancing process, each client uses a load balancing strategy to determine the partition corresponding to the data write request it receives, but each client usually uses the same load balancing strategy, which will make the behaviors of different clients the same or similar, causing the resonance of the distributed system and leading to problems such as excessive pressure on the server or too fast growth of the capacity of a single node, and intensive input / output. Based on the above-mentioned load balancing method provided by the present application, the client determines the partition for processing data write requests according to the load balancing strategy of the group to which it belongs, and uses the group as the granularity of distinguishing the load balancing strategy. Clients in different groups use load balancing strategies that are not configured for the group to determine the partition for processing data write requests, avoiding all clients in the distributed storage system from using the same load balancing strategy, alleviating the resonance of the distributed system, and improving the performance of the distributed storage system. At the same time, compared with the different load balancing states of each client, the load balancing with group as the granularity in the distributed storage system can quickly converge to a stable state, and can also reduce the possibility of distributed system resonance, thereby improving the performance of the distributed storage system.
[0007] As a possible implementation, the first client determines the first partition for processing the first data write request based on the load balancing parameters of the first group and the load balancing strategy of the first group; the second client determines the second partition for processing the second data write request based on the load balancing parameters of the second group and the load balancing strategy of the second group. In this way, while different groups are configured with different load balancing strategies, the load balancing parameters used by clients in different groups are also different, avoiding the behavior convergence of different clients, so as to further alleviate the resonance of the distributed system.
[0008] As a possible implementation manner, the load balancing strategy and load balancing parameters of the first group are configured by the parameter adjustment node, and the parameter adjustment node sends the load balancing strategy and load balancing parameters of the corresponding group to clients of different groups respectively.
[0009] Optionally, the first client receives the load balancing strategy and load balancing algorithm parameters of the first group sent by the parameter adjustment node, and the second client receives the load balancing strategy and load balancing algorithm parameters of the second group sent by the parameter adjustment node. In this way, the clients are divided into multiple groups, and the parameter adjustment node determines the load balancing strategy and load balancing algorithm parameters corresponding to each group based on the group granularity. When the business behavior or user behavior changes significantly during the operation of the distributed storage system, the parameter adjustment node determines the corresponding load balancing strategy and load balancing algorithm parameters for different groups, and can determine the load balancing strategy and load balancing algorithm parameters applicable to multiple clients in a group in a relatively short time, so that the load balancing of the distributed storage system converges quickly to a stable state, thereby further reducing the possibility of distributed system resonance.
[0010] As a possible implementation, the load balancing strategy includes a single sub-strategy or a combination of strategies. The sub-strategies include capacity affinity strategy, capacity differential strategy, server affinity strategy, flexible load strategy and default strategy.
[0011] Optionally, the strategy combination includes multiple serial or parallel sub-strategies. In this way, the load balancing strategy corresponding to the group can be a single sub-strategy or multiple serial or parallel sub-strategies, so that there are differences between the load balancing strategies used by different groups, thereby further avoiding the behavior convergence of clients in different groups due to using the same load balancing strategy, so as to further alleviate the resonance of the distributed system.
[0012] As a possible implementation method, after determining the first partition for processing the data write request, the first client records the partition statistics data, the target client writes data in the first partition, the partition statistics data is used to indicate the number of times the first client writes data in the server included in any of the multiple partitions, and the partition statistics data is sent to the parameter adjustment node, so that the parameter adjustment node determines the load balancing strategy and load balancing parameters of the first group according to the partition statistics data and the system load parameters, and sends the load balancing strategy and load balancing parameters of the first group to the first client. In this way, the number of times multiple clients write data in the server of any partition is used as the data basis for the subsequent parameter adjustment node to determine the load balancing strategy and load balancing parameters applicable to different partitions, which improves the accuracy of the selection of the load balancing strategy and is conducive to improving the overall performance of the distributed storage system.
[0013] In a second aspect, a load balancing method is provided, which is applied to a distributed storage system, wherein the distributed storage system includes multiple clients, multiple servers, and a parameter adjustment node, wherein the multiple clients are divided into multiple groups, wherein the first group in the multiple groups includes the first client, and the second group includes the second client, and the load balancing method can be executed by the parameter adjustment node. The load balancing method includes: the parameter adjustment node receives system load parameters and partition statistics data, wherein the system load parameters are used to indicate the storage load status of the server, and the partition statistics data are used to indicate the number of times that clients of different groups write data in the server of any partition. Then, the parameter adjustment node determines the load balancing strategy and load balancing parameters of the first group, as well as the load balancing strategy and load balancing parameters of the second group based on the system load parameters and the partition statistics data.
[0014] Based on the above load balancing method, when business behavior or user behavior changes significantly during the operation of the distributed storage system, the parameter adjustment node determines the corresponding load balancing strategy and load balancing algorithm parameters for different groups, and can determine the load balancing strategy and load balancing algorithm parameters suitable for multiple clients in a group in a relatively short time, so that the load balancing of the distributed storage system can quickly converge to a stable state, thereby further reducing the possibility of distributed system resonance.
[0015] As a possible implementation, after determining the load balancing strategy and load balancing parameters of the first group, the parameter adjustment node sends the load balancing strategy and load balancing parameters of the first group to the first client included in the first group. After determining the load balancing strategy and load balancing parameters of the second group, the parameter adjustment node sends the load balancing strategy and load balancing parameters of the second group to the second client included in the second group.
[0016] As a possible implementation manner, the parameter adjustment node uses a genetic algorithm to update the load balancing strategy and load balancing parameters of the first group, or uses a genetic algorithm to update the load balancing strategy and load balancing parameters of the second group.
[0017] As a possible implementation method, when the distributed system is started, the parameter adjustment node divides multiple clients into multiple groups, and then sends the initial load balancing strategy to the clients corresponding to the multiple groups respectively. For example, if the multiple groups include the first group and the second group, the initial load balancing strategy is sent to the first group and the second group. In this way, the parameter adjustment node selects an applicable load balancing strategy for the client based on the group granularity, avoiding all clients in the distributed storage system from using the same load balancing strategy, alleviating the resonance of the distributed system, and improving the performance of the distributed storage system.
[0018] Optionally, the above grouping division method can be randomly selected or determined according to tenant requirements. The parameter adjustment node receives the tenant's configuration information, the configuration information includes grouping constraints, and then divides the multiple clients into multiple groups according to the grouping constraints. For example, the grouping constraint includes dividing at least one client of the same tenant into the same group.
[0019] In a third aspect, the present application provides a load balancing device, comprising a first transceiver module, a first processing module, a second transceiver module, and a second processing module. The first transceiver module is used to receive a first data write request, the first data write request includes first data to be written. The first processing module is used to determine a first partition for processing the first data write request according to a load balancing strategy of the first group. The first transceiver module is also used to send the first data to be written to a first server end, so that the first server end writes the first data to be written into a memory. The second transceiver module is used to receive a second data write request, the second data write request includes second data to be written. The second processing module is used to determine a second partition for processing the second data write request according to the load balancing strategy of the second group. The second transceiver module is also used to send the second data to be written to a second server end, so that the second server end writes the second data to be written into a memory.
[0020] As a possible implementation manner, the load balancing device may further include other modules for executing the operation steps of the load balancing method described in the first aspect.
[0021] In a fourth aspect, the present application provides a load balancing device, including a transceiver module and a processing module. The transceiver module is used to receive system load parameters and partition statistics, the system load parameters are used to indicate the storage load status of the server, and the partition statistics are used to indicate the number of times that clients of different groups write data in the server of any partition. The processing module is used to determine the load balancing strategy and load balancing parameters of the first group, and the load balancing strategy and load balancing parameters of the second group according to the system load parameters and partition statistics.
[0022] As a possible implementation manner, the load balancing device may further include other modules for executing the operation steps of the load balancing method described in the second aspect.
[0023] In a fifth aspect, a distributed storage system is provided, comprising a plurality of clients, a plurality of servers and a parameter adjustment node. A first client and a second client among the plurality of clients are used to execute the operation steps of the load balancing method described in the first aspect, and the parameter adjustment node is used to execute the operation steps of the load balancing method described in the second aspect.
[0024] Regarding the technical principles and beneficial effects of the third, fourth and fifth aspects, reference may be made to the relevant descriptions of the first and second aspects, which will not be repeated here.
[0025] In a sixth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory. The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the load balancing method described in any possible implementation of the first aspect above.
[0026] In a seventh aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory. The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the load balancing method described in any possible implementation of the second aspect above.
[0027] In an eighth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer executes the load balancing method described in any possible implementation of the first aspect.
[0028] In a ninth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer executes the load balancing method described in any possible implementation of the second aspect.
[0029] In a tenth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes: a computer program or an instruction; when the computer program or the instruction is executed on a computer, the computer executes the load balancing method described in any possible implementation of the first aspect.
[0030] In an eleventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes: a computer program or an instruction; when the computer program or the instruction is executed on a computer, the computer executes the load balancing method described in any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the hardware architecture of a distributed storage system provided for this application;
[0032] Figure 2 A schematic diagram of a virtual architecture of a distributed storage system provided for this application;
[0033] Figure 3 A schematic diagram of the hierarchical structure of a cloud platform provided for this application;
[0034] Figure 4 A flow chart of a load balancing method provided in this application;
[0035] Figure 5 A flow chart of the steps for configuring a load balancing strategy provided for this application;
[0036] Figure 6 A schematic diagram of the structure of a load balancing device provided in this application;
[0037] Figure 7 A structural diagram of another load balancing device provided by the present application;
[0038] Figure 8 A schematic diagram of the structure of a computing device provided for this application;
[0039] Fig. 9 A schematic diagram of the structure of a computing device cluster provided for this application;
[0040] Fig.10 A schematic diagram of a structure in which computing devices are connected via a network provided in the present application. DETAILED DESCRIPTION
[0041] The load balancing method and device provided in the embodiments of the present application can be applied to distributed storage scenarios such as cloud storage systems. The following is a brief introduction to the technologies that may be involved in the present application.
[0042] (1) Cloud storage
[0043] Cloud storage is a data storage service that stores data on a remote server provided by a third party and accesses and manages it through the Internet. Compared with traditional local storage, cloud storage has the advantages of low cost, high scalability, and easy management and maintenance. Users can choose the appropriate storage capacity and service type according to their needs, and upload, download, backup, archive, share, and other operations on data through the interface or API provided by the cloud storage provider.
[0044] Cloud storage can be divided into two types: public cloud storage and private cloud storage. Public cloud storage is a shared storage service provided by a third-party cloud storage provider. Users can choose different storage capacities and service levels according to their needs and pay by usage. Private cloud storage refers to a storage system established and operated by the enterprise itself. It can be used within the enterprise or provide cloud storage services to the outside world.
[0045] (2) Distributed Storage System
[0046] A distributed storage system is a system that stores data in multiple independent storage nodes. Traditional network storage systems use centralized storage arrays to store all data. The performance of the storage array is not only the bottleneck of system performance, but also the focus of reliability and security. It cannot meet the needs of large-scale storage applications. Distributed network storage systems use a scalable system structure and use multiple storage nodes to share the storage load. It not only improves the reliability, availability and access efficiency of the system, but also makes it easy to expand. Distributed storage systems can be used as the basic storage architecture. For example, distributed storage systems can be used as the basic storage architecture of cloud storage.
[0047] (3) Load Balancing
[0048] Load balancing refers to the balanced distribution of work load to multiple servers to improve the overall performance and reliability of the system composed of multiple servers. For distributed storage systems such as cloud storage, load balancing refers to the even distribution of network traffic (such as client data write requests) to the servers responsible for data storage (also known as service ends or storage nodes) to ensure the rational use of server resources and service stability, thereby improving the overall performance and reliability of the system.
[0049] The present application provides a load balancing method, specifically a load balancing method of "clients in different groups adopt different load balancing strategies". Multiple clients in a distributed storage system are divided into multiple groups, each group includes different clients, and the client of the first group in the multiple groups receives a data write request, and determines the partition of the data write request according to the load balancing strategy of the first group. The data write request includes data to be written. Then, the client of the first group sends the data to be written to the target server corresponding to the partition, so that the target server writes the data to be written into the storage.
[0050] Based on the above load balancing method, multiple clients in the distributed storage system are divided into different groups. Clients in different groups use the load balancing strategy of their respective groups to determine the partition of data write requests. Compared with each client using the same load balancing strategy, which is easy to cause distributed system resonance, the probability of distributed storage system resonance is reduced, and the performance of the distributed storage system is improved.
[0051] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0052] Figure 1 This is a schematic diagram of the architecture of a distributed storage system provided in this application. Figure 1As shown, the distributed storage system 100 includes a computing server cluster 110, a storage server cluster 120, a management server cluster 130, a network device cluster 140 and a user terminal 150. The computing server cluster 110, the storage server cluster 120 and the management server cluster 130 communicate with the user terminal 150 through the network device cluster 140 respectively.
[0053] The computing server cluster 110 includes one or more computing servers ( Figure 1 Two computing servers, namely computing server 111 and computing server 112, are shown in FIG. 1 , but are not limited to two computing servers).
[0054] The computing server is a computing resource in the distributed storage system 100, such as a server, a desktop computer, etc., which is used to generate and allocate computing resources according to user needs based on virtualization technology. At the hardware level, the computing server is equipped with a processor and a memory ( Figure 1 The computing function of the computing server is realized by the processor running the program in the memory. The computing server can also read / write data in each storage server in the storage server cluster 120 according to user needs.
[0055] The storage server cluster 120 includes one or more storage servers ( Figure 1 Two storage servers, storage server 121 and storage server 122, are shown in FIG. 1 , but are not limited to two storage servers).
[0056] The storage server is a storage resource in the distributed storage system 100, such as a server, desktop computer or storage array controller, hard disk frame, etc., which is used to provide logical disk storage, semi-structured data storage, integrated backup and other services for the cloud virtual machines in the distributed storage system 100. In terms of hardware, the storage server is provided with a network card, a processor and a memory. The processor in the storage server is used to process data from outside the storage server. The network card is used to control the access process of the memory, such as the control of address signals, data signals and various command signals, so that the storage server can provide the memory as a storage resource to the user. The memory is used to store data and may include memory and / or hard disk. Memory refers to an internal memory that directly exchanges data with the processor. The memory can read and write data quickly at any time and serve as a temporary data storage for the operating system or other running programs. Unlike memory, the hard disk reads and writes data slower than memory and is usually used to store data persistently.
[0057] The management server cluster 130 includes one or more management servers ( Figure 1 Two management servers, namely, management server 131 and management server 132, are shown in FIG. 1 , but are not limited to two management servers).
[0058] The management server is used to manage all computing services, shared storage, and networks of the entire distributed storage system 100, and provide users or administrators with an application program interface (API) for managing the entire node. In the present application, the distributed storage system 100 can provide the program product of the present application to users by providing an accessible application program interface.
[0059] The network device cluster 140 includes one or more switches and routers, such as Figure 1 As shown, in this embodiment, the network device cluster 140 includes a router 141, a switch 142, a switch 143, a switch 144, and a switch 145. Among them, the user terminal 150 is connected to the router 141 through the Internet, and the router 141 is connected to the switch 143 through the switch 142, and the switch 143 is connected to each computing server in the computing server cluster 110. The switch 144 is respectively connected to each computing server in the computing server cluster 110 and each storage server in the storage server cluster 120. The switch 145 is respectively connected to each computing server in the computing server cluster 110, each storage server in the storage server cluster 120, and each management server in the management server cluster 130.
[0060] Optionally, the number and type of switches included in the network device cluster 140 can be adjusted according to the requirements of the distributed storage system 100, and the switches 142, 143, 144, and 145 can be switches with different functions, for example, the switch 142 is a core switch, and the switches 143, 144, and 145 are switches for managing specific network segments. For example, the switch 142 can be a core switch, the switch 143 can be an internal and external switching network segment switch, the switch 144 can be a storage network segment switch, and the switch 145 can be a management network segment switch.
[0061] The user terminal 150 includes one or more user terminals ( Figure 1 Two user terminals, namely user terminal 151 and user terminal 152, are shown in FIG. 1 , but are not limited to two user terminals. The user terminal includes an interface and an application required for accessing the distributed storage system 100.
[0062] It is worth noting that Figure 1 This is only a schematic diagram and should not be construed as limiting the present application. The distributed storage system 100 may also include other devices. Figure 1 Not drawn in.
[0063] The computing servers, storage servers, etc. in the above-mentioned distributed storage system 100 provided in this application may be nodes in a cloud platform. Figure 1 Based on the equipment of the distributed storage system 100 shown, the distributed storage system 100 implements the functions of nodes such as computing nodes and storage nodes based on software as a service (SaaS), platform as a service (PaaS) and infrastructure as a service (IaaS), and provides services (such as computing services, storage services and network services) to the user terminal 150 through the nodes. The node can be a cloud service node (such as a computing node and a storage node, etc.) obtained by virtualizing the resources (such as computing resources and storage resources, etc.) of the distributed storage system 100.
[0064] For example Figure 2 As shown, the computing server cluster in the distributed storage system 100 is virtualized as a client in the cloud platform ( Figure 2 Six clients are shown, namely, client 211, client 212, client 213, client 214, client 215, and client 216, but are not limited to six clients), and the storage server cluster is virtualized into multiple servers in the cloud platform ( Figure 2 , five servers are shown, namely, server 221, server 222, server 223, server 224, and server 225, but are not limited to five servers). The management server cluster is virtualized as a parameter adjustment node in the cloud platform ( Figure 2 One parameter adjustment node 231 is shown in FIG. 2 , but is not limited to one parameter adjustment node).
[0065] As a possible implementation, the distributed storage system 100 may further include a metadata management node, and the management server cluster is virtualized as a metadata management node in the cloud platform ( Figure 2 One metadata management node 241 is shown in the figure, but is not limited to one metadata management node).
[0066] In an embodiment of the present application, multiple clients virtualized by the distributed storage system 100 are divided into multiple groups, such as group 1, group 2, and group 3, and different groups use different load balancing strategies.
[0067] For example, group 1 includes client 211 and client 212, group 2 includes client 213 and client 214, and group 3 includes client 215 and client 216. Among them, client 211 can be called a first client, group 1 can be called a first group, client 213 can be called a second client, and group 2 can be called a second group.
[0068] The storage resources of multiple virtualized servers of the distributed storage system 100 are divided into multiple partitions. Partitions are logical divisions, rather than physical isolation of the hardware infrastructure of the storage resources of the servers, so a partition can be composed of all or part of the storage resources of one server, or all or part of the storage resources of each of the multiple servers.
[0069] The client is used to accept a data write request sent by the user terminal 150, and then determine the partition to process the data write request according to the load balancing strategy of the group to which the client belongs, and then send the data to be written contained in the data write request to the server included in the partition, so that the server writes the data to be written into the storage.
[0070] The server is used to store data, such as storing data to be written sent by the client.
[0071] As a possible implementation manner, the groups of the above-mentioned multiple clients are divided by the parameter adjustment node 231 , and the load balancing strategy used by each group is also determined by the parameter adjustment node 231 .
[0072] Optionally, the parameter adjustment node 231 is further used to receive system load parameters and partition statistics sent by each server, and periodically update the load balancing strategy used by each group according to the system load parameters and partition statistics.
[0073] Optionally, the load balancing parameters required by the server when running the load balancing strategy are sent by the parameter adjustment node 231. For example, when configuring a load balancing strategy of a server, the parameter adjustment node 231 sends the load balancing parameters corresponding to the load balancing strategy to the server. The load balancing parameters may include but are not limited to the CPU utilization, memory utilization, and I / O utilization of the server. The load balancing parameters may also include parameters that the load balancing strategy needs to use for different load balancing strategies.
[0074] Next, combine Figure 3 The hierarchical structure of the cloud platform virtualized by the distributed storage system 100 is described.
[0075] like Figure 3 As shown, the IaaS platform 310 is used to virtualize all infrastructure resources in the distributed storage system 100, and provide virtual resources (e.g., computing resources, network resources, and storage resources) to users in a software-defined manner. The infrastructure resources refer to the resources provided by the computing server cluster 110, the storage server cluster 120, and / or the network device cluster 130 in the distributed storage system 100.
[0076] The PaaS platform 320 is used to implement the runtime environment and application support functions of the distributed storage system 100, so users can apply for computing units within the quota instead of virtual resources to run their own services. Optionally, the computing unit can be a container, and the distributed storage system 100 deploys and runs the user's code by scheduling the container. It should be noted that the number of containers in the PaaS platform 320 can be one or more. Figure 3 Only one container is used as an example.
[0077] As a possible implementation, the distributed storage system 100 can inject one or more components into the container to implement code deployment and operation. Optionally, the resources (computing resources or storage resources) used by multiple components in the same container can belong to the same hardware device (such as a computing server or a storage server) in the distributed storage system 100, or they can belong to different hardware devices.
[0078] The SaaS application 330 is used to provide the user with the application programs deployed by the user in the form of API responses, based on the IaaS platform 310 and the PaaS platform 320, and the application programs and containers of the SaaS application 330 can communicate with each other through a web server.
[0079] It is worth noting that Figure 3 This is only a schematic diagram and should not be construed as limiting the present application. The layered structure of the virtualized cloud platform of the distributed storage system 100 may also include other modules. Figure 3 Not drawn in.
[0080] Next, the load balancing method provided by this embodiment is described in detail with reference to the accompanying drawings.
[0081] The steps of the load balancing method provided in this application are performed by nodes virtualized by the distributed storage system 100, such as a client, a server, a parameter adjustment node, etc. Figure 4 , taking the first client among multiple clients, namely client 211, and server 221, where client 211 belongs to the first group, such as group 1, as an example, the load balancing method provided in an embodiment of the present application is described.
[0082] Step 410: The client 211 receives a first data write request.
[0083] As a possible example, the first data write request is sent by the user terminal to the client 211 in response to a user operation. The first data write request includes first data to be written.
[0084] As a possible implementation, the client 211 may communicate with one or more user terminals (eg Figure 1The client 211 is connected to the user terminal 151 and the user terminal 152 in the client 211, and is used to receive a first data write request from a user terminal connected to the client 211, such as the user terminal 151.
[0085] Step 420: The client 211 determines a first partition for processing a first data write request according to the load balancing strategy of the first group.
[0086] As a possible example, the client 211 determines the first partition for processing the first data write request according to the load balancing parameters of group 1 and the load balancing strategy of group 1.
[0087] As a possible implementation, the load balancing strategy and load balancing parameters of the group 1 to which the client 211 belongs are determined by the parameter adjustment node 231 and sent to the client 211. For specific steps, please refer to Figure 5 Steps 510 to 550 are shown and will not be described in detail here.
[0088] Optionally, the client 211 uses different load balancing strategies and load balancing parameters in different cycles based on the load balancing strategies and load balancing parameters periodically sent by the parameter adjustment node 231. The cycle length of the cycle is flexibly adjusted according to the needs of the distributed storage system 100, such as 5 minutes, 35 minutes, 2 hours, etc.
[0089] Optionally, the client 211 receives the load balancing strategy and load balancing parameters sent by the parameter adjustment node 231 at the beginning of the next cycle or before the beginning of the next cycle, stores the received load balancing strategy and load balancing parameters locally, and calls them in the next cycle.
[0090] Optionally, the client 211 receives the identifiers of the load balancing strategy and load balancing parameters sent by the parameter adjustment node 231 at the beginning of the next cycle or before the beginning of the next cycle, and calls the load balancing strategy and load balancing parameters from the load balancing strategy set based on the identifiers of the load balancing strategy and load balancing parameters in the next cycle. The load balancing strategy set may be stored by a node virtualized by the computing server cluster 110, the storage server cluster 120 and / or the network device cluster 130, and the load balancing strategy set includes all load balancing strategies that may be used by multiple clients.
[0091] For example, after receiving the first data write request, client 211 calls the current cycle's load balancing strategy and load balancing parameters of the group to which client 211 belongs to determine the first partition. The process is expressed by the formula: y = F_n(α), where y represents partition, F_n() represents the load balancing strategy of the current cycle, n is a positive integer, F_n∈F, F represents a load balancing strategy set, and the load balancing strategy set includes all load balancing strategies that may be used by multiple clients virtualized by the distributed storage system 100, and α represents a load balancing parameter.
[0092] Below, taking client 211 and client 212 belonging to group 1, client 213 and client 214 belonging to group 2, and client 215 and client 216 belonging to group 3, the storage resources of multiple servers virtualized by the distributed storage system 100 are divided into partition 1 (for example, including partial storage resources of server 221, server 222, and server 223), partition 2 (for example, including partial storage resources of server 222, server 223, and server 224), and partition 3 (for example, including partial storage resources of server 224 and server 225) as an example, the steps of executing the load balancing strategy after multiple clients virtualized by the distributed system 100 receive data write requests are explained.
[0093] Client 211 or client 212 receives the load balancing strategy 1 and load balancing parameter 1 of the current cycle determined by parameter adjustment node 231 for group 1 before or at the beginning of the current cycle, and locally configures the load balancing strategy 1 and load balancing parameter 1. Client 211 or client 212 receives a data write request in the current cycle, substitutes load balancing parameter 1 into load balancing strategy 1 to calculate the partition corresponding to the data write request, i.e., partition 1. Group 1 can be referred to as the first group, client 211 in the first group can be the first client, the data write request received by the first client can be referred to as the first data write request, and carries the first data to be written, then partition 1 can be referred to as the first partition.
[0094] Client 213 or client 214 receives the load balancing strategy 2 and load balancing parameter 2 of the current cycle determined by parameter adjustment node 231 for group 2 before or at the beginning of the current cycle, and locally configures the load balancing strategy 2 and load balancing parameter 2. Client 213 or client 214 receives a data write request in the current cycle, substitutes load balancing parameter 2 into load balancing strategy 2 to calculate the partition corresponding to the data write request, i.e., partition 2. Group 2 can be referred to as the second group, client 213 in the second group can be the second client, the data write request received by the second client can be referred to as the second data write request, and partition 2 can be referred to as the second partition if it carries the second data to be written.
[0095] Client 215 or client 216 receives the load balancing strategy 3 and load balancing parameter 3 of the current cycle determined by parameter adjustment node 231 for group 3 before or at the beginning of the current cycle, and locally configures the load balancing strategy 3 and load balancing parameter 3. Client 215 or client 216 receives a data write request in the current cycle, and substitutes load balancing parameter 3 into load balancing strategy 3 to calculate the partition corresponding to the data write request, i.e., partition 3.
[0096] Optionally, the partition in this embodiment can be a placement group (PG) in a storage pool. A storage pool is a logical partition for storing objects. Each storage pool contains a certain number of placement groups. The placement group maps objects to an object storage device (OSD). An object storage device matches a storage device (such as a disk) on the server side and is used to perform operations such as storing data, copying data, balancing data, and recovering data.
[0097] Step 430: The client 211 sends the first data to be written to the server included in the first partition.
[0098] As a possible example, the client 211 determines the first server included in the first partition based on the metadata information of the partition, and sends the data to be written to the first server. For example, the client 211 determines the first server included in the first partition, ie, partition 1.
[0099] In other possible embodiments, the client 213 determines the second server included in the second partition, ie, partition 2, and sends the data to be written to the second server, which will not be described in detail herein.
[0100] As a possible implementation method, the client 211 sends a metadata query request containing the identifier of the partition (such as a name) to the metadata management node 241. After receiving the metadata information returned by the metadata management node 241 according to the metadata query request, a write operation instruction is sent to the server included in the partition according to the metadata information of the partition. The write operation instruction includes the data to be written, and the write operation instruction is used to instruct the server included in the partition to write the data to be written into the storage.
[0101] Optionally, the metadata information includes the correspondence between the partition and the server, and the address information of the server, etc. The client 211 determines the server included in the partition or the target server according to the correspondence between the partition and the server, and sends a write operation instruction to the server according to the address information of the server. Wherein, when the partition is a placement group in the storage pool, the server corresponding to the partition can be the server to which one or more object storage device services included in the placement group belong, that is, the number of target servers included or corresponding to the partition is the same as the number of object storage device services included in the placement group. The address information of the server can be the address information of the server to which one or more object storage device services included in the placement group belong.
[0102] Taking the case where the partition corresponding to the data write request calculated by the client 211 using the load balancing strategy 1 is partition 1 as an example, the client 211 sends a metadata query request to the metadata management node 241, and the metadata query request includes the identifier of partition 1. After receiving the metadata information returned by the metadata management node 241, the client 211 sends a write operation instruction to the server according to the address information of one or more servers corresponding to partition 1.
[0103] Step 440: The server writes the first data to be written into the memory.
[0104] As a possible example, the server writes the first data to be written into a local memory belonging to the partition.
[0105] As a possible implementation method, when a server such as a first server receives a write operation instruction, it starts an object storage device service belonging to a partition, i.e., a target placement group, in a locally mounted object storage device service, and the object storage device service writes the first data to be written into a corresponding storage device.
[0106] Based on the above steps 410-440, the client uses the load balancing strategy of the group to which it belongs to determine the partition for processing data write requests, and uses the group as the granularity of the load balancing strategy. Clients in different groups use load balancing strategies configured for different groups to determine the partition for processing data write requests, thereby avoiding all clients in the distributed storage system from using the same load balancing strategy, alleviating the resonance of the distributed system, and improving the performance of the distributed storage system. At the same time, compared with the different load balancing states of each client, the load balancing based on the group granularity in the distributed storage system can quickly converge to a stable state, and can also reduce the possibility of distributed system resonance, thereby improving the performance of the distributed storage system.
[0107] Combination of the above Figure 4The overall process of the load balancing method is described. In the above load balancing method, the client determines the partition for processing the data write request according to the load balancing strategy of the group to which it belongs, and the load balancing strategy of different groups can be determined by the parameter adjustment node 231. Figure 5 The step of determining the load balancing strategy of different groups by the parameter adjustment node 231 in the load balancing method provided in the present application is described in detail. The load balancing strategy configuration step includes the following steps 510 to 550.
[0108] Step 510: The client 211 records the number of times data is written in the server of any partition of the multiple partitions.
[0109] As a possible example, after sending the data to be written to the server included in the partition, the client 211 records the partition statistics.
[0110] As a possible implementation manner, after sending the first data to be written to the first server included in the first partition, the client 211 updates the partition statistical data with the number of times the first data to be written is sent to the first partition.
[0111] Optionally, the client 211 records the partition statistics in the form of character identifiers, tables, etc. Taking the table form as an example, the table of partition statistics may include two rows and two columns, different rows are used to indicate the record items that the client 211 sends the data to be written to different partitions, and the two columns are used to indicate the partition and the number of times the data is written, respectively.
[0112] For example, the storage resources of multiple servers are divided into partition 1 and partition 2. After the client 211 sends the data 1 to be written to the server included in partition 1, the value of the number of times the data is written corresponding to partition 1 in the table is increased by 1. For another example, after the client 211 sends the data 2 to be written to the server included in partition 2, the value of the number of times the data is written corresponding to partition 2 in the table is increased by 1.
[0113] Step 520 : The client 211 sends partition statistics to the parameter adjustment node 231 .
[0114] As a possible example, the client 211 periodically sends partition statistics to the parameter adjustment node 231 .
[0115] As a possible implementation method, the client 211 sends partition statistics to the parameter adjustment node 231 at the end of the current cycle, so that the parameter adjustment node 231 determines the load balancing strategy for different groups in the next cycle based on the partition statistics of multiple clients in the current cycle.
[0116] Optionally, the client 211 sends partition statistics to the parameter adjustment node 231 through the metadata management node 241 .
[0117] In the above step 520, the present application uses the client 211 sending partition statistical data for exemplary explanation, and does not limit the objects that send partition statistical data to the parameter adjustment node 231. For example, the client 212, the client 213, the client 214, the client 215 and the client 216 can all send partition statistical data to the parameter adjustment node 231.
[0118] Step 530 : The server 221 sends the system load parameter to the parameter adjustment node 231 .
[0119] As a possible example, the server 221 periodically sends the system load parameter to the parameter adjustment node 231 .
[0120] As a possible implementation, the server 221 sends the system load parameters to the parameter adjustment node 231 at the end of the current cycle, so that the parameter adjustment node 231 determines the load balancing strategy for different groups in the next cycle according to the system load parameters of multiple servers in the current cycle.
[0121] Optionally, the client 211 sends the system load parameter to the parameter adjustment node 231 through the metadata management node 241 .
[0122] Optionally, the system load parameter is used to indicate the storage load status of the server. For example, the system load parameter includes CPU utilization, memory utilization, and I / O utilization of the server.
[0123] In the above step 530, the server 221 sends the system load parameters for exemplary explanation. The object sending the system load parameters to the parameter adjustment node 231 is not limited. For example, the server 222, the server 223, the server 224 and the server 225 can all send partition statistics to the parameter adjustment node 231.
[0124] Step 540: The parameter adjustment node 231 determines the load balancing strategy and load balancing parameters of the first group according to the system load parameters and the partition statistical data.
[0125] As a possible example, the parameter adjustment node 231 periodically determines the load balancing strategy and load balancing parameters of the first group according to the system load parameters and partition statistical data.
[0126] As a possible implementation method, the parameter adjustment node 231 determines the impact of writing data to each partition on the storage load status of the server in different partitions based on the partition statistical data and system load parameters, and then filters out the load balancing strategy suitable for each group based on the impact result, and discards the inapplicable load balancing strategy.
[0127] For example, in the previous cycle, parameter adjustment node 231 determined that the number of times client 211 and client 212 wrote data in partition 1 was 12, and the memory utilization of partition 1 was 68% based on the partition statistics data of client 211 and client 212 and the system load parameters. In the current cycle, parameter adjustment node 231 determined that the number of times client 211 and client 212 wrote data in partition 1 was 18, and the memory utilization of partition 1 was 52%. It is determined that the load balancing strategy 1 of group 1 to which client 211 and client 212 belong has a negative impact on the storage load status of partition 1, and the load balancing strategy 1 is discarded.
[0128] For example, in the previous cycle, parameter adjustment node 231 determined that the number of times client 213 and client 214 wrote data in partition 2 was 19, and the memory utilization rate of partition 1 was 71% based on the partition statistics data of client 213 and client 214 and the system load parameters. It is then determined that load balancing strategy 2 of group 2 to which client 213 and client 214 belong may be applicable to group 1.
[0129] As a possible implementation, the parameter adjustment node 231 uses a genetic algorithm to adjust the load balancing strategy. The genetic algorithm can use various parameters in the system load parameters. The specific content of the genetic algorithm can refer to the application of genetic algorithms in load balancing in the prior art, which will not be repeated here.
[0130] After the above step 540 , the load balancing policy configuration step may further include the following step 550 .
[0131] Step 550: The parameter adjustment node 231 sends a load balancing policy and load balancing parameters to the first group.
[0132] As a possible example, the parameter adjustment node 231 sends the load balancing policy and the load balancing parameters to the clients included in the first group. For example, the first group includes the clients 211 and 212, and the parameter adjustment node 231 sends the load balancing policy and the load balancing parameters to the clients 211 and 212.
[0133] As a possible implementation manner, the parameter adjustment node 231 sends the load balancing policy and the load balancing parameters to the clients included in the first group through the metadata management node 241 .
[0134] Optionally, the load balancing strategy includes a single sub-strategy or a strategy combination. Among them, the single sub-strategy includes a capacity affinity strategy, a capacity differential strategy, a server affinity strategy, a flexible load strategy and a default strategy. The default strategy can be a load balancing strategy pre-configured based on prior experience. The strategy combination includes multiple serial or parallel sub-strategies. For example, the serial strategy combination of the capacity affinity strategy and the capacity differential strategy is to first execute the capacity affinity strategy, then execute the capacity differential strategy, filter the strategy results according to preset conditions, and select the strategy results that meet multiple conditions. For another example, the parallel strategy combination of the capacity affinity strategy and the capacity differential strategy is to respectively execute the capacity affinity strategy and the capacity differential strategy, and select the strategy results that meet a preset condition. In this way, in the load balancing strategy set, through the combination of strategies and the adjustment of related strategies, the occurrence of distributed resonance can be slowed down at the strategy granularity.
[0135] In the present application, the parameter adjustment node 231 divides multiple clients into multiple groups when the distributed storage system 100 is started for the first time, and sends an initial load balancing strategy and load balancing parameters to each client.
[0136] Optionally, when the distributed storage system 100 is first started, the parameter adjustment node 231 divides the multiple clients into multiple groups, for example, divides the clients 211 and 212 into group 1, and sends the initial load balancing strategy and load balancing parameters to the clients 211 and 212 included in group 1. For another example, divide the clients 213 and 214 into group 2, and send the initial load balancing strategy and load balancing parameters to the clients 213 and 214 included in group 2.
[0137] The present application does not limit the manner in which the parameter adjustment node 231 divides the multiple clients into multiple groups. The parameter adjustment node 231 may randomly divide the multiple clients into multiple groups, or may receive the configuration information of the tenant, and divide the multiple clients into multiple groups according to the grouping constraints in the configuration information. For example, the parameter adjustment node 231 receives the configuration information of the tenant, and the grouping constraints in the configuration information indicate that the client 211 and the client 212 are clients of the same tenant. The parameter adjustment node 231 divides the clients of the same tenant into the same group, that is, divides the client 211 and the client 212 into group 1.
[0138] In a possible embodiment of the present application, the content contained in the grouping constraint can be flexibly adjusted according to the needs. For example, the grouping constraint can indicate that the tenant expects to divide clients with similar delays into one group, or divide clients with similar performance into one group, etc. For another example, the grouping constraint can indicate that the tenant divides the specified clients into one group, etc.
[0139] The initial load balancing strategy may be a random single sub-strategy or a strategy combination.
[0140] In a possible embodiment of the present application, the parameter adjustment node 231 can determine whether to execute step 550 according to different application scenarios to adjust the load balancing strategy and load balancing parameters of different groups. For example, in a distributed storage system of a public cloud, the distributed storage system of the public cloud has a huge amount of data, and the location to be stored is selected for each data to be stored based on the load balancing strategy. In the present invention, the load balancing strategy and load balancing parameters of different groups are adjusted in the parameter adjustment node 231 through an improved load balancing strategy to stabilize the system, that is, the underlying storage system is governed by using the massive data on the public cloud based on the data-driven idea. For another example, in a private cloud text storage system scenario, the system scale is small and there are fewer clients. Under the premise of client grouping, the system load parameter reporting time of the server can be actively controlled according to the system load to make the system load balancing more stable.
[0141] Based on the above steps 510-550, the parameter adjustment node 231 can identify the load balancing strategy and load balancing parameters that are beneficial to the stability and status of the distributed storage system 100 in a relatively short period of time after a major change in business behavior or user behavior occurs based on the global partition statistics data and system load parameters of multiple clients and servers, and quickly apply them to the corresponding groups, so that the distributed storage system 100 quickly converges to a stable state of load balancing.
[0142] In order to cooperate with the above Figure 4 or Figure 5 The present application also provides a load balancing device 600, which can be used to implement the load balancing method shown above. Figure 4 or Figure 5 The client functions in the load balancing method shown in Figure 1. Figure 6 As shown, the load balancing device 600 includes a first transceiver module 610 , a first processing module 620 , a second transceiver module 630 and a second processing module 640 .
[0143] The first transceiver module 610 is configured to receive a first data write request, where the first data write request carries first data to be written. For example, the first transceiver module 610 is configured to execute the following steps: Figure 4 Step 410 is shown.
[0144] The first processing module 620 is configured to determine a first partition for processing a first data write request according to a load balancing strategy of the first group. For example, the first processing module 620 is configured to execute the following steps: Figure 4 Step 420 is shown.
[0145] The first transceiver module 610 is further configured to send the first data to be written to the first server included in the first partition, so that the first server writes the first data to be written into the memory. Figure 4 Step 430 is shown.
[0146] The second transceiver module 630 is used to receive a second data write request, where the second data write request carries second data to be written.
[0147] The second processing module 640 is configured to determine a second partition for processing a second data write request according to the load balancing strategy of the second group.
[0148] The second transceiver module 630 is further used to send the second data to be written to the second server included in the second partition, so that the second server writes the second data to be written into the memory.
[0149] As a possible implementation, the first processing module 620 is further configured to determine a first partition for processing a first data write request according to a load balancing parameter of the first group and a load balancing strategy of the first group. The second processing module 640 is further configured to determine a second partition for processing a second data write request according to a load balancing parameter of the second group and a load balancing strategy of the second group.
[0150] As a possible implementation, the distributed storage system further includes a parameter adjustment node, and the first transceiver module 610 is further used to receive the load balancing strategy and load balancing algorithm parameters of the first group sent by the parameter adjustment node. The second transceiver module 630 is further used to receive the load balancing strategy and load balancing algorithm parameters of the second group sent by the parameter adjustment node.
[0151] As a possible implementation, the load balancing strategy includes a single sub-strategy or a strategy combination, the sub-strategies include a capacity affinity strategy, a capacity differential strategy, a server affinity strategy, a flexible load strategy and a default strategy, and the strategy combination includes multiple serial or parallel sub-strategies.
[0152] As a possible implementation, the first processing module 620 is also used to record partition statistics, which are used to indicate the number of times the target client writes data in a server included in any of the multiple partitions. The first transceiver module 610 is also used to send the partition statistics to the parameter adjustment node, so that the parameter adjustment node determines the load balancing strategy and load balancing parameters of the first group based on the partition statistics and the system load parameters, the system load parameters are used to indicate the storage load status of the server, and receives the load balancing strategy and load balancing parameters of the first group sent by the parameter adjustment node, and receives the load balancing strategy and load balancing parameters of the first group sent by the parameter adjustment node.
[0153] Among them, the first transceiver module 610, the first processing module 620, the second transceiver module 630 and the second processing module 640 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the first transceiver module 610 is introduced below by taking the first transceiver module 610 as an example. Similarly, the implementation of the first processing module 620, the second transceiver module 630 and the second processing module 640 can refer to the implementation of the first transceiver module 610.
[0154] As an example of a software functional unit, the first transceiver module 610 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the first transceiver module 610 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0155] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0156] As an example of a hardware functional unit, the first transceiver module 610 may include at least one computing device, such as a server, etc. Alternatively, the first transceiver module 610 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0157] The multiple computing devices included in the first transceiver module 610 can be distributed in the same region or in different regions. The multiple computing devices included in the first transceiver module 610 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the first transceiver module 610 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0158] It should be noted that, in other embodiments, any one of the first transceiver module 610, the first processing module 620, the second transceiver module 630 and the second processing module 640 can be used to execute any step in the load balancing method, and the steps that the first transceiver module 610, the first processing module 620, the second transceiver module 630 and the second processing module 640 are responsible for implementing can be specified as needed. The first transceiver module 610, the first processing module 620, the second transceiver module 630 and the second processing module 640 respectively implement different steps in the load balancing method to achieve all the functions of the load balancing device 600.
[0159] In order to cooperate with the above Figure 4 or Figure 5 The present application also provides a load balancing device 700, which can be used to implement the load balancing method shown above. Figure 4 or Figure 5 The function of the parameter adjustment node in the load balancing method shown in FIG. Figure 7 As shown, the load balancing device 700 includes:
[0160] The transceiver module 710 is used to receive system load parameters and partition statistics. The system load parameters are used to indicate the storage load status of the server, and the partition statistics are used to indicate the number of times that clients of different groups write data to the server of any partition. Figure 5 Partition statistics and system load parameters of steps 520 and 530 are shown.
[0161] The processing module 720 is used to determine the load balancing strategy and load balancing parameters of the first group and the load balancing strategy and load balancing parameters of the second group in the multiple groups according to the system load parameters and the partition statistical data. For example, the processing module 720 is used to perform the following steps: Figure 5 Step 540 is shown.
[0162] The transceiver module 710 is also used to send the load balancing strategy and load balancing parameters of the first group to the first client, so that after receiving the first data write request, the first client determines the first partition for processing the first data write request according to the load balancing strategy and load balancing parameters of the first group, and sends the first data to be written to the first server included in the first partition. And, send the load balancing strategy and load balancing parameters of the second group to the second client, so that after receiving the second data write request, the second client determines the second partition for processing the second data write request according to the load balancing strategy and load balancing parameters of the second group, and sends the second data to be written to the second server included in the second partition. For example, the transceiver module 710 is used to perform the following steps: Figure 5 Step 550 is shown.
[0163] As a possible implementation manner, the processing module 720 is further configured to update the load balancing strategy and load balancing parameters of the first group by using a genetic algorithm.
[0164] As a possible implementation, the processing module 720 is further used to divide the multiple clients into multiple groups when the distributed storage system is started. The transceiver module 710 is further used to send the initial load balancing strategy to the clients included in the first group and send the initial load balancing strategy to the clients included in the second group.
[0165] As a possible implementation, the transceiver module 710 is further used to receive the configuration information of the tenant, the configuration information including the grouping constraint. The processing module 720 is further used to divide the multiple clients into multiple groups according to the grouping constraint. The grouping constraint includes dividing at least one client of the same tenant into the same group.
[0166] Both the transceiver module 710 and the processing module 720 may be implemented by software or hardware. As an example, the implementation of the transceiver module 710 is described below. Similarly, the implementation of the processing module 720 may refer to the implementation of the transceiver module 710.
[0167] As an example of a software functional unit, the transceiver module 710 may include code running on a computing instance. Among them, the computing instance may be at least one of a physical host (computing device), a virtual machine, a container and other computing devices. Furthermore, the above-mentioned computing device may be one or more. For example, the transceiver module 710 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same AZ or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.
[0168] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same VPC or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway must be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0169] As an example of a hardware functional unit, the transceiver module 710 may include at least one computing device, such as a server, etc. Alternatively, the transceiver module 710 may also be a device implemented using ASIC or PLD, etc. The PLD may be implemented using CPLD, FPGA, GAL or any combination thereof.
[0170] The multiple computing devices included in the transceiver module 710 can be distributed in the same region or in different regions. The multiple computing devices included in the transceiver module 710 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the transceiver module 710 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0171] The present application also provides a computing device 800. Figure 8As shown, the computing device 800 includes: a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate through the bus 802. The computing device 800 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 800.
[0172] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus 802 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 802 may include a path for transmitting information between various components of the computing device 800 (eg, the memory 806, the processor 804, and the communication interface 808).
[0173] The processor 804 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0174] The memory 806 may include a volatile memory, such as a random access memory (RAM). The processor 804 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0175] The memory 806 stores executable program codes, and the processor 804 executes the executable program codes to respectively implement the functions of the modules included in the aforementioned load balancing device 600 or the load balancing device 700, thereby implementing the load balancing method. That is, the memory 806 stores instructions for executing the load balancing method.
[0176] Alternatively, the memory 806 stores executable codes, and the processor 804 executes the executable codes to respectively implement the functions of the aforementioned client or parameter adjustment node, thereby implementing the load balancing method. That is, the memory 806 stores instructions for executing the load balancing method.
[0177] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or communication networks.
[0178] Considering that the load balancing method provided in the present application is applied to the distributed storage system 100, the computing server cluster 110 and the storage server cluster 120 of the distributed storage system 100 and their respective infrastructures usually include multiple computing devices. Therefore, the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0179] like Fig. 9 As shown, the computing device cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the computing device cluster may store the same instructions for executing the load balancing method.
[0180] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store partial instructions for executing the load balancing method. In other words, the combination of one or more computing devices 800 may jointly execute instructions for executing the load balancing method.
[0181] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the load balancing device 600 or the load balancing device 700. That is, the instructions stored in the memory 806 in different computing devices 800 may implement the functions of one or more modules included in the load balancing device 600 or the load balancing device 700.
[0182] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.10 A possible implementation is shown. Fig.10As shown, two computing devices 800A and 800B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the functions of one or more modules in the first transceiver module 610, the first processing module 620, the second transceiver module 630, and the second processing module 640. Fig.10 In the example, the memory 806 in the computing device 800A stores instructions for executing the functions of the first transceiver module 610 and the first processing module 620. Meanwhile, the memory 806 in the computing device 800B stores instructions for executing the functions of one or more modules among the first transceiver module 610, the first processing module 620, the second transceiver module 630 and the second processing module 640. Fig.10 In the example, the memory 806 in the computing device 800B stores instructions for executing the functions of the second transceiver module 630 and the second processing module 640.
[0183] It should be understood that Fig.10 The functions of the computing device 800A shown in FIG. 8 may also be completed by multiple computing devices 800. Similarly, the functions of the computing device 800B may also be completed by multiple computing devices 800.
[0184] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the following steps: Figure 4 or Figure 5 The load balancing method shown in Figure 4 or Figure 5 Steps performed by a client or a parameter adjustment node in the load balancing method shown.
[0185] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to store data such as Figure 4 or Figure 5 The load balancing method shown in Figure 4 or Figure 5 Steps performed by a client or a parameter adjustment node in the load balancing method shown.
[0186] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0187] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0189] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0190] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0191] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0192] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0193] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b and c can be single or multiple.
[0194] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A load balancing method, characterized in that: The method is applied to a distributed storage system, the distributed storage system includes a plurality of clients, the plurality of clients are divided into a plurality of groups, the plurality of groups include a first group and a second group, the first group includes a first client, the second group includes a second client, the distributed storage system also includes a plurality of servers, the method includes: The first client receives a first data write request, where the first data write request carries first data to be written; The first client determines, according to the load balancing strategy of the first group, a first partition for processing the first data write request; The first client sends the first data to be written to the first server included in the first partition, so that the first server writes the first data to be written into the storage; The second client receives a second data write request, where the second data write request carries second data to be written; The second client determines, according to the load balancing policy of the second group, a second partition for processing the second data write request; The second client sends the second data to be written to the second server included in the second partition, so that the second server writes the second data to be written into the memory.
2. The method according to claim 1, characterized in that: The first client determines, according to the load balancing strategy of the first group, a first partition for processing the first data write request, including: The first client determines a first partition for processing the first data write request based on the load balancing parameter of the first group and the load balancing policy of the first group.
3. The method according to claim 1, characterized in that The second client determines, according to the load balancing strategy of the second group, a second partition for processing the second data write request, including: The second client determines a second partition for processing the second data write request based on the load balancing parameter of the second group and the load balancing policy of the second group.
4. The method according to claim 2 or 3, characterized in that: The distributed storage system further includes a parameter adjustment node, and the method further includes: The first client receives the load balancing strategy and load balancing parameters of the first group sent by the parameter adjustment node; The second client receives the load balancing strategy and load balancing parameters of the second group sent by the parameter adjustment node.
5. The method according to any one of claims 1 to 4, characterized in that The load balancing strategy includes a single sub-strategy or a strategy combination, wherein the sub-strategy includes a capacity affinity strategy, a capacity differential strategy, a server affinity strategy, a flexible load strategy and a default strategy, and the strategy combination includes multiple serial or parallel sub-strategies.
6. The method according to any one of claims 1 to 5, characterized in that Before the first client receives a first data write request, wherein the first data write request carries first data to be written, the method includes: The first client records partition statistics, where the partition statistics are used to indicate the number of times the first client writes data in a server included in any of the multiple partitions; The first client sends the partition statistical data to the parameter adjustment node, so that the parameter adjustment node determines the load balancing strategy and load balancing parameters of the first group according to the partition statistical data and system load parameters, wherein the system load parameters are used to indicate the storage load status of the server; The first client receives the load balancing strategy and load balancing parameters of the first group sent by the parameter adjustment node.
7. A load balancing method, characterized in that: The method is applied to a parameter adjustment node of a distributed storage system, the distributed system includes a plurality of clients, the plurality of clients are divided into a plurality of groups, the plurality of groups include a first group and a second group, the distributed storage system also includes a plurality of servers, the method includes: Receiving a system load parameter and partition statistics, wherein the system load parameter is used to indicate a storage load state of the server, and the partition statistics are used to indicate a number of times that clients of different groups write data in a server of any of the multiple partitions; The load balancing strategy and load balancing parameters of the first group and the load balancing strategy and load balancing parameters of the second group are determined according to the system load parameters and the partition statistical data.
8. The method according to claim 7, characterized in that The first group includes a first client, the second group includes a second client, and after determining a load balancing strategy and load balancing parameters of the first group and a load balancing strategy and load balancing parameters of the second group according to the system load parameter and the partition statistical data, the method includes: Sending the load balancing policy and load balancing parameters of the first group to the first client, so that after receiving the first data write request, the first client determines the first partition for processing the first data write request according to the load balancing policy and load balancing parameters of the first group, and sends the first data to be written carried by the first data write request to the first server included in the first partition; The load balancing policy and load balancing parameters of the second group are sent to the second client, so that after receiving the second data write request, the second client determines the second partition for processing the second data write request according to the load balancing policy and load balancing parameters of the second group, and sends the second data to be written carried by the second data write request to the second server included in the second partition.
9. The method according to claim 7 or 8, characterized in that: After sending the load balancing policy and load balancing parameters of the first group to the first client, the method further includes: A genetic algorithm is used to update the load balancing strategy and load balancing parameters of the first group.
10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: When the distributed storage system is started, dividing the multiple clients into multiple groups; Sending an initial load balancing policy to the clients included in the first group; An initial load balancing policy is sent to the clients included in the second group.
11. The method according to claim 10, characterized in that The dividing the multiple clients into multiple groups comprises: receiving configuration information of a tenant, wherein the configuration information includes grouping constraints; The plurality of clients are divided into the plurality of groups according to the group constraint.
12. The method according to claim 11, characterized in that The group constraint includes dividing at least one client of the same tenant into the same group.
13. A load balancing device, characterized in that: include: A first transceiver module, configured to receive a first data write request, wherein the first data write request includes first data to be written; A first processing module, configured to determine a first partition for processing the first data write request according to a load balancing strategy of the first group; The first transceiver module is further used to send the first data to be written to a first server included in the first partition, so that the first server writes the first data to be written into a memory; A second transceiver module, configured to receive a second data write request, wherein the second data write request carries second data to be written; A second processing module, configured to determine a second partition for processing the second data write request according to the load balancing strategy of the second group; The second transceiver module is further used to send the second data to be written to a second server included in the second partition, so that the second server writes the second data to be written into the memory.
14. The device according to claim 13, characterized in that The first processing module is specifically configured to determine a first partition for processing the first data write request based on a load balancing parameter of the first group and a load balancing strategy of the first group.
15. The device according to claim 13, characterized in that The second processing module is specifically configured to determine a second partition for processing the second data write request based on the load balancing parameter of the second group and the load balancing strategy of the second group.
16. The device according to claim 14 or 15, characterized in that The distributed storage system also includes a parameter adjustment node, and the first transceiver module is also used to receive the load balancing strategy and load balancing algorithm parameters of the first group sent by the parameter adjustment node; the second transceiver module is also used to receive the load balancing strategy and load balancing algorithm parameters of the second group sent by the parameter adjustment node.
17. The device according to any one of claims 13 to 16, characterized in that The load balancing strategy includes a single sub-strategy or a strategy combination, wherein the sub-strategy includes a capacity affinity strategy, a capacity differential strategy, a server affinity strategy, a flexible load strategy and a default strategy, and the strategy combination includes multiple serial or parallel sub-strategies.
18. The device according to any one of claims 13 to 17, characterized in that The first processing module is further used to record partition statistics, where the partition statistics are used to indicate the number of times the first client writes data in a server included in any of the multiple partitions; The first transceiver module is further used to send the partition statistical data to the parameter adjustment node, so that the parameter adjustment node determines the load balancing strategy and load balancing parameters of the first group according to the partition statistical data and the system load parameter, wherein the system load parameter is used to indicate the storage load status of the server; The first transceiver module is further configured to receive the load balancing strategy and load balancing parameters of the first group sent by the parameter adjustment node.
19. A load balancing device, characterized in that: include: a transceiver module, configured to receive a system load parameter and partition statistics, wherein the system load parameter is used to indicate a storage load state of the server, and the partition statistics are used to indicate a number of times that clients of different groups write data in a server of any of the multiple partitions; A processing module is used to determine the load balancing strategy and load balancing parameters of the first group and the load balancing strategy and load balancing parameters of the second group according to the system load parameters and the partition statistical data.
20. The device according to claim 19, characterized in that The first group includes a first client, and the second group includes a second client. The transceiver module is further used to send the load balancing policy and load balancing parameters of the first group to the first client, so that after receiving a first data write request, the first client determines the first partition for processing the first data write request according to the load balancing policy and load balancing parameters of the first group, and sends the first data to be written carried by the first data write request to the first server included in the first partition; and sends the load balancing policy and load balancing parameters of the second group to the second client, so that after receiving the second data write request, the second client determines the second partition for processing the second data write request according to the load balancing policy and load balancing parameters of the second group, and sends the second data to be written carried by the second data write request to the second server included in the second partition.
21. The device according to claim 19 or 20, characterized in that The processing module is further configured to update the load balancing strategy and load balancing parameters of the first group using a genetic algorithm.
22. The device according to any one of claims 19 to 21, characterized in that The processing module is further used to divide the multiple clients into multiple groups when the distributed storage system is started; The transceiver module is further configured to send an initial load balancing policy to the clients included in the first group; and send an initial load balancing policy to the clients included in the second group.
23. The device according to claim 22, characterized in that The transceiver module is specifically used to receive the configuration information of the tenant, where the configuration information includes group constraints; the processing module is specifically used to divide the multiple clients into the multiple groups according to the group constraints.
24. The device according to claim 23, characterized in that The group constraint includes dividing at least one client of the same tenant into the same group.
25. A distributed storage system, characterized in that: It includes multiple clients, multiple servers and parameter adjustment nodes, the multiple clients include a first client and a second client, the first client and the second client are used to cooperate in executing the method as described in any one of claims 1-6, and the parameter adjustment node is used to execute the method as described in any one of claims 7-12.
26. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 6.
27. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 7 to 12.
28. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 6.
29. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 7 to 12.
30. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 6.
31. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 7 to 12.