Load balancing method and device, electronic equipment, storage medium and program product
By combining load prediction model and subtree migration strategy in a distributed storage system, the problem of metadata load imbalance is solved, more efficient load balancing is achieved, system performance and stability are improved, and resource consumption is reduced.
Patent Information
- Application Number
- CN202510768694.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In the prior art, the metadata load imbalance problem in distributed storage systems leads to excessive load load among some servers and idle other server resources, affecting system performance and scalability, and the existing load balancing methods cannot dynamically adapt to cluster size changes and load changes.
By combining the target data and load prediction model of each server node in the metadata server cluster, the load balancing degree of each server node is determined, and the load balancing is performed through the subtree migration strategy. Multi-dimensional load monitoring, time series analysis and adaptive model update mechanisms are adopted to optimize subtree migration decisions.
It improves the load balancing effect of the metadata server cluster, reduces the metadata load pressure by 47%, improves metadata access efficiency, enhances the system's performance, stability and scalability, and reduces resource consumption and operational costs.
Smart Images

Figure CN120276873A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of task scheduling, and in particular, to a load balancing method, device, electronic device, storage medium, and program product. Background Art
[0002] In a distributed storage system, metadata management plays a key role in system performance. With the explosive growth of data volume and the increasing complexity of application scenarios, such as the growing demands for storage systems in fields like cloud computing, big data analysis, and artificial intelligence, the problem of metadata load balancing has become increasingly prominent.
[0003] In practical applications, in scenarios such as file storage in enterprise data centers and large-scale data management in research institutions, unbalanced metadata load can lead to some metadata servers being overloaded while other server resources are idle, seriously affecting the overall performance, response speed, and scalability of the system. The metadata load balancing methods in related technologies cannot dynamically adapt to the expansion of the scale of the metadata server cluster, cannot accurately predict the dynamic load changes of the metadata server cluster, and have a poor load balancing effect on the metadata server cluster. The load balancing effect of the metadata server cluster urgently needs to be improved.
[0004] Regarding the problem in related technologies of how to improve the balancing effect of metadata load balancing in a distributed storage system, no effective solution has been obtained yet. Summary of the Invention
[0005] This application provides a load balancing method, device, electronic device, storage medium, and program product to at least solve the problem in related technologies of how to improve the balancing effect of metadata load balancing in a distributed storage system.
[0006] This application provides a load balancing method, including: determining, according to the target data corresponding to each server node in a metadata server cluster and a load prediction model, the first load balancing degree of each server node at at least one time step after the current time point, where the target data includes one of the following: the first load index at the current time point, the second load balancing degree related to the first load index; determining a subtree migration strategy for the metadata server cluster based on the first load balancing degree and the second load balancing degree, and balancing the load of the metadata server cluster through the subtree migration strategy.
[0007] The present application also provides a load balancing device, including: a first determination module, configured to determine, according to target data corresponding to each server node in a metadata server cluster and a load prediction model, a first load balancing degree of each server node at at least one time step after the current time point, where the target data includes one of the following: a first load metric at the current time point, a second load balancing degree related to the first load metric; a second determination module, configured to determine a subtree migration strategy for the metadata server cluster based on the first load balancing degree and the second load balancing degree, and balance the load of the metadata server cluster through the subtree migration strategy.
[0008] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above load balancing methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored, where the computer program implements the steps of any of the above load balancing methods when executed by a processor.
[0010] The present application also provides a computer program product, including a computer program, where the computer program implements the steps of any of the above load balancing methods when executed by a processor.
[0011] Through the present application, since the first load balancing degree of each server node at at least one time step after the current time point is accurately determined by combining the target data corresponding to each server node in the metadata server cluster and the load prediction model, where the target data includes one of the following: the first load metric at the current time point, the second load balancing degree related to the first load metric; furthermore, it is possible to jointly determine a subtree migration strategy for the metadata server cluster by combining the predicted first load balancing degree and the second load balancing degree related to the first load metric of each server node, and balance the load of the metadata server cluster through the subtree migration strategy. Therefore, the technical problem of how to improve the balancing effect of metadata load balancing in a distributed storage system in the related art can be solved, and the technical effect of improving the load balancing effect of the metadata server cluster can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0013] Figure 1 It is a hardware structure block diagram of a computer terminal for a load balancing method according to an embodiment of the present application;
[0014] Figure 2 It is a flowchart of the load balancing method according to an embodiment of the present application;
[0015] Figure 3 It is an overall architecture diagram of a distributed storage system according to an embodiment of the present application;
[0016] Figure 4 It is an architecture diagram of an intelligent load balancing controller according to an embodiment of the present application;
[0017] Figure 5 It is a structure block diagram of a load balancing device according to an embodiment of the present application. Detailed implementation manners
[0018] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0019] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0020] To enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0021] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the load balancing method depends, the specific application environment architecture or specific hardware architecture will be described herein.
[0022] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 It is a hardware structure block diagram of a computer terminal for a load balancing method according to an embodiment of the present application. As Figure 1 shown, the computer terminal may include one or more ( Figure 1Only one processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are shown. Among them, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only schematic and does not limit the structure of the above computer terminal. For example, the computer terminal may further include Figure 1 more or fewer components than those shown, or have a different configuration from Figure 1 that shown.
[0023] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the load balancing method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the computer terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0025] Figure 2 is a flowchart of the load balancing method according to the embodiments of the present application, which is applied to the metadata server cluster of a distributed storage system. As Figure 2 shown, the process includes the following steps:
[0026] Step S202: Determine the first load balance degree of each server node in at least one time step after the current time point according to the target data corresponding to each server node in the metadata server cluster and the load prediction model, where the target data includes one of the following: the first load metric at the current time point, and the second load balance degree related to the first load metric.
[0027] Step S204: Determine the subtree migration strategy for the metadata server cluster based on the first load balance degree and the second load balance degree, and balance the load of the metadata server cluster through the subtree migration strategy.
[0028] Through the above steps, determine the first load balance degree of each server node in at least one time step after the current time point according to the target data corresponding to each server node in the metadata server cluster and the load prediction model, where the target data includes one of the following: the first load metric at the current time point, and the second load balance degree related to the first load metric; determine the subtree migration strategy for the metadata server cluster based on the first load balance degree and the second load balance degree, and balance the load of the metadata server cluster through the subtree migration strategy. Therefore, it is possible to solve the technical problem of how to improve the balance effect of metadata load balance in the related art, and achieve the technical effect of improving the load balance effect of the metadata server cluster.
[0029] The embodiments of the present application provide a load balancing method, and the method is described in detail in combination with the execution process of the load balancing method.
[0030] In an exemplary embodiment, before determining the first load balance degree of each server node in at least one time step after the current time point according to the target data corresponding to each server node in the metadata server cluster and the load prediction model, the method further includes: obtaining the first load metric of each server node through a preset method, where the first metric type in the first load metric includes at least one of the following: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read / write request queue length, metadata cache hit rate; determining the second load balance degree based on the first load metric and the load balance degree function.
[0031] That is to say, before inputting the target data into the load prediction model to predict the first load balancing degree, it is necessary to obtain the first load index and the first load balancing degree. Among them, the first load index is the real-time load index of each server node, and the preset methods for obtaining the first load index include: linux commands and distributed storage system monitoring services. The second load balancing degree is an explicit determination index for the real-time load situation of each server node. Furthermore, the more types of the first index types included in the first load index used to calculate the second load balancing degree, the more comprehensive and accurate the analysis of the first load index will be.
[0032] Further, determining the second load balancing degree through the first load index and the load balancing degree function includes: determining the position measure of the second load index in the third load index, where the second load index is the load index of each index type in the first load index, and the third load index includes: the second load indexes respectively corresponding to multiple server nodes in the metadata server cluster; inputting the first load index and the position measure into the load balancing degree function to obtain the second load balancing degree.
[0033] Optionally, the above position measure can be an average number, a median, etc. Optionally, the load balancing degree function is, for example:
[0034] ;(1)
[0035] Wherein, in the above formula (1), is the second load balancing degree, is the weight of each index in the first index type in the first load index, and ; is the CPU usage rate, is the memory occupancy rate, is the network bandwidth utilization rate, is the length of the metadata read / write request queue, is the metadata cache hit rate; in formula (1) represents the th server node in the metadata server cluster.
[0036] 、 、 、 、 are respectively the average values of the corresponding indexes of all server nodes in the metadata server cluster. By comparing with the average values of the corresponding indexes of the metadata server cluster, the relative load situation of each server node in the cluster (i.e., the abbreviation of the metadata server cluster) can be intuitively obtained.
[0037] Weight It is used to reflect the importance of different indicators on the system load balancing and can be adjusted according to the actual system requirements. For example, in a scenario with extremely high requirements for the read and write speed of metadata, the weight of the metadata read and write request queue length can be appropriately increased. 。
[0038] By combining the load indicators of multiple first indicator types of each server node, the real-time load balancing degree of each server node (i.e., the above-mentioned second load balancing degree) is calculated, realizing the real-time dynamic load assessment of each server node, and further achieving the technical effect of comprehensively considering the load situation of the metadata server cluster.
[0039] In an exemplary embodiment, before determining the first load balancing degree of each server node at at least one time step after the current time point according to the target data and the load prediction model corresponding to each server node in the metadata server cluster, the method further includes: obtaining the first historical load data of the metadata server cluster, where the first historical load data includes: the fourth load indicator and the third load balancing degree corresponding to the fourth load indicator, and the second indicator type in the fourth load indicator includes: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read and write request queue length, metadata cache hit rate; training a preset model with the first historical load data to obtain the load prediction model.
[0040] Optionally, obtaining the first historical load data of the metadata server cluster includes: obtaining the second historical load data of each server node; performing normalization processing on the second historical load data to obtain the first historical load data.
[0041] Further, training a preset model with the first historical load data to obtain the load prediction model includes: estimating the model order of the preset model by a parameter estimation method, and selecting an optimal model from the preset models respectively having different order combinations in the model order by a model selection criterion; estimating the model coefficients of the optimal model by the parameter estimation method; training the optimal model with the model coefficients by the first historical load data to obtain the load prediction model.
[0042] Among them, the preset model can be selected from the autoregressive moving average model (ARMA(p,q)). The parameter estimation methods include: the least squares method, the maximum likelihood estimation method; the model selection criteria include: the Akaike information criterion (AIC), the Bayesian information criterion (BIC).
[0043] The load prediction model trained by combining the historical load data of the metadata server cluster can be used to accurately predict the load change trend of the metadata server cluster. Subsequently, the load situation of the entire metadata server cluster can be determined by combining the real-time load balance degree of each server node in the metadata server cluster, and the metadata distribution can be adjusted in a timely manner to ensure the load balance of each server node.
[0044] In an exemplary embodiment, determining the first load balance degree of each server node at at least one time step after the current time point according to the target data corresponding to each server node in the metadata server cluster and the load prediction model includes: inputting the target data into the load prediction model to obtain the fourth load balance degree output by the load prediction model; determining whether the difference between the second load balance degree and the fourth load balance degree is less than a target value; and in the case where the difference is less than the target value, performing weighted fusion on the second load balance degree and the fourth load balance degree to obtain the first load balance degree.
[0045] That is to say, after inputting the target data into the load prediction model and obtaining the fourth load balance degree output by the model, it is also necessary to further determine whether the prediction result of the load prediction model is accurate, that is, to determine whether the deviation from the real-time second load balance degree of each server node is less than the target value; in the case where it is less than the target value, the first load balance degree is obtained by performing weighted fusion on the second load balance degree and the fourth load balance degree.
[0046] Further, after determining whether the difference between the second load balance degree and the fourth load balance degree is less than the target value, the method further includes: under the condition of meeting the first preset condition, updating the first historical load data of the metadata server cluster, and updating the load prediction model by using the updated first historical load data; and updating the load balance degree function by using the updated first historical load data, where the load balance degree function is used to determine the second load balance degree through the first load index; where the first preset condition includes one of the following: the difference between the second load balance degree and the fourth load balance degree is greater than or equal to the target value, the cluster scale of the metadata server cluster changes, and the workload type of the metadata server cluster changes.
[0047] Among them, the method for updating the first historical load data of the metadata server cluster includes: obtaining the recent historical load data of the metadata server cluster at multiple time steps before the current time point, and adding the recent historical load data to the first historical load data or updating it as the first historical load data. Among them, updating the load prediction model with the updated first historical load data includes: retraining or continuing to train the load prediction model with the updated first historical load data; updating the load balancing degree function with the updated first historical load data includes: adjusting the weights corresponding to each index in the load balancing degree with the updated first historical load data.
[0048] Through the update mechanism of the historical load data, the load prediction model and the load balancing degree function can change following the dynamic changes of the metadata server cluster. Furthermore, the real-time load balancing degree and the predicted load balancing degree (i.e., the above-mentioned first load balancing degree) calculated in this application are both close to the actual situation of the cluster, and thus the determination of the load situation of the cluster is more accurate.
[0049] In an exemplary embodiment, determining the subtree migration strategy for the metadata server cluster through the first load balancing degree and the second load balancing degree includes: determining the migration subtree in the subtree through the topological structure and access heat of the subtree in the metadata server cluster, where the subtree is managed by at least one server node in the metadata server cluster; and determining the migration target of the migration subtree in the metadata server cluster through the first load balancing degree and the second load balancing degree; determining the subtree migration strategy through the migration subtree and the migration target.
[0050] Furthermore, determining the migration subtree in the subtree through the topological structure and access heat of the subtree in the metadata server cluster includes: determining the topological indicators of the subtree to be evaluated in the subtree through the topological structure, where the topological indicators include: the subtree depth of the subtree to be evaluated, the number of files and directories included in the subtree to be evaluated; determining the topological importance factor of the subtree to be evaluated through the subtree depth and the number of files and directories; determining the migration subtree in the subtree to be evaluated through the topological importance factor and the access heat.
[0051] Among them, the calculation formula of the topological importance factor is:
[0052] ;(2)
[0053] Among them, in the above formula (2), is the topological importance factor, is the subtree depth, is the number of files and directories; and are weight coefficients used to adjust the weights of the influence degrees of the subtree depth (Depth) and the number of files and directories included in the subtree (Count) on the topological importance factor. For example, in a system with a well-defined directory structure where the depth has a greater impact on the load, the value of can be appropriately increased to highlight the contribution of the depth factor to .
[0054] The access popularity can be determined through the client access logs, that is, by determining the number of accesses of the subtree within the time t before the current time point in the client access logs (reflecting the accessed situation of the subtree). The specific formula is:
[0055] ;(3)
[0056] where is the access popularity, is the start time for counting the access popularity, is the end time for counting the access popularity, , represents the statistical time period. By adjusting the statistical time period, the access popularity of the subtree at different time granularities can be obtained.
[0057] Among them, the migration subtree in the to-be-evaluated subtree is determined through the topological importance factor and the access popularity, that is, the subtree with a high comprehensive score of the access popularity and the topological importance factor is selected as the migration subtree. The comprehensive score of the access popularity and the topological importance factor can be obtained through weighted fusion calculation of the access popularity and the topological importance factor.
[0058] Furthermore, the migration target of the migration subtree in the metadata server cluster is determined through the first load balancing degree and the second load balancing degree, including: obtaining the evaluation metrics of each server node, where the evaluation metrics include: the first load balancing degree, the second load balancing degree; calculating the evaluation score of each server node through the evaluation metrics and the evaluation function; taking the server node with the highest evaluation score in the metadata server cluster as the migration target.
[0059] Among them, the evaluation metrics specifically include: the first load balancing degree, the second load balancing degree, the storage capacity, and the network bandwidth. The evaluation function is:
[0060] ;(4)
[0061] where represents the evaluation score, represents the second load balancing degree, represents the first load balancing degree, represents the storage capacity, represents the network bandwidth, and in formula (4), represents the th server node in the metadata server cluster; is the weight, and .
[0062] In a scenario sensitive to storage capacity, the weight of the storage capacity can be increased so that the system is more inclined to select a node with a large storage capacity as the migration target. Select a server node with a high evaluation score as the migration target. Among them, , , , are respectively the average values of the evaluation metrics of all server nodes in the metadata server cluster, used to standardize and compare the metrics of each node.
[0063] Furthermore, determining the subtree migration strategy through the migration subtree and the migration target includes: determining the migration timing of the migration subtree through the at least one time step; and determining the migration mechanism that can be adopted during the migration of the migration subtree, where the migration mechanism includes at least one of the following: asynchronous migration, data prefetching, version control, and transaction mechanism; determining the subtree migration strategy through the migration object, migration timing, and the migration mechanism, where the migration object includes: the migration subtree, the migration target.
[0064] That is to say, the migration object, migration timing, and the migration mechanism during the migration together constitute the subtree migration strategy. Among them, determining the migration timing of the migration subtree through the at least one time step is: completing the subtree migration strategy within at least one time step.
[0065] In the embodiments of the present application, determining the migration subtree through the access heat and topological importance factor of the subtree, and determining the migration target through the real-time load balance degree and predicted load balance degree can accurately measure the migration object in the subtree migration strategy, reduce unnecessary migration operations, and reduce system resource consumption.
[0066] In an exemplary embodiment, balancing the load of the metadata server cluster through the subtree migration strategy includes: when the migration mechanism in the subtree migration strategy includes asynchronous migration and data prefetching, determining the prefetch data volume of the migration subtree through the historical access frequency and subtree size of the migration subtree; migrating the migration subtree to the migration target through the prefetch data volume and at least one thread corresponding to the asynchronous migration to balance the load of the metadata server cluster.
[0067] Among them, determining the prefetch data volume of the migration subtree based on the historical access frequency and subtree size of the migration subtree includes: determining the prefetch data volume by multiplying the historical access frequency, subtree size, and prefetch coefficient.
[0068] In an exemplary embodiment, load balancing of the metadata server cluster through the subtree migration policy includes: when the migration mechanism in the subtree migration policy includes version control and transaction mechanism, assigning a version number that uniquely identifies the migration subtree to the migration subtree, and recording metadata operations related to the migration subtree; re-executing the metadata operations on the migration target through the transaction mechanism and the version number to balance the load of the metadata server cluster, where, when the transaction mechanism is successfully executed, the version number is updated, and when the transaction mechanism fails, a rollback operation is performed according to the version number and the metadata operations.
[0069] In an exemplary embodiment, the method further includes: when the cluster scale of the metadata server cluster changes, determining the load migration ratio of the first server node through the second load balancing degree, where the first server node includes one of the following: a second server node and a third server node, where the second server node is a faulty server node in the metadata server cluster, and the third server node is an original server node in the metadata server cluster under a second preset condition, and the second preset condition includes: there is a new server node in the metadata server cluster; migrating the load in the first server node according to the load migration ratio.
[0070] Further, migrating the load in the first server node according to the load migration ratio includes: determining the load to be migrated in the load of the first server node according to the migration ratio; migrating the load to be migrated to a fourth server node, where the fourth server node includes one of the following: other server nodes in the metadata server cluster except the faulty server node, the new server node.
[0071] That is to say, through the load balancing method of the embodiments of the present application, it is possible to dynamically adjust the load in the metadata server cluster when the cluster scale changes. For example, when there is a new server node, the subtree with a high comprehensive score of access popularity and topological importance factor is migrated to the new server node through the load balancing method; when there is a faulty server node, the subtree managed by the faulty server node is migrated to a non-faulty server node with a high evaluation score.
[0072] To better understand the process of the above load balancing method, the following further describes the implementation process of the above load balancing method in combination with optional embodiments, but does not limit the technical solutions of the embodiments of the present application.
[0073] The load balancing method of the embodiments of the present application is applied to the metadata server cluster in a distributed storage system. A distributed storage system refers to a system that stores data on multiple independent nodes and manages it distributively, aiming to provide a storage solution with high performance, high reliability, and scalability. The design concept of a distributed storage system is based on scalability and fault tolerance. It adopts a decentralized distributed architecture, slices data, stores it in the form of objects on multiple nodes, ensures the capacity and load balance of each node, and uses a network for data access and management, while providing a unified storage interface. Among them, high reliability means that the distributed storage system adopts data redundancy and automatic fault recovery mechanisms to ensure the reliability and persistence of data. High scalability means that the distributed storage system can be dynamically scaled horizontally to support hundreds or even thousands of nodes.
[0074] Distributed storage systems usually adopt an architecture that separates metadata from data. Although this architecture is beneficial for independently expanding the performance of metadata and data, it also brings challenges to metadata management. In the file system workload of a distributed storage system, metadata operations account for a relatively large proportion. Research shows that in some scenarios, the proportion of metadata operations exceeds 70%, and even reaches as high as 94%. At the same time, the existence of a large number of small files and the application of fast storage devices also make the processing of metadata a bottleneck in system performance. Therefore, it is necessary to perform metadata load balancing on the distributed storage system.
[0075] The metadata load balancing methods that can be used in a distributed storage system include two categories: hash mapping and subtree partitioning.
[0076] In a distributed file system that uses hash mapping, a hash operation is performed on the file path name, inode number, or other unique identifiers. Taking file path name hashing as an example, the complete path of the file is used as the input, and a hash value is calculated through a specific hash function (such as Message-Digest Algorithm 5 (MD5 for short), Secure Hash Algorithm 1 (SHA-1 for short), etc.). This hash value will be mapped to a specific range, and this range corresponds to different metadata servers (meta data service, MDS for short, equivalent to the server nodes in the above embodiments). When a client requests to access the metadata of a certain file, the system will calculate the hash value based on the identifier of the file, and then find the corresponding MDS according to the hash value to obtain the metadata from this MDS.
[0077] Subtree partitioning method, which distributes metadata subtrees to different MDSs according to the usage patterns of subtrees and the current cluster load. Taking dynamic subtree partitioning as an example, its load balancing process involves multiple steps. First, the MDS collects metadata load statistics, such as the number of accesses and the number of files for each subtree. Then, based on these statistics, it determines whether the MDS cluster is load-imbalanced. If it is imbalanced, it proceeds to the next step. Next, the cluster is divided into an export metadata server (export MDS) and an import metadata server (import MDS), and the amount of load to be migrated is determined. After that, when selecting subtrees to migrate, by scanning the directory tree, subtrees with a high access popularity (such as a large number of accesses and a large number of files) are found as migration candidates. Finally, the selected subtrees are migrated from the export MDS to the import MDS. In actual operation, the MDS continuously monitors the number of files and the popularity value of each directory. When the number of files or the popularity value is too high, the corresponding subtree is split into smaller subtrees in advance for subsequent selection of migration.
[0078] However, the disadvantages of the above hash mapping method are as follows: In terms of data locality, due to the randomness of the hash operation, file metadata that is logically related may be scattered and stored on different MDSs. In a data analysis task, multiple file metadata in the same directory need to be frequently accessed. After these file metadata are hash-mapped and distributed across multiple MDSs, data needs to be retrieved across MDSs for each access, increasing network overhead and latency. In terms of dynamic adaptability, when the scale of the MDS cluster expands and new MDSs are added, the existing hash mapping relationships are not automatically adjusted. This will cause the new MDSs to be unable to effectively share the load, with some of the original MDSs overloaded, affecting system performance and scalability. When there is an access hotspot and a large number of requests are concentrated on the MDS corresponding to a specific hash partition, this MDS is prone to overload, while other MDSs are in a low-load state, exacerbating the system load imbalance.
[0079] Disadvantages of the above subtree partitioning method: In terms of load prediction, the prediction method based on popularity counting in related technologies has serious defects. It only estimates future load based on historical access times and does not consider the dynamic change trend of the workload. In the workload of artificial intelligence (AI) intelligent training, the file access pattern changes rapidly, and the difference between the popularity counting prediction result and the actual access is large, resulting in the inability to accurately judge the load change, affecting the timeliness and accuracy of the load balancing decision. In terms of the subtree selection strategy, the "one-size-fits-all" strategy does not consider the unique access patterns of different workloads. For scanning workloads such as AI training, files are rarely re-accessed, and the migration strategy based on popularity cannot effectively predict future access patterns. The selected migration subtree is unreasonable, resulting in resource waste, the inability to achieve load balancing, and a reduction in system performance. That is to say, the dynamic subtree partitioning method has problems such as load imbalance and resource waste, and it is difficult to deduce accurate models and reasonable heuristic algorithms for metadata migration and load balancing.
[0080] In summary, the metadata load balancing effects of the hash mapping and subtree partitioning methods in the distributed storage system are both relatively poor.
[0081] In view of the above disadvantages of the hash mapping and subtree partitioning methods, the embodiments of the present application solve them correspondingly through the above load balancing method. Specifically:
[0082] 1) The present application solves the problem of load imbalance in the scenario of a large number of small files: In the distributed storage system, the hash mapping method randomly allocates the storage location of metadata, resulting in the destruction of data locality. When the cluster expands or hot spots appear, the load imbalance is serious. Although the subtree partitioning method attempts to allocate dynamically according to the load, the prediction is inaccurate and the selection strategy is single, and it still cannot effectively balance the load. The present application will accurately identify the load imbalance state of the metadata service cluster through an innovative load monitoring and prediction mechanism. Using an improved algorithm and a dynamic load evaluation method combining various system metrics, comprehensively consider the load of the metadata service, anticipate the load change trend in advance, and adjust the metadata distribution in a timely manner to ensure the load balance of each metadata service and improve the overall performance and stability of the system;
[0083] 2) This application optimizes the subtree migration decision: The subtree partitioning method makes a "one-size-fits-all" choice in subtree selection, without considering the differences in different workloads, resulting in unreasonable migration decisions. This application uses a workload-aware subtree migration strategy to deeply analyze the access patterns, read / write characteristics, data locality and other features of different workloads. For workloads mainly with sequential access, subtrees with low likelihood of consecutive access are preferentially migrated; for workloads with frequent random access, the migration objects are selected according to the access probability distribution of files within the subtree. In this way, the accuracy of subtree migration is improved, unnecessary migration operations are reduced, system resource consumption is lowered, and the load balancing effect is enhanced.
[0084] 3) This application enhances the adaptability and scalability of the distributed storage system: The hash mapping method cannot dynamically adjust the metadata distribution when the cluster expands or hotspots occur, restricting the scalability and adaptability of the system. The optimization algorithm and system proposed in this application will have strong dynamic adaptation capabilities. When the cluster scale changes, it can automatically reallocate the metadata storage locations, enabling the newly added MDS to quickly integrate into the system and reasonably share the load; in the face of access hotspots, it can promptly migrate the metadata in the hotspot area to the MDS with lower load, ensuring that the system can operate efficiently under various complex conditions, meet the growing business needs, and improve the scalability and adaptability of the system.
[0085] 4) This application also improves the accuracy of load prediction: In the existing subtree partitioning method, the load prediction method based on popularity counting cannot accurately grasp the load change trend, seriously affecting the load balancing effect. This application will introduce an advanced load prediction model, combine technologies such as time series analysis algorithms, and conduct multi-dimensional analysis of the metadata load. Considering factors such as historical load data, the current state of the system, and workload characteristics, it accurately predicts future load changes, provides a reliable basis for load balancing decisions, enables the system to respond to load changes in advance, and realizes more efficient metadata management.
[0086] Combined with Figure 3 , Figure 3 is the overall architecture diagram of the distributed storage system according to the embodiments of this application. The load balancing method of this application can be implemented based on the intelligent load balancing controller (BC) in the metadata server cluster set in the distributed storage system. Specifically:
[0087] First, aiming at the defects of the hash mapping and subtree partitioning methods, multi-dimensional load monitoring and accurate evaluation are achieved through an intelligent load balancing controller (BC). BC accurately calculates the load balancing degree by using the weighted comprehensive calculation method through real-time collection of various load metrics of each node in the MDS cluster, including the usage rate of the Central Processing Unit (CPU for short), memory occupancy rate, network bandwidth utilization rate, the length of the metadata read / write request queue, and the metadata cache hit rate, etc., comprehensively and accurately evaluating the load status of each MDS node. Then, the load balancing degree is calculated using the weighted comprehensive calculation method, and a load prediction model is constructed in combination with time series analysis. Among them, the time series analysis method is adopted to construct the load prediction model, fully considering historical load data, the current state of the system, and the characteristics of the workload, effectively capturing the long-term dependence relationship of load changes, anticipating the load change trend in advance, providing strong support for resource allocation and load balancing decisions, effectively capturing the load change law, and planning resource allocation in advance. In terms of subtree migration, the subtree to be migrated is selected based on the topological structure and access pattern, the migration target is determined by comprehensively considering the load trend and resource status of the target node, and at the same time, asynchronous migration and data prefetch technologies are used to optimize the migration process, and version control and transaction mechanisms are introduced to ensure data consistency. Finally, this application also has the ability of dynamic adjustment to cope with changes in cluster scale and workload. This application can reduce the metadata load pressure by 47%, improve the metadata access efficiency, and has significant advantages in terms of performance, stability, security, cost, and compatibility, providing an efficient solution for metadata management in distributed storage systems.
[0088] Specifically, as Figure 3 shown, in the embodiment of this application, the distributed storage system architecture includes the following key components:
[0089] 1) Provide a file system service externally. The distributed storage client can perform distributed file storage input / output (IO for short) operations through this service.
[0090] 2) A unified, self-controlled, and scalable distributed storage consistency management system: This component is the core component of the distributed storage cluster, which provides a distributed storage service in the form of objects. In this component, data is stored as objects, and each object has a unique identifier and related data. It is responsible for storing objects distributively on each node of the storage cluster and providing functions such as data replication, recovery, and load balancing to ensure the reliability and high-performance access of data.
[0091] Storage pool: The distributed storage cluster consists of multiple storage nodes, and each storage node can contain multiple hard disks or storage devices. The storage pool includes a file metadata pool and a data pool, which divides the storage resources to form different pools to meet different storage needs.
[0092] In the storage pool, the client's data is stored by slicing, defaulting to 4MB objects. The objects are grouped, and the group ID is the remainder of Hash(object x) divided by the number of groups. Finally, it is stored in the underlying device object storage daemon (abbreviated as OSD).
[0093] 3) Controllable, scalable, and distributed data balancing placement algorithm: Through this component, data objects are evenly distributed across the nodes of the storage cluster to avoid data hotspots and improve system performance.
[0094] 4) Metadata and monitoring service cluster: The metadata cluster is only responsible for managing the metadata information of the file system, including the attributes, locations, etc. of files and directories. The monitoring service cluster is responsible for monitoring the status and configuration information of the cluster. Its technical principles include maintaining the status information, configuration information, health status, etc. of the cluster to ensure the consistency and availability of the cluster.
[0095] Based on Figure 3 the above architecture, this application performs load balancing on the metadata service clusters 1..n in the existing distributed storage system architecture through the above load balancing method. Specifically, this application constructs a metadata load balancing optimization system on top of the distributed storage environment. The metadata load balancing optimization system mainly includes a metadata server cluster (MDS cluster), data storage nodes (i.e., object storage daemon OSD), and clients. The MDS cluster is responsible for managing metadata, the OSD stores actual data, and the clients are used to interact with the system and initiate data read and write requests. Different from traditional systems, this metadata load balancing optimization system also introduces an intelligent load balancing controller (BC) as the core component to achieve load balancing optimization.
[0096] As Figure 4 shown Figure 4 is the architecture diagram of the intelligent load balancing controller according to the embodiment of this application. The main components of the intelligent load balancing controller (BC) include: a data acquisition module, a load evaluation module, a metadata load prediction module, a subtree migration decision and execution module, and the interaction relationship with the MDS cluster.
[0097] Among them, the metadata load monitoring and evaluation module (including the data acquisition module and the load evaluation module) of the intelligent load balancing controller (BC) is used to execute the following scheme:
[0098] Part 1, Multi-dimensional Load Index Collection: BC collects various load indexes of each node in the MDS cluster in real time. In addition to the conventional CPU usage rate, memory occupancy rate, and network bandwidth utilization rate, it also focuses on specific indexes of metadata operations, such as the length of the metadata read / write request queue and the metadata cache hit rate. Through the comprehensive analysis of these indexes, the load status of each MDS node can be evaluated more comprehensively and accurately. For an MDS node that frequently performs metadata write operations, the length of its metadata read / write request queue and CPU usage rate will increase significantly, and these changes in indexes can be captured by BC in a timely manner.
[0099] Specifically, BC collects multiple key load indexes (equivalent to the first load index in the above embodiment), including: CPU usage rate , which is used to reflect the usage of the MDS node's CPU. A high CPU usage rate may lead to metadata processing delays; memory occupancy rate , which is used to reflect the usage degree of the MDS node's memory. Insufficient memory may affect the effect of metadata caching; network bandwidth utilization rate , which is used to represent the usage ratio of the MDS node's network bandwidth. Network congestion will affect the transmission of metadata; length of the metadata read / write request queue , a too long queue length means that there are a large number of requests waiting to be processed, which may lead to performance degradation; metadata cache hit rate , a high hit rate means that more metadata can be obtained from the cache, reducing disk I / O operations. Among them, represents the th MDS metadata service node (equivalent to each server node in the above embodiment). These indexes reflect the load status of the th MDS metadata service node from different aspects and are the basic data for subsequent calculations and decisions.
[0100] Part 2, Calculation of Load Balance Degree: The embodiment of this application designs a new method for calculating the load balance degree. By constructing a load balance degree function, the various load indexes are weighted and calculated. According to the importance of different indexes to the system performance, corresponding weights are assigned to each index. The CPU usage rate has a greater impact on the metadata processing speed and can be assigned a higher weight; while the memory occupancy rate has a relatively smaller impact on the system performance within a certain range and is assigned a lower weight. The load balance degree calculated in this way can more accurately reflect the overall load balance status of the MDS cluster. Specifically, the weighted comprehensive calculation method is used to calculate the load balance degree The formula is shown in the above formula (1).
[0101] Among them, the metadata load prediction module in the intelligent load balance controller (BC) is used to execute the following scheme:
[0102] Part 1: By processing the patterns in the historical load data of the MDS metadata load through time series analysis methods, predicting future load trends, providing strong support for achieving load balancing, being able to effectively process time series data, and capturing the long-term dependencies of load changes. Taking the historical load data (including the above multi-dimensional load metrics, equivalent to the first historical load data in the above embodiments) as the model input, through training, learning the patterns and rules of load changes. According to actual needs, predicting the load conditions at different future time points or time periods. The prediction results can be used for advance resource allocation planning. When it is predicted that the load of a certain MDS node will be too high, part of the metadata is timely migrated to other nodes with lower load to achieve load balancing. The system configuration can also be adjusted according to the prediction results, such as increasing or decreasing resource supply, improving the performance and stability of the system, and discovering potential load imbalance problems in advance.
[0103] Specifically, the embodiment of the present application constructs a load prediction model for processing the time series characteristics of the MDS metadata load. This model considers multiple parameters related to the MDS metadata load (equivalent to the second index type in the fourth load metric in the above embodiments), such as CPU usage rate, memory occupancy rate, network bandwidth utilization rate, length of the metadata read / write request queue, and metadata cache hit rate, etc., and predicts future load conditions through learning historical data.
[0104] Optionally, the training steps of the load prediction model include:
[0105] Step 1, data collection and preprocessing. Collect parameters related to the metadata load from each MDS node, including , , , , , and all this information can be obtained through linux commands and the monitoring service of the distributed storage system. For the purpose of unifying the dimension and making different data comparable, data preprocessing preprocesses the collected data and normalizes the above-mentioned monitored data (equivalent to the second historical load data in the above embodiments, where the second historical load data may or may not include the first load metric collected in real time), as follows:
[0106] Data normalization: Normalize the values of all parameters to the interval [0, 1] to ensure that the model can converge better. The formula is as follows:
[0107] ; (5)
[0108] Among them, is the original data, and They are the minimum and maximum values of the parameter in the dataset of this metric type in the metadata server cluster. For example, in the CPU usage dataset, if , , and the currently collected CPU usage , substituting into the formula gives . After normalization, the output value will be mapped to the interval [0, 1]. 0 indicates that the metric is at the minimum level in the dataset, 1 indicates the maximum level, and the intermediate values reflect the relative position of the data between the minimum and maximum values proportionally. This helps the model treat different metric data more fairly and avoid certain metrics dominating the model training due to differences in data dimensions.
[0109] Step 2: Perform load balancing adjustment on the time series. Select the metrics related to the MDS load as the time series data. In this application, the normalized load balancing degree (LBD) is selected as the observed value of the time series. Calculate and normalize the LBD data over a period of time (such as the past week, recorded every 15 minutes) according to the weighted comprehensive calculation method to obtain the sequence , where is the number of data points.
[0110] Select the autoregressive moving average model (ARMA(p,q)) to construct the metadata load prediction model of this application. The model expression of the autoregressive moving average model is , where, in the model expression, represents the load value at time t (which can be the LBD or a single load metric value, equivalent to the fourth load balancing degree in the above embodiment), p and q are the autoregressive order and the moving average order respectively, and are the corresponding coefficients, is the white noise sequence. Using historical load data (including historical LBD and various load metric data), estimate the model parameters p, q, and through the least squares method, maximum likelihood estimation method, etc. Determine the optimal p and q values with the help of the Akaike information criterion (AIC), Bayesian information criterion (BIC), etc. to improve the model fitting effect.
[0111] Input the currently calculated LBD or load metric value (equivalent to the target data in the above embodiments) into the trained ARMA(p,q) model to predict the load value for one or more future time steps. To obtain more accurate prediction results, fuse the prediction results of time series analysis with the current LBD calculation result (equivalent to the fourth load balancing degree in the above embodiments). For example, adopt a weighted fusion method, assign weights to the time series prediction result and the LBD calculation result respectively, and synthesize the information of both to obtain the final load prediction result. If the time series prediction shows that the future load will increase, and the current LBD indicates that the load of some MDSs is relatively high, it is comprehensively judged that the future load imbalance problem may intensify. Continuously monitor the MDS load data and the system operation status. Once the deviation between the actual load and the prediction result is large, or the system environment changes (such as the expansion of the cluster scale or the change of the workload type), trigger the model update mechanism. Re-collect and preprocess the data, re-estimate the parameters of the ARMA(p,q) model, or adjust the weights in the LBD calculation according to the characteristics of the new data to optimize the load prediction model, make it adapt to the dynamic changes of the system, and ensure the prediction accuracy.
[0112] In the embodiments of this application, starting from p = 0, q = 0, gradually try different combinations of p and q, and calculate the corresponding AIC and BIC values. When p = 1, q = 1, the calculated AIC value is , and the BIC value is . After calculation and comparison, it is found that when p = 2, q = 1, the AIC value is the smallest, so the model order is determined to be p = 2, q = 1. Use the least squares method to estimate the parameters of the ARMA(2,1) model, and obtain the estimated values of the parameters and . Conduct a residual analysis on the constructed ARMA(2,1) model, and draw the residual sequence diagram and the autocorrelation function diagram. It is observed that the residual sequence is approximately white noise, indicating that the model can better fit the historical load data. Model training: Input the LBD data of this week into the ARMA(2,1) model for training, so that the model can learn the change law of the load. After training, this model can be used to predict the future MDS load balancing degree, providing a basis for load balancing decisions.
[0113] Second part, adaptive model update mechanism: To cope with the dynamics of load changes, design an adaptive model update mechanism. When the system load changes greatly, such as the expansion of the cluster scale or the change of the workload type, etc., trigger the model update process in a timely manner. By re-collecting data, adjusting the model structure or parameters, make the load prediction model adapt to the new system environment. When a new MDS node joins the cluster, the system will automatically collect the load data of the new node and incorporate it into the model training scope, and adjust the model to adapt to the new cluster structure.
[0114] Among them, the subtree migration decision module in the intelligent load balancing controller (BC) is used to execute the following scheme:
[0115] The first part, subtree selection based on topological structure and access pattern: When selecting a subtree to migrate, fully consider the topological structure of the file system and the access pattern of the client. By analyzing the directory structure of the file system, identify subtrees with a higher level and larger scale, which have a greater impact on the system load. Combining the access logs of the client, count the access frequency and access time interval of different subtrees. For those hot subtrees with high access frequency and short time interval, give priority to migration. At the same time, avoid selecting subtrees with strong dependencies on other subtrees for migration to reduce the impact on system data consistency and access performance. If a subtree contains multiple files that are being frequently read and written, and these files are data-related to files in other subtrees, when migrating this subtree, it is necessary to carefully evaluate the impact on the entire system.
[0116] Specifically, in the embodiment of subtree selection based on topological structure and access pattern, define the topological importance factor (TI) of the subtree, which is used to measure the importance of the subtree in the file system topological structure. The calculation of TI combines the depth (Depth) of the subtree, which represents the depth of the subtree in the file system directory structure. The greater the depth, usually the lower the level of the subtree in the entire system, and the greater its potential impact on the system load. The more the number of files and directories (Count) contained in the subtree, the higher the load of the subtree and the greater its impact on the overall system load. The calculation formula of the topological importance factor (TI) is shown in the above formula (2).
[0117] At the same time, according to the client access log, the calculation formula of the access heat (AH) of the subtree is shown in the above formula (3). Select the subtree with a high comprehensive score of TI and AH as the migration candidate.
[0118] The second part, migration target selection strategy: After determining the subtree to migrate, select a suitable MDS node as the migration target. In addition to considering the current load status of the target node, also evaluate its future load trend. Using the results of the above load prediction module, select those MDS nodes with lower future load and sufficient processing capacity as the migration target. Consider the resource status such as the storage capacity and network bandwidth of the target node to ensure that it can accept the migrated subtree. When an MDS node has a low current load, but it is predicted that its future load will increase due to other tasks and its storage capacity is limited, do not select this node as the migration target. Define the migration target evaluation function (TEF), comprehensively considering the current load of the target MDS node and the predicted value of future load , respectively represent the current load and the predicted future load value of the j-th MDS node, which are used to evaluate the current and future processing load capabilities of the node. Storage capacity and network bandwidth and other factors, respectively represent the storage capacity and network bandwidth of the j-th MDS node, reflecting the resource status of the node. The formula is as shown in the above formula (4).
[0119] Among them, the subtree migration execution module in the intelligent load balancing controller (BC) is used to execute the following scheme:
[0120] The first part, migration process optimization: During the subtree migration process, asynchronous migration and data prefetching technologies are adopted. Asynchronous migration allows the subtree migration operation to be carried out without blocking the normal operation of the system, improving the concurrent processing ability of the system. Before the migration starts, according to the size and access pattern of the subtree, some data is prefetched into the cache of the target MDS node in advance to reduce the first access latency after the migration is completed. For a subtree containing a large number of small files, the metadata and part of the data of these small files are prefetched to the target node before the migration. When the migration is completed, the client can access these files faster.
[0121] Specifically, the embodiment adopts asynchronous migration and data prefetching technologies. In asynchronous migration, a multi-thread mechanism is used to allocate the subtree migration tasks to different threads for execution, reducing the impact on the normal operation of the system. In terms of data prefetching, according to the access pattern and size of the subtree, some data is prefetched into the cache of the target MDS node. The calculation of the prefetch data volume (PrefetchSize) is based on the historical access frequency (AccessFreq) of the subtree, which reflects the frequency of access to the subtree. The higher the access frequency, the greater the value of the prefetched data, and the size of the subtree (SubtreeSize), which is usually measured by the data volume or the number of files. The larger the subtree, the corresponding increase in the prefetched data volume. The formula is:
[0122] ;(6)
[0123] Among them, is the prefetch coefficient, which can be adjusted according to the actual system situation, adjusted according to network bandwidth, cache size, etc., and is used to control the size of the prefetched data volume.
[0124] Second Part, Data Consistency Assurance: To ensure data consistency during the migration process, version control and transaction mechanisms are introduced. Before migrating a subtree, a unique version number is assigned to the subtree, and all relevant metadata operations are recorded. During the migration process, these operations are re-executed in the form of transactions on the target MDS node to ensure data integrity and consistency. If an error occurs during the migration process, the system can roll back the operation based on the version number and transaction record and restore to the state before the migration. Version control and transaction mechanisms are introduced. Before migration, a version number (Version) is assigned to the subtree, and all relevant metadata operations (Operations) are recorded. During the migration process, the operations are executed in the form of transactions on the target node. After the transaction is successfully executed, the version number is updated; if an error occurs, a rollback is performed based on the version number and operation record.
[0125] Optionally, the intelligent load balancing controller (BC) further includes: a system dynamic adjustment module for performing the following steps:
[0126] First Part, Handling of Cluster Scale Changes: When the scale of the MDS cluster changes, whether new nodes are added or nodes fail, the system can automatically trigger a dynamic adjustment process. When adding new nodes, BC migrates some subtrees with higher loads to the new nodes according to the current load status of the cluster to achieve rebalancing of the load. When a node fails, the subtrees on the failed node are promptly migrated to other normal nodes, and the load balancing degree of the cluster is recalculated, and the parameters of the load monitoring and prediction model are adjusted.
[0127] Specifically, when the scale of the MDS cluster changes, such as adding new nodes, calculate the load migration ratio of each existing MDS node , and the formula is:
[0128] ;(7)
[0129] Where : represents the current load of the i-th existing MDS node (equivalent to the original server in the above embodiment), and is used to calculate the load ratio that needs to be migrated from this node. is the average value of the current loads of all existing MDS points and is used as a comparison benchmark to judge the difference between the load of each node and the average load. n in formula (7) represents the number of existing MDS nodes and is used to calculate the total load difference. According to the migration ratio, some subtrees with higher loads are migrated to the new nodes.
[0130] Part II, Adaptation to Workload Changes: As the workload changes, such as from mainly performing file read operations to a large number of file write operations, the system can adaptively adjust the load balancing strategy. By re-evaluating the weights of various load metrics, adjusting the sub-tree migration decision and the migration target selection strategy to adapt to the new workload pattern. If the workload changes from mainly read to mainly write, the system will increase its attention to metrics such as the length of the metadata write request queue and disk I / O performance, and accordingly adjust the priority of sub-tree migration and the selection criteria for target nodes.
[0131] Through the above load balancing method, the technical effects of the embodiments of this application are as follows:
[0132] 1) This application focuses on metadata load balancing in a distributed storage system. Through a series of innovative technologies, it brings significant beneficial effects in terms of performance, stability, security, cost, and compatibility, effectively solving many problems of the prior art and improving the overall efficiency of the distributed storage system.
[0133] 2) Performance improvement: In the scenario of a large number of small files and metadata-intensive IO requests, this application effectively reduces the average search latency of metadata extended attributes and permission attributes. Operations such as directory quota and directory inheritance permission retrieval can reduce the metadata load pressure by up to 47%. Through an accurate load monitoring and prediction mechanism, it anticipates the load change trend in advance, timely adjusts the metadata distribution, and improves the efficient access ability of metadata. In the face of frequent read and write requests for a large number of small files, the system can quickly locate and process metadata, reducing waiting time, improving the efficiency of metadata-intensive storage operations in a large-scale massive data processing environment, and enhancing the response speed and throughput of the system when dealing with complex data operations.
[0134] 3) Enhanced stability: This application decouples the metadata organization and management method from the distributed storage module. This design makes the metadata management transparent to the business client. The business client does not need to pay attention to the specific storage and management details of metadata, reducing the coupling degree between the business and the storage system. When the distributed storage module is upgraded, maintained, or has a local failure, it will not affect the normal use of the business client, ensuring the stability of the system operation, ensuring that the business can run continuously and stably, and reducing the risk of business interruption caused by internal changes in the system.
[0135] 4) Improved security: Encapsulation is performed on components and method modules, hiding the implementation details inside the system, and avoiding damage to the core functions of the system caused by external illegal access and malicious attacks. It is difficult for the outside to obtain the internal metadata management logic and key algorithms of the system, reducing the risk of data leakage and tampering. Encapsulation also helps to perform more refined permission control on the system. Only authorized modules or users can access specific functions and data, further enhancing the security of the system and protecting the security and privacy of user data.
[0136] 5) Cost reduction: The proposed multi-path processing logic for metadata, metadata information, and the storage form of structured attribute information optimize the storage and management methods of metadata. This optimization improves the competitiveness of distributed file storage, reduces waste of storage resources, and lowers the purchase and maintenance costs of storage devices. Through a more efficient load balancing strategy, it reduces the excessive wear and tear of servers and energy waste caused by load imbalance, improves the utilization rate of server resources, and overall reduces the operating cost of the system, making the distributed storage system more economically feasible and sustainable.
[0137] 6) Good compatibility: The metadata multi-path management method of the embodiments of this application has good portability and generality and can run on different hardware devices. Whether using traditional storage devices or new storage media, whether on servers with an x86 architecture or other types of hardware platforms, this method can work properly. This makes the system more flexible in hardware selection. Enterprises can choose appropriate hardware devices according to their own needs and budgets without worrying about compatibility issues with the metadata management method, reducing the costs and risks of hardware upgrades and replacements, and improving the adaptability and scalability of the system.
[0138] In summary, this application improves the metadata load balancing performance of the distributed storage system through innovative load monitoring, prediction, and migration strategies. This technical solution based on real-time data processing, intelligent decision-making, and dynamic adjustment is expected to be applied to the task scheduling field in the edge computing scenario. By monitoring the resource load status of edge nodes, predicting task requirements, and intelligently scheduling tasks to balance node loads, the overall efficiency and response speed of the edge computing system can be improved.
[0139] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner.
[0140] In this embodiment, a load balancing device is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0141] Figure 5 is a structural block diagram of a load balancing device according to an embodiment of the present application. As Figure 5 shown, the device includes:
[0142] A first determination module 52, configured to determine, according to the target data corresponding to each server node in the metadata server cluster and a load prediction model, the first load balancing degree of each server node at at least one time step after the current time point, where the target data includes one of the following: the first load index at the current time point, and the second load balancing degree related to the first load index;
[0143] A second determination module 54, configured to determine a subtree migration strategy for the metadata server cluster through the first load balancing degree and the second load balancing degree, and balance the load of the metadata server cluster through the subtree migration strategy.
[0144] Through the above device, the first load balancing degree of each server node at at least one time step after the current time point is determined according to the target data corresponding to each server node in the metadata server cluster and a load prediction model, where the target data includes one of the following: the first load index at the current time point, and the second load balancing degree related to the first load index; a subtree migration strategy for the metadata server cluster is determined through the first load balancing degree and the second load balancing degree, and the load of the metadata server cluster is balanced through the subtree migration strategy. Therefore, the technical problem of how to improve the balancing effect of metadata load balancing in a distributed storage system in the related art can be solved, and the technical effect of improving the load balancing effect of the metadata server cluster can be achieved.
[0145] In an exemplary embodiment, the device further includes: a third determination module, configured to obtain the first load index of each server node in a preset manner, where the first index type in the first load index includes at least one of the following: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read / write request queue length, metadata cache hit rate; and determine the second load balancing degree through the first load index and a load balancing degree function.
[0146] In an exemplary embodiment, the third determination module is further configured to determine the position metric of the second load metric in the third load metric, where the second load metric is the load metric of each metric type in the first load metric, and the third load metric includes: the second load metrics respectively corresponding to multiple server nodes in the metadata server cluster; input the first load metric and the position metric into the load balancing degree function to obtain the second load balancing degree.
[0147] In an exemplary embodiment, the apparatus further includes: a training module, configured to obtain first historical load data of the metadata server cluster, where the first historical load data includes: a fourth load metric and a third load balancing degree corresponding to the fourth load metric, and the second metric type in the fourth load metric includes: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read / write request queue length, metadata cache hit rate; train a preset model through the first historical load data to obtain the load prediction model.
[0148] In an exemplary embodiment, the training module is further configured to estimate the model order of the preset model through a parameter estimation method, and select an optimal model from preset models respectively having different order combinations in the model order through a model selection criterion; estimate the model coefficients of the optimal model through the parameter estimation method; train the optimal model with the model coefficients through the first historical load data to obtain the load prediction model.
[0149] In an exemplary embodiment, the training module is further configured to obtain second historical load data of each server node; perform normalization processing on the second historical load data to obtain the first historical load data.
[0150] In an exemplary embodiment, the first determination module is further configured to input the target data into the load prediction model to obtain a fourth load balancing degree output by the load prediction model; determine whether the difference between the second load balancing degree and the fourth load balancing degree is less than a target value; in the case where the difference is less than the target value, perform weighted fusion on the second load balancing degree and the fourth load balancing degree to obtain the first load balancing degree.
[0151] In an exemplary embodiment, the apparatus further includes an update module configured to update the first historical load data of the metadata server cluster and update the load prediction model with the updated first historical load data when a first preset condition is satisfied; and update the load balance degree function with the updated first historical load data, where the load balance degree function is used to determine the second load balance degree based on the first load metric; where the first preset condition includes any one of the following: the difference between the second load balance degree and the fourth load balance degree is greater than or equal to a target value, a change in the cluster scale of the metadata server cluster, and a change in the workload type of the metadata server cluster.
[0152] In an exemplary embodiment, the second determination module is further configured to determine a migration subtree in the subtree based on the topology structure and access popularity of the subtree in the metadata server cluster, where the subtree is managed by at least one server node in the metadata server cluster; and determine a migration target of the migration subtree in the metadata server cluster based on the first load balance degree and the second load balance degree; determine the subtree migration strategy based on the migration subtree and the migration target.
[0153] In an exemplary embodiment, the second determination module is further configured to determine a topology metric of a to-be-evaluated subtree in the subtree based on the topology structure, where the topology metric includes: the subtree depth of the to-be-evaluated subtree, and the number of files and directories included in the to-be-evaluated subtree; determine a topology importance factor of the to-be-evaluated subtree based on the subtree depth and the number of files and directories; determine the migration subtree in the to-be-evaluated subtree based on the topology importance factor and the access popularity.
[0154] In an exemplary embodiment, the second determination module is further configured to obtain an evaluation metric of each server node, where the evaluation metric includes: the first load balance degree, the second load balance degree; calculate an evaluation score of each server node based on the evaluation metric and an evaluation function; use the server node with the highest evaluation score in the metadata server cluster as the migration target.
[0155] In an exemplary embodiment, the second determination module is further configured to determine a migration timing of the migration subtree based on the at least one time step; and determine a migration mechanism that can be adopted during the migration of the migration subtree, where the migration mechanism includes at least one of the following: asynchronous migration, data prefetching, version control, and transaction mechanism; determine the subtree migration strategy based on the migration object, migration timing, and the migration mechanism, where the migration object includes: the migration subtree, the migration target.
[0156] In an exemplary embodiment, the second determination module is further configured to, when the migration mechanism in the subtree migration policy includes asynchronous migration and data prefetching, determine the amount of prefetch data for the migrated subtree based on the historical access frequency and the size of the subtree; and migrate the migrated subtree to the migration target through the amount of prefetch data and at least one thread corresponding to the asynchronous migration, so as to balance the load of the metadata server cluster.
[0157] In an exemplary embodiment, the second determination module is further configured to, when the migration mechanism in the subtree migration policy includes version control and transaction mechanism, assign a version number that uniquely identifies the migrated subtree to the migrated subtree, and record the metadata operations related to the migrated subtree; re-execute the metadata operations on the migration target through the transaction mechanism and the version number, so as to balance the load of the metadata server cluster, where, when the transaction mechanism is successfully executed, update the version number, and when the transaction mechanism fails, perform a rollback operation according to the version number and the metadata operations.
[0158] In an exemplary embodiment, the second determination module is further configured to, when the cluster scale of the metadata server cluster changes, determine the load migration ratio of the first server node through the second load balance degree, where the first server node includes one of the following: a second server node and a third server node, where the second server node is a faulty server node in the metadata server cluster, and the third server node is an original server node in the metadata server cluster under a second preset condition, and the second preset condition includes: there is a newly added server node in the metadata server cluster; migrate the load in the first server node according to the load migration ratio.
[0159] In an exemplary embodiment, the second determination module is further configured to determine the load to be migrated in the load of the first server node according to the migration ratio; and migrate the load to be migrated to a fourth server node, where the fourth server node includes one of the following: other server nodes in the metadata server cluster except the faulty server node, the newly added server node.
[0160] For the description of the features in the corresponding embodiments of the load balancing device, reference can be made to the relevant description in the corresponding embodiments of the load balancing method, which will not be elaborated here one by one.
[0161] An embodiment of the present application further provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above embodiments of the load balancing method.
[0162] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any of the above-described load balancing method embodiments when running.
[0163] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), external hard drives, magnetic disks, or optical discs that can store computer programs.
[0164] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described load balancing method embodiments.
[0165] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described load balancing method embodiments.
[0166] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0167] The above has introduced in detail a load balancing provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A load balancing method, characterized in that Including: Determining a first load balancing degree of each server node in at least one time step after the current time point according to target data corresponding to each server node in the metadata server cluster and a load prediction model, where the target data includes one of the following: a first load metric at the current time point, a second load balancing degree related to the first load metric; Determining a subtree migration strategy for the metadata server cluster based on the first load balancing degree and the second load balancing degree, and balancing the load of the metadata server cluster through the subtree migration strategy.
2. The load balancing method according to claim 1, wherein Before determining the first load balancing degree of each server node in at least one time step after the current time point according to target data corresponding to each server node in the metadata server cluster and a load prediction model, the method further includes: Obtaining the first load metric of each server node in a preset manner, where the first metric type in the first load metric includes at least one of the following: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read / write request queue length, metadata cache hit rate; Determining the second load balancing degree through the first load metric and a load balancing degree function.
3. The load balancing method according to claim 2, characterized in that, Determining the second load balancing degree through the first load metric and a load balancing degree function includes: Determining a position metric of a second load metric in a third load metric, where the second load metric is a load metric of each metric type in the first load metric, and the third load metric includes: second load metrics corresponding to multiple server nodes in the metadata server cluster respectively; Inputting the first load metric and the position metric into the load balancing degree function to obtain the second load balancing degree.
4. The load balancing method according to claim 1, wherein Before determining the first load balancing degree of each server node in at least one time step after the current time point according to target data corresponding to each server node in the metadata server cluster and a load prediction model, the method further includes: Obtaining first historical load data of the metadata server cluster, where the first historical load data includes: a fourth load metric and a third load balancing degree corresponding to the fourth load metric, where the second metric type in the fourth load metric includes: central processing unit usage rate, memory occupancy rate, network bandwidth utilization rate, metadata read / write request queue length, metadata cache hit rate; Training a preset model with the first historical load data to obtain the load prediction model.
5. The load balancing method according to claim 4, wherein Training a preset model with the first historical load data to obtain the load prediction model includes: Estimating the model order of the preset model by a parameter estimation method, and selecting an optimal model from preset models respectively having different order combinations in the model order through a model selection criterion; Estimating the model coefficients of the optimal model by the parameter estimation method; Training the optimal model with the model coefficients by the first historical load data to obtain the load prediction model.
6. The load balancing method according to claim 4, characterized in that, Obtaining the first historical load data of the metadata server cluster includes: Obtain the second historical load data of each server node; Perform normalization processing on the second historical load data to obtain the first historical load data.
7. The load balancing method according to claim 1, wherein Determine the first load balancing degree of each server node at at least one time step after the current time point according to the target data and the load prediction model corresponding to each server node in the metadata server cluster, including: Input the target data into the load prediction model to obtain the fourth load balancing degree output by the load prediction model; Determine whether the difference between the second load balancing degree and the fourth load balancing degree is less than the target value; When the difference is less than the target value, perform weighted fusion on the second load balancing degree and the fourth load balancing degree to obtain the first load balancing degree.
8. The load balancing method according to claim 7, wherein After determining whether the difference between the second load balancing degree and the fourth load balancing degree is less than the target value, the method further includes: Under the condition of meeting the first preset condition, update the first historical load data of the metadata server cluster, and update the load prediction model through the updated first historical load data; and Update the load balancing degree function through the updated first historical load data, where the load balancing degree function is used to determine the second load balancing degree through the first load index; Wherein, the first preset condition includes one of the following: the difference between the second load balancing degree and the fourth load balancing degree is greater than or equal to the target value, the cluster scale of the metadata server cluster changes, and the workload type of the metadata server cluster changes.
9. The load balancing method according to claim 1, wherein Determine the subtree migration strategy for the metadata server cluster through the first load balancing degree and the second load balancing degree, including: Determine the migration subtree in the subtree through the topological structure and access heat of the subtree in the metadata server cluster, where the subtree is managed by at least one server node in the metadata server cluster; and Determine the migration target of the migration subtree in the metadata server cluster through the first load balancing degree and the second load balancing degree; Determine the subtree migration strategy through the migration subtree and the migration target.
10. The load balancing method according to claim 9, wherein Determine the migration subtree in the subtree through the topological structure and access heat of the subtree in the metadata server cluster, including: Determine the topological index of the subtree to be evaluated in the subtree through the topological structure, where the topological index includes: the subtree depth of the subtree to be evaluated, and the number of files and directories included in the subtree to be evaluated; Determine the topological importance factor of the subtree to be evaluated through the subtree depth and the number of files and directories; Determine the migration subtree in the subtree to be evaluated through the topological importance factor and the access heat.
11. The load balancing method according to claim 9, wherein Determine the migration target of the migration subtree in the metadata server cluster through the first load balancing degree and the second load balancing degree, including: Obtain the evaluation index of each server node, where the evaluation index includes: the first load balancing degree, the second load balancing degree; Calculate the evaluation scores of each server node through the evaluation metrics and evaluation function; Use the server node with the highest evaluation score in the metadata server cluster as the migration target.
12. The load balancing method according to claim 9, wherein Determine the subtree migration strategy through the migration subtree and the migration target, including: Determine the migration timing of the migration subtree through the at least one time step; and Determine the migration mechanism that can be adopted during the migration of the migration subtree, where the migration mechanism includes at least one of the following: asynchronous migration, data prefetching, version control, and transaction mechanism; Determine the subtree migration strategy through the migration object, migration timing, and the migration mechanism, where the migration object includes: the migration subtree, the migration target.
13. The load balancing method according to claim 9, wherein Balance the load of the metadata server cluster through the subtree migration strategy, including: When the migration mechanism in the subtree migration strategy includes asynchronous migration and data prefetching, determine the amount of prefetch data of the migration subtree according to the historical access frequency and subtree size of the migration subtree; Migrate the migration subtree to the migration target through the amount of prefetch data and at least one thread corresponding to the asynchronous migration to balance the load of the metadata server cluster.
14. The load balancing method according to claim 9, wherein Balance the load of the metadata server cluster through the subtree migration strategy, including: When the migration mechanism in the subtree migration strategy includes version control and transaction mechanism, assign a version number that uniquely identifies the migration subtree to the migration subtree, and record the metadata operations related to the migration subtree; Re-execute the metadata operations on the migration target through the transaction mechanism and the version number to balance the load of the metadata server cluster. Wherein, when the transaction mechanism is successfully executed, update the version number; when the transaction mechanism fails, perform a rollback operation according to the version number and the metadata operations.
15. The load balancing method according to claim 1, wherein The method further includes: When the cluster scale of the metadata server cluster changes, determine the load migration ratio of the first server node through the second load balance degree, where the first server node includes one of the following: the second server node and the third server node, where the second server node is the faulty server node in the metadata server cluster, and the third server node is the original server node in the metadata server cluster under the second preset condition, and the second preset condition includes: there are new server nodes in the metadata server cluster; Migrate the load in the first server node according to the load migration ratio.
16. The load balancing method according to claim 15, wherein Migrate the load in the first server node according to the load migration ratio, including: Determine the load to be migrated in the load of the first server node according to the migration ratio; Migrate the load to be migrated to the fourth server node, where the fourth server node includes one of the following: other server nodes in the metadata server cluster except the faulty server node, the new server node.
17. A load balancing device, characterized in that, Include: A first determination module, configured to determine a first load balancing degree of each server node in at least one time step after the current time point according to target data corresponding to each server node in the metadata server cluster and a load prediction model, where the target data includes one of the following: a first load metric at the current time point, a second load balancing degree related to the first load metric; A second determination module, configured to determine a subtree migration policy for the metadata server cluster based on the first load balancing degree and the second load balancing degree, and balance the load of the metadata server cluster through the subtree migration policy.
18. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the load balancing method according to any one of claims 1 to 16 when executing the computer program.
19. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program implements the steps of the load balancing method according to any one of claims 1 to 16 when being executed by a processor.
20. A computer program product comprising a computer program, characterized in that, The computer program implements the steps of the load balancing method according to any one of claims 1 to 16 when being executed by a processor.
Citation Information
Patent Citations
Method for balancing predictable dynamic load of Web clusters
CN106385468A
Method and device for establishing models corresponding to malicious account numbers and method and device for identifying malicious account numbers
CN107305611A
Load balancing control method and device, storage medium and electronic equipment
CN111666159A
Load balancing control method and device, storage medium and electronic equipment
CN112256438A
Target migration method and device
CN114448897A
Cited By
Server load prediction method, electronic device, storage medium and program product
CN120723591A
Network load balancing method and device
CN120825454A