Processing method for relieving local overhigh spatial load of performance layer of hierarchical distributed block storage
By using space allocation services and LRU mechanisms in hierarchical distributed block storage, low-load nodes allocate performance layer copies of small data blocks, and synergistically accelerate the sinking of data from high-load nodes, the problem of local high-load space load in the performance layer is solved, and load balancing and efficient resource utilization are achieved.
Patent Information
- Application Number
- CN202411842750.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In the prior art, hierarchical distributed blocks are stored in the write scenario of small data blocks, resulting in the problem of locally high load on the performance layer space. The existing hot and cold sinking mechanism cannot effectively alleviate the performance layer space load pressure in such scenarios.
By obtaining the user's IO request, writing small data blocks, and using the space allocation service to select low-load nodes for allocation based on the spatial load rate of the performance layer replica. At the same time, based on the LRU mechanism and the load status information of the current storage service in the cluster, the linkage accelerates the sinking of small data blocks of high-load nodes to the capacity layer, freeing up the performance layer space.
It effectively alleviates the problem of locally overloaded space in the performance layer, ensures efficient utilization of system resources and reasonable use of performance layer resources, prevents excessive local load, and achieves load balancing effect.
Smart Images

Figure CN119781676A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed storage, and in particular to a method for alleviating local excessive spatial load of a performance layer in hierarchical distributed block storage. Background Art
[0002] In the era of big data and the widespread application of cloud computing, storage technology is facing unprecedented challenges. Users want storage systems to provide high-speed read and write performance, high availability and low cost, while also meeting the needs of elastic expansion and intelligent management. In this context, hierarchical distributed block storage has become an ideal solution. It combines the advantages of distributed storage and hierarchical storage to provide a storage architecture that balances performance, reliability and cost. Hierarchical distributed block storage is a technical architecture that distributes data on multiple storage nodes and stores data on different levels of storage media based on the access frequency and performance requirements of the data. The performance layer uses high-speed storage media (such as NVMe SSD or DRAM) to provide low latency and high throughput. The capacity layer uses lower-cost media (such as SATA HDD or tape) to reduce storage costs.
[0003] The space allocator of hierarchical distributed block storage manages the storage space of the performance layer and the capacity layer. The space allocator manages the high-speed storage media space of multiple nodes in a unified manner and regards it as the performance layer space. The space allocator manages the low-cost media space of multiple nodes in a unified manner and regards it as the capacity layer space.
[0004] In general, the virtual volume for storing data provided by hierarchical distributed block storage is composed of multiple small data blocks. The common size of a small data block is 4 / MiB / 256MiB / 2GiB or an elastic size container. The data of small data blocks is hierarchically distributed in the performance layer and the capacity layer. Small data blocks are usually stored in multiple copies in the performance layer. Small data blocks are stored in multiple copies or EC in the capacity layer.
[0005] The data in the small data block is organized in smaller granularity, such as 4KiB / 16KiB / 256KiB, which is called a sub-data block. The sub-data blocks in the same small data block are allocated by the storage service where the replica of the performance layer / capacity layer of the small data block is located.
[0006] Hierarchical distributed block storage generally uses the LRU mechanism to sense the hot and cold status of small data blocks (with the sub-data blocks of the performance layer replica as the granularity). The sub-data blocks with high frequency access in small data blocks are stored in the performance layer. The sub-data blocks with low frequency access in small data blocks are stored in the capacity layer.
[0007] Due to the high cost of performance layer space, the performance layer space may be much smaller than the capacity layer. To avoid the exhaustion of performance layer space, hierarchical distributed block storage periodically reads cold data sub-data blocks from the performance layer space of small data blocks and writes them to the capacity layer according to the hot and cold status of the sub-data blocks of small data blocks, thereby freeing up performance layer space. Figure 1 As shown in the figure, in general, the sub-data blocks of newly written small data blocks are hot data and are allocated in the performance layer. If there is no IO access to the sub-data blocks of the small data block for a period of time after writing, the sub-data blocks will become cold, and after a certain period of time, they will sink to the capacity layer. When the sinking is completed, the space occupied by the sub-data blocks in the performance layer will be released.
[0008] The existing technology reduces the space usage of the performance layer by sinking small data blocks from the performance layer to the capacity layer, such as Figure 2 As shown. However, small data blocks can be thinly provisioned. Thin provisioning means that the space allocator can allocate multiple copies of small data blocks to the same node without immediately occupying the performance layer space of the node. When write IO is written to the performance layer copy of the small data block, the performance layer copy will actually occupy space. When a node concentrates a large number of thinly provisioned small data block copies, as small data blocks are written, the performance layer space usage rate of the node will continue to rise, and the pressure on the performance layer space will increase. Since the LRU mechanism periodically sinks cold data, and the above write scenario causes the performance layer space load of the local node to increase, and the written data is all hot, the cold and hot sinking cannot alleviate the problem of local excessive performance layer space load (node performance layer used space / node performance layer total space) in this scenario. Summary of the invention
[0009] The purpose of the present invention is to provide a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, thereby solving the above-mentioned technical problems pointed out in the prior art.
[0010] The present invention provides a method for alleviating local excessive high spatial load of a performance layer in hierarchical distributed block storage, comprising the following steps:
[0011] Obtaining the user's IO request; writing the IO request into a small data block; the storage service sends a performance layer replica allocation request to the space allocation service based on the small data block written into the IO request;
[0012] The space allocation service selects a plurality of low-load nodes as target performance layer replicas based on the performance layer replica allocation request and the space load rate of each performance layer replica; and writes the small data block into the target performance layer replica;
[0013] The storage service is based on the LRU mechanism and combines the load status information of each storage service in the current cluster to perform linkage acceleration to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica into the capacity layer.
[0014] Preferably, when a small data block is written to the performance layer replica, the corresponding data in the small data block will occupy the space of the performance layer replica.
[0015] Preferably, the LRU mechanism includes the following steps:
[0016] The hot and cold data of each small data block are obtained by marking the access time of the sub-data blocks of each small data block in a continuous time period; wherein the closer the access time of the sub-data block is to the current time point, the hotter the hot and cold data of the small data block corresponding to the sub-data block is;
[0017] Arrange the small data blocks in order from hot to cold based on the hot and cold data to obtain a linked list sequence set;
[0018] The small data blocks at the tail of the linked list sequence set that are less than or equal to the preset maximum cold and hot data threshold of the cold and hot data are sunk to the capacity layer in a preset time period.
[0019] Preferably, the space allocation service selects multiple low-load nodes as target performance layer replicas based on the performance layer replica allocation request in combination with the space load rate of each performance layer replica, including the following operation steps:
[0020] Obtaining the node performance layer space capacity of each performance layer replica in real time;
[0021] The space load rate corresponding to the performance layer replica is obtained by calculating based on the node performance layer space capacity and the node performance layer total space capacity corresponding to the performance layer replica.
[0022] A plurality of target performance layer replicas are selected based on the space load ratio and a preset space load ratio maximum threshold.
[0023] Preferably, the space load rate is calculated as follows:
[0024] Space load rate = node performance layer space capacity / node performance layer total space capacity.
[0025] Preferably, after the space allocation service selects multiple low-load nodes as performance layer replicas based on the performance layer replica allocation request, it further includes the following operation steps:
[0026] High-load nodes and low-load nodes are obtained by periodically scanning the spatial load rate of the target performance layer replica within a preset interval; and small data blocks corresponding to the target performance layer replica in the high-load node are migrated to the low-load node.
[0027] Preferably, the storage service is based on the LRU mechanism and combined with the load status information of each storage service in the current cluster to perform linkage acceleration to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica into the capacity layer, including the following steps:
[0028] Establish a performance layer space load awareness mechanism for current storage services;
[0029] The space allocation service senses whether the current storage service is a high-load node; if so, it triggers the sinking mechanism and the triggering of the performance layer space load perception mechanism, controls the current storage service and all storage services in the current cluster except the current storage service to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and scans in sequence from cold to hot to obtain the sinking small data blocks; and sinks the sinking small data blocks into the capacity layer until the space allocation service senses that the current storage service is not a high-load node.
[0030] Preferably, the performance layer space load perception mechanism refers to a mechanism by which the current storage service can perceive the load status of all storage services in the current cluster except the current storage service.
[0031] Preferably, controlling the current storage service and all storage services in the current cluster except the current storage service to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and scanning in sequence from cold to hot to obtain the sinking small data blocks, including the following steps:
[0032] Obtain the access frequency Ti of the i-th small data block in the current storage service within a preset access time period; calculate the access priority Pi of the i-th small data block based on the access frequency combined with the hot and cold data Wi of the i-th small data block;
[0033] Sort the small data blocks from high to low based on the access priority Pi to obtain a first LRU linked list sequence set;
[0034] Obtaining the space load rate of each storage service in the current cluster except the current storage service; and obtaining a linkage service priority sequence set based on the space load rate sorted from low to high;
[0035] The maximum data volume of the current storage service is calculated based on the maximum threshold of the space load rate; the reserved data volume is calculated based on the accumulation of the data volume of the small data blocks from high to low in the first LRU linked list sequence; the maximum number of small data blocks whose reserved data volume is less than or equal to the maximum data volume of the current storage service is calculated; the total number of small data blocks to be sunk is calculated based on the maximum number of small data blocks and the total number of small data blocks of the current storage service;
[0036] Based on the ranking of each storage service in the linkage service priority sequence set, small data blocks with a total number of small data blocks sinking from low to high in the first LRU linked list sequence set are selected from high to low to scan and obtain L n A small data block sinks.
[0037] Preferably, the access priority Pi is calculated as follows:
[0038] Pi = Ti × α + Wi × β;
[0039] In the formula, α and β are weight coefficients, and β>α;
[0040] The L n The calculation method for a small data block is:
[0041]
[0042] Where k is the kth storage service ranked from high to low in the linkage service priority sequence; N is the total number of small data blocks that are sunk; and floor() is a rounding function.
[0043] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0044] From the analysis of the above-mentioned hierarchical distributed block storage processing method for alleviating the local excessive spatial load of the performance layer provided by the present invention, it can be known that in specific applications, the user's IO request is first written into a small data block, and then copies of these data blocks are allocated through the space allocation service, which provides a basis for subsequent data storage and access; further, the space allocation service selects nodes with lower loads to allocate performance layer copies for storing small data blocks according to the spatial load rate of each performance layer copy, thereby ensuring efficient use of system resources; further, through the LRU mechanism, the transfer of data from the performance layer to the capacity layer is managed. The system determines which data is in a colder state and transfers them from the performance layer to the capacity layer to release the performance layer space, ensuring that high-frequency access data can continue to be retained in the performance layer, ensuring the rational use of performance layer resources while preventing local excessive load, thereby achieving a load balancing effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a simulation of sinking small data blocks in hierarchical distributed block storage in the prior art;
[0046] Figure 2 A schematic diagram of a simulation of sinking small data blocks in hierarchical distributed block storage in the prior art;
[0047] Figure 3 A schematic diagram of the overall operation steps of a method for alleviating local excessive load on the performance layer space of a hierarchical distributed block storage;
[0048] Figure 4 Arrange an operation simulation diagram for a hierarchical distributed block storage method to alleviate local excessive spatial load in the performance layer;
[0049] Figure 5 A schematic diagram of the operation steps of selecting a target performance layer replica in a method for alleviating local excessive load of a performance layer space in a hierarchical distributed block storage;
[0050] Figure 6 A schematic diagram of the operation flow simulation of linking and accelerating the sinking of small data blocks in a method for processing local excessive spatial load of a hierarchical distributed block storage to alleviate performance layer;
[0051] Figure 7 The present invention is a schematic diagram of the operation steps of scanning and sinking small data blocks in a method for alleviating local excessive spatial load in a performance layer of a hierarchical distributed block storage. DETAILED DESCRIPTION
[0052] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] The present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0054] Embodiment 1
[0055] like Figure 3 or Figure 4 As shown, the first embodiment of the present invention provides a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, including the following steps:
[0056] Step S10: Obtain the user's IO request; write the IO request into a small data block; the storage service sends a performance layer replica allocation request to the space allocation service based on the small data block written into the IO request;
[0057] It should be noted that in the above-mentioned embodiment of the present application, the space allocation service is responsible for allocating copies of the performance layer and the capacity layer for small data blocks (i.e., small data blocks with user IO requests written thereto), and managing the copy allocation of small data blocks; the storage service processes external IO requests, and completes the allocation of performance layer copies and capacity layer copies of small data blocks through the space allocation service. The storage service is responsible for user IO requests to access small data blocks, and is responsible for the sinking of small data blocks;
[0058] When a user IO requests to write a small data block that has not been assigned a replica, the storage service will request the space allocation service to allocate a performance layer replica for the small data block, that is, select several nodes as the performance layer replicas of the small data block; the writing of the small data block will be forwarded to several performance layer replicas, and the writing will occupy the performance layer space of the node where the performance layer replica is located;
[0059] The common size of the data block used as the allocation unit is 4MiB / 256MiB / 2GiB / or an elastically sized container; when small data blocks are actually saved in the performance layer, the storage engine usually organizes the data in a smaller granularity, such as 4KiB / 16KiB / 256KiB, etc.; assuming that 256KiB is used as the small management granularity, a small data block that has never been written will occupy 256KiB of the performance layer replica when 0-256KiB is first written; the initial space occupied by a performance layer replica of a thinly provisioned small data block on the node is 0MiB, and the space gradually increases as it is written. When it is full, it occupies the entire small data block size.
[0060] Step S20: the space allocation service selects a plurality of low-load nodes as target performance layer replicas based on the performance layer replica allocation request and the space load rate of each performance layer replica; and writes the small data block into the target performance layer replica;
[0061] It should be noted that when a small data block is written to the performance layer replica, the corresponding data in the small data block will occupy the space of the performance layer replica;
[0062] Step S30: The storage service performs linkage acceleration based on the LRU mechanism and in combination with the load status information of each storage service in the current cluster to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica into the capacity layer.
[0063] The LRU mechanism includes the following steps:
[0064] The hot and cold data of each small data block are obtained by marking the access time of the sub-data blocks of each small data block in a continuous time period; wherein the closer the access time of the sub-data block is to the current time point, the hotter the hot and cold data of the small data block corresponding to the sub-data block is;
[0065] Arrange the small data blocks in order from hot to cold based on the hot and cold data to obtain a linked list sequence set;
[0066] The small data blocks at the tail of the linked list sequence set that are less than or equal to the preset maximum cold and hot data threshold of the cold and hot data are sunk to the capacity layer in a preset time period.
[0067] It should be noted that the above-mentioned embodiment of the present application uses the LRU mechanism to sense the hot and cold conditions of the sub-data blocks (the size of the sub-data blocks is usually 4KiB / 16KiB / 256KiB) of the small data blocks; the LRU mechanism is essentially a linked list, each small data block is a member of the linked list, and each sub-data block of each small data block is inserted into the head of the linked list every time it is accessed, that is, the closer the sub-data block is to the head of the linked list (the closer the time point when the small data block is accessed is to the current time point), the hotter it is, and the small data block at the end of the linked list is relatively cold; the storage service will periodically sink the small data blocks at the end of the linked list to release the performance layer space occupied by each small data block (that is, the performance layer space occupied by the small data blocks);
[0068] The above-mentioned embodiment of the present application alleviates the situation of high space load of the local performance layer by adjusting the space allocation and migration of hierarchical distributed block storage and the strategy of sinking the performance layer to the capacity layer;
[0069] In the case of a large number of small data blocks written in thin provisioning based on hierarchical distributed block storage with cold and hot sinking, because the small data block copies may be concentrated in a certain written node, when a large number of writes occur, the performance layer space load of these nodes will be too high, and the performance layer space pressure of these nodes will increase; by avoiding allocating performance layer copies of small data blocks to nodes with too high performance layer space load and actively migrating performance layer copies with high performance layer space load to nodes with lower performance layer space, the performance layer space of each node can be balanced as much as possible; by actively scanning the sub-data blocks related to the nodes with too high performance layer space copies in the LRU and sinking them, the performance layer space of the nodes with too high performance layer space load is actively released;
[0070] In the above-mentioned embodiment of the present application, the user's IO request is first written into a small data block, and then copies of these data blocks are allocated through the space allocation service, providing a basis for subsequent data storage and access; further, the space allocation service selects nodes with lower loads to allocate performance layer copies for storing small data blocks according to the space load rate of each performance layer copy, thereby ensuring efficient utilization of system resources; further, through the LRU mechanism, the transfer of data from the performance layer to the capacity layer is managed. The system determines which data is in a colder state and transfers them from the performance layer to the capacity layer to release performance layer space, ensuring that high-frequency access data can continue to be retained in the performance layer, ensuring the rational use of performance layer resources while preventing local loads from being too high, thereby achieving a load balancing effect.
[0071] Specifically, Figure 5 As shown, in step S20, the space allocation service selects multiple low-load nodes as target performance layer replicas based on the performance layer replica allocation request and the space load rate of each performance layer replica, including the following operation steps:
[0072] Step S21: obtaining the node performance layer space capacity of each performance layer replica in real time;
[0073] Step S22: Calculate the space load rate corresponding to the performance layer replica based on the node performance layer space capacity and the node performance layer total space capacity corresponding to the performance layer replica;
[0074] The space load rate is calculated as follows:
[0075] Space load rate = node performance layer space capacity / node performance layer total space capacity;
[0076] It should be noted that the above-mentioned node performance layer space capacity refers to the storage space that the node corresponding to the current performance layer replica has already accommodated for the amount of data contained, and the above-mentioned node performance layer total space capacity refers to the total storage space that the node corresponding to the current performance layer replica can contain for the amount of data contained (or the storage space capacity of the node corresponding to the current performance layer replica); based on the calculation of the above-mentioned embodiment of the present application, the load rate of the node corresponding to the current performance layer replica is obtained, which can provide an effective data basis for the subsequent selection of performance layer replicas.
[0077] Step S23: Select and obtain multiple target performance layer copies based on the space load rate and a preset space load rate maximum threshold.
[0078] It should be noted that, under normal circumstances, the maximum threshold of the spatial load rate is set to 85%. When the spatial load rate is higher than (i.e., greater than) 85%, the node corresponding to the spatial load rate is a high-load node. When selecting performance layer replicas, the embodiment of the present application avoids nodes with high performance layer spatial loads and selects nodes with spatial load rates less than or equal to 85% as performance layer replicas, thereby improving the utilization efficiency of the nodes while avoiding overloading of local nodes.
[0079] Specifically, in step S20, after the space allocation service selects multiple low-load nodes as performance layer replicas based on the performance layer replica allocation request, the following operation steps are also included:
[0080] Step S21: Screening out high-load nodes and low-load nodes by periodically scanning the spatial load rate of the target performance layer replica within a preset interval; migrating the small data blocks corresponding to the target performance layer replica in the high-load node to the low-load node.
[0081] It should be noted that in the above-mentioned embodiment of the present application, the space allocation service first periodically scans the performance layer space load of each storage service in the cluster within a preset interval. After scanning and finding that there are high-load nodes, the space allocation service sends a migration command to the storage service; then, the storage service migrates the corresponding small data blocks on the nodes with high load in the performance layer space to the nodes with low load, so as to achieve load balancing and avoid excessive local load.
[0082] During the specific implementation of the above-mentioned embodiment of the present application, the technical personnel found that at the time of initial configuration, the performance layer replicas on each node may not occupy much space at the beginning because the small data blocks prepared by streamlining may be written less. However, with the writing of user IO, nodes where the performance layer replicas of small data blocks are too concentrated will face too fast growth in the performance layer space occupancy. When allocating performance layer replicas for small data blocks, the strategy of avoiding nodes with high performance layer space load as much as possible and actively migrating performance layer replicas on nodes with high performance layer space load to nodes with low performance layer space load will not take effect in time. Therefore, a more dynamically perceived mechanism for reducing the performance layer space load is needed. This strategy is called accelerated sinking, and the specific operations are detailed in the following steps S31-step S3*.
[0083] Specifically, if Figure 6 As shown, in step S30, the storage service performs linkage acceleration based on the LRU mechanism and in combination with the load status information of each storage service in the current cluster to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica into the capacity layer, including the following operation steps:
[0084] Step S31: Establishing a performance layer space load perception mechanism for the current storage service;
[0085] The performance layer space load perception mechanism refers to a mechanism by which the current storage service can perceive the load status of all storage services in the current cluster except the current storage service;
[0086] Step S32: The space allocation service senses whether the current storage service is a high-load node; if so (if not, it continues to monitor periodically), it triggers the sinking mechanism and the triggering of the performance layer space load perception mechanism, controls the current storage service and all storage services in the current cluster except the current storage service to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and scans in sequence from cold to hot to obtain the sinking small data blocks (the small data blocks in the sinking performance layer replica); and sinks the sinking small data blocks into the capacity layer until the space allocation service senses that the current storage service is not a high-load node.
[0087] It should be noted that, in the above-mentioned embodiment of the present application, each storage service in the current cluster has its own LRU mechanism (i.e., LRU linked list) and performance layer space load perception mechanism; when the space allocation service periodically perceives that the current storage service is a high-load node, the LRU mechanism and the performance layer space load perception mechanism are triggered at the same time, and the current storage service and all storage services except the current storage service in the current cluster are linked together to scan the LRU linked list from cold to hot to obtain the sinking performance layer copy, and sink the small data blocks in the sinking performance layer copy into the capacity layer until the space allocation service perceives that the space load rate of the current storage service is less than or equal to the maximum threshold of the space load rate, and then stops sinking;
[0088] In the above embodiment of the present application, the access right to a small data block is only granted to one storage service in the cluster at the same time. The storage service with the access right to the small data block manages the sub-data blocks of the performance layer replica of the small data block, and adds the storage service's own LRU to sense hot and cold. For example, the performance layer replica of the small data block is [storage service-node (node refers to the performance layer replica node) 1, storage service-node 2], and the one with the access right to the small data block is storage service-node 3. Then the user IO can only access the data of the small data block through storage service-node 3, and only storage service-node 3 can sink the small data block, releasing the performance layer space of storage service-node 1 and storage service node-2. The accelerated sinking mechanism involves the linkage of multiple storage services:
[0089] Each storage service in the cluster establishes a performance layer space load perception mechanism with other storages. Each storage service perceives its own performance layer space load. When the local performance layer space load is high, it notifies all storage services to enable accelerated sinking for it. All storage services scan the hot and cold data of the sub-data blocks of the small data blocks to be sunk for the nodes that enable accelerated sinking: from the end of the LRU linked list, in the order from cold to hot, scan out the small data blocks related to the accelerated sinking node. In order to reduce the impact of accelerated sinking on user IO, hot small data blocks are stored in the high-speed performance layer as much as possible, and accelerated sinking sinks small data blocks from cold to hot, sinking cold small data blocks to the capacity layer as much as possible. If the sinking of cold small data blocks can reduce the performance layer space load of related storage services, the impact on user IO is relatively low.
[0090] All storage services sink these small data blocks at the fastest speed to release the performance layer space load of the accelerated sinking nodes;
[0091] When the accelerated sinking storage service senses that the local performance storage space load has decreased (less than or equal to the threshold for high load determination, i.e., the above-mentioned maximum threshold for space load rate), it notifies all storage services to stop accelerating their own sinking.
[0092] Specifically, Figure 7 As shown, in step S32, the current storage service and all storage services in the current cluster except the current storage service are controlled to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and the small data blocks to be sunk are sequentially scanned in the order from cold to hot, including the following operation steps:
[0093] Step S321: obtaining the access frequency Ti of the ith small data block in the current storage service within a preset access time period; calculating the access priority Pi of the ith small data block based on the access frequency and the hot and cold data Wi of the ith small data block;
[0094] The access priority Pi is calculated as follows:
[0095] Pi = Ti × α + Wi × β;
[0096] In the formula, α and β are weight coefficients respectively, and β>α (because the smaller data blocks with hotter cold and hot data are at the top of the LRU list, and they should not be sunk to the capacity layer);
[0097] It should be noted that the above-mentioned embodiment of the present application comprehensively considers the access frequency of small data blocks and the hot and cold data of small data blocks, so that small data blocks with low access rate and cold hot and cold data sink quickly, reduce the load pressure of the server, and allow small data blocks with high access frequency and hot cold and hot data to be retained in the performance layer replica, so that small data blocks with high access frequency and hot cold and hot data (that is, they may be accessed in subsequent time periods) can efficiently respond to IO requests in the performance layer replica.
[0098] Step S322: sorting the small data blocks from high to low based on the access priority Pi to obtain a first LRU linked list sequence set;
[0099] Step S323: obtaining the space load rate of each storage service in the current cluster except the current storage service; and obtaining a linkage service priority sequence set based on the space load rate sorted from low to high;
[0100] The linkage service priority sequence set is because the storage service with a lower space load rate can more quickly assist the current storage service in scanning the sinking small data blocks, thereby realizing load balancing more quickly.
[0101] Step S324: Calculate the maximum data volume of the current storage service based on the maximum threshold of the space load rate; calculate the reserved data volume based on the accumulation of the data volumes of the small data blocks from high to low in the first LRU linked list sequence; calculate the maximum number of small data blocks whose reserved data volume is less than or equal to the maximum data volume of the current storage service; calculate the total number of small data blocks to be sunk based on the maximum number of small data blocks and the total number of small data blocks of the current storage service;
[0102] Step S325: Based on the ranking of each storage service in the linkage service priority sequence set, small data blocks with a total number of small data blocks sinking from low to high in the first LRU linked list sequence set are selected from high to low to obtain L n A small sinking data block;
[0103] The L n The calculation method for a small data block is:
[0104]
[0105] Where, k is the kth storage service ranked from high to low in the linkage service priority sequence; N is the total number of small data blocks sunk; floor() is a rounding function;
[0106] It should be noted that L in the above-mentioned embodiment of the present application n L of small data blocks nIt refers to the number of small data blocks scanned and processed by the kth storage service ranked from high to low in the linkage service priority sequence set. In the above analysis process, since the storage service with a lower space load rate can scan and sink small data blocks more quickly and sink them into the capacity layer, in order to ensure that the linkage service can complete the operation of small data blocks as quickly and efficiently as possible after it is enabled, the ranking of storage services in the linkage service priority sequence set is sorted from high to low. The storage service with a high ranking should scan more small data blocks, and the storage service with a low ranking should scan fewer small data blocks. In this way, while ensuring the normal operation of other storage services, the scanning and sinking operations of small data blocks can be completed more quickly and efficiently, and all storage services except the current storage service participate in the linkage processing, thereby ensuring the effective utilization of resources within the cluster, thereby achieving load balancing more efficiently.
[0107] In summary, the present invention proposes a method for processing hierarchical distributed block storage to alleviate the local excessive load of the performance layer space. First, the user's IO request is written into a small data block, and then the space allocation service is used to allocate copies of these data blocks, which provides a basis for subsequent data storage and access; further, the space allocation service selects nodes with lower loads to allocate performance layer copies for storing small data blocks according to the space load rate of each performance layer copy, so as to ensure efficient use of system resources; further, the LRU mechanism is used to manage the transfer of data from the performance layer to the capacity layer. The system determines which data is in a cold state and transfers them from the performance layer to the capacity layer to release the performance layer space, so as to ensure that high-frequency access data can continue to be retained in the performance layer, ensure the reasonable use of performance layer resources while preventing local excessive load, thereby achieving the effect of load balancing;
[0108] In addition, during the specific implementation process, based on the load of each node, the performance layer replicas of the nodes with high performance layer space load will be actively migrated to other nodes with low performance layer space load;
[0109] At the same time, all storage services in the current cluster are called to improve the efficiency of load balancing by linking and accelerating sinking.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. A person skilled in the art may modify the technical solutions described in the above embodiments, or replace part or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: The steps are as follows: Obtaining the user's IO request; writing the IO request into a small data block; the storage service sends a performance layer replica allocation request to the space allocation service based on the small data block written into the IO request; The space allocation service selects a plurality of low-load nodes as target performance layer replicas based on the performance layer replica allocation request and the space load rate of each performance layer replica; and writing the small data block into the target performance layer copy; The storage service is based on the LRU mechanism and combines the load status information of each storage service in the current cluster to perform linkage acceleration to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica into the capacity layer.
2. According to claim 1, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: When a small data block is written to the performance layer replica, the corresponding data in the small data block will occupy the space of the performance layer replica.
3. According to claim 2, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: The LRU mechanism includes the following steps: The hot and cold data of each small data block are obtained by marking the access time of the sub-data blocks of each small data block in a continuous time period; wherein the closer the access time of the sub-data block is to the current time point, the hotter the hot and cold data of the small data block corresponding to the sub-data block is; Arrange the small data blocks in order from hot to cold based on the hot and cold data to obtain a linked list sequence set; The small data blocks at the tail of the linked list sequence set that are less than or equal to the preset maximum cold and hot data threshold of the cold and hot data are sunk to the capacity layer in a preset time period.
4. According to claim 3, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: The space allocation service selects a plurality of low-load nodes as target performance layer replicas based on the performance layer replica allocation request and the space load rate of each performance layer replica, including the following operation steps: Obtaining the node performance layer space capacity of each performance layer replica in real time; The space load rate corresponding to the performance layer replica is obtained by calculating based on the node performance layer space capacity and the node performance layer total space capacity corresponding to the performance layer replica. A plurality of target performance layer replicas are selected based on the space load ratio and a preset space load ratio maximum threshold.
5. According to claim 4, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: The space load rate is calculated as follows: Space load rate = node performance layer space capacity / node performance layer total space capacity.
6. According to claim 5, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: After the space allocation service selects multiple low-load nodes as performance layer replicas based on the performance layer replica allocation request, the space allocation service further includes the following operation steps: High-load nodes and low-load nodes are obtained by periodically scanning the spatial load rate of the target performance layer replica within a preset interval; and small data blocks corresponding to the target performance layer replica in the high-load node are migrated to the low-load node.
7. According to claim 6, a method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage, characterized in that: The storage service is based on the LRU mechanism and combines the load status information of each storage service in the current cluster to perform linkage acceleration to sink the small data blocks corresponding to the high-load nodes in the target performance layer replica to the capacity layer, including the following steps: Establish a performance layer space load awareness mechanism for current storage services; The space allocation service senses whether the current storage service is a high-load node; if so, it triggers the sinking mechanism and the triggering of the performance layer space load perception mechanism, controls the current storage service and all storage services in the current cluster except the current storage service to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and scans in sequence from cold to hot to obtain the sinking small data blocks; and sinks the sinking small data blocks into the capacity layer until the space allocation service senses that the current storage service is not a high-load node.
8. A method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage according to claim 7, characterized in that: The performance layer space load perception mechanism refers to a mechanism by which the current storage service can perceive the load status of all storage services in the current cluster except the current storage service.
9. A method for alleviating local overload of performance layer space in hierarchical distributed block storage according to claim 8, characterized in that: Control the current storage service and all storage services in the current cluster except the current storage service to jointly scan the tail of the LRU linked list corresponding to the LRU mechanism in the current storage service, and scan in sequence from cold to hot to obtain the sinking small data blocks, including the following steps: Obtain the access frequency Ti of the i-th small data block in the current storage service within a preset access time period; calculate the access priority Pi of the i-th small data block based on the access frequency combined with the hot and cold data Wi of the i-th small data block; Sort the small data blocks from high to low based on the access priority Pi to obtain a first LRU linked list sequence set; Get the space load rate of each storage service in the current cluster except the current storage service; Obtaining a linkage service priority sequence set based on the order of the spatial load rate from low to high; The maximum data volume of the current storage service is calculated based on the maximum threshold of the space load rate; The retained data amount is calculated based on the accumulation of the data amounts of the small data blocks from high to low in the first LRU linked list sequence; Calculate the maximum number of small data blocks whose retained data volume is less than or equal to the maximum data volume of the current storage service; The total number of small data blocks to be sunk is calculated based on the maximum number of small data blocks and the total number of small data blocks currently stored in the storage service; Based on the ranking of each storage service in the linkage service priority sequence set, small data blocks with a total number of small data blocks sinking from low to high in the first LRU linked list sequence set are selected from high to low to scan and obtain L n A small data block sinks.
10. A method for alleviating local excessive load on the performance layer space of hierarchical distributed block storage according to claim 9, characterized in that: The access priority Pi is calculated as follows: Pi = Ti × α + Wi × β; In the formula, α and β are weight coefficients, and β>α; The L n The calculation method for a small data block is: Where k is the kth storage service ranked from high to low in the linkage service priority sequence; N is the total number of small data blocks that are sunk; and floor() is a rounding function.
Citation Information
Patent Citations
Data scheduling method based on gradation storage medium
CN103106152A
Cluster node load state prediction-based cold and hot region division energy-saving storage method
CN110096350A
Data storage system, data processing method, terminal and storage medium
CN114063888A
Multi-node load balancing cold and hot data migration device and method, terminal and medium
CN115079958A
Elastic load balancing method and system of hyper-converged system
CN115225642A