I / O resource management method for distributed system and related equipment
By periodically obtaining and allocating I/O resources, the problem of overloading I/O resources when multiple nodes in a distributed system is solved, and balanced resource allocation and system performance are achieved.
Patent Information
- Application Number
- CN202411701362.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-28
AI Technical Summary
When multiple nodes in a distributed system share the same storage system, I/O resources may be overloaded, affecting the performance of the storage system, and read and write errors may occur.
By periodically obtaining the I/O resource usage of each node, estimating the I/O resource application amount in the current cycle, and allocating the corresponding I/O resource allocation amount to each node based on the total pre-configured I/O resources to ensure that the node can access the storage system normally within the current cycle.
It realizes the balanced and reasonable allocation of limited I/O resources in multiple nodes, avoids overload and hunger states of I/O resources, and improves the overall performance of distributed systems and storage systems.
Smart Images

Figure CN119536658A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of resource management technology, and in particular, to an I / O resource management method and related devices for a distributed system. Background Art
[0002] A distributed system is a system that is composed of multiple computers connected through a network to work together to complete tasks. These computers are usually called nodes, and multiple nodes can communicate with each other through the network, share resources and data, and achieve common goals.
[0003] In some cases, multiple nodes in a distributed system may share the same storage system, and each of these multiple nodes can access the storage system and perform corresponding read and write operations on the data stored in the storage system. However, the I / O resources of a storage system are limited. If multiple nodes frequently access the storage system at the same time and frequently read and write data in the storage system, it will cause the I / O of the storage system to be overloaded, affecting the performance of the storage system, and may cause a large number of read and write errors. Alternatively, if one of the multiple nodes unreasonably occupies a large number of I / O resources, it will cause other nodes to be unable to access the storage system normally, affecting the performance of other nodes, and thus seriously reducing the overall performance of the distributed system.
[0004] Based on this, how to strictly and accurately manage the I / O resources of multiple nodes in a distributed system is an urgent problem to be solved. Summary of the invention
[0005] In view of this, one or more embodiments of the present specification provide an I / O resource management method and related devices for a distributed system.
[0006] In a first aspect, this specification provides an I / O resource management method for a distributed system, wherein the distributed system includes a plurality of nodes, and the plurality of nodes share a storage system; the method includes:
[0007] According to a preset cycle duration, periodically obtaining the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle, and estimating the I / O resource application amount for the storage system in the current cycle;
[0008] Obtaining the total amount of I / O resources preconfigured for the storage system in the current cycle;
[0009] Based on the respective I / O resource application amounts of the multiple nodes, corresponding I / O resource allocation amounts are allocated to the multiple nodes from the total I / O resource amount, so that the nodes access the storage system based on the allocated I / O resource allocation amounts in the current cycle.
[0010] In a second aspect, the present specification provides an I / O resource management device for a distributed system, wherein the distributed system includes a plurality of nodes, and the plurality of nodes share a storage system; the device includes:
[0011] A resource application amount acquisition unit, used to periodically acquire the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and estimate the I / O resource application amount for the storage system in the current cycle;
[0012] A total resource acquisition unit, used to acquire the total I / O resource preconfigured for the storage system in the current cycle;
[0013] A resource allocation unit is used to allocate corresponding I / O resource allocation amounts to the multiple nodes from the total I / O resource amount based on the I / O resource application amounts of each of the multiple nodes, so that the nodes access the storage system based on the allocated I / O resource allocation amounts in the current cycle.
[0014] Accordingly, this specification also provides a computing device, comprising: a memory and a processor; the memory stores computer programs / instructions that can be executed by the processor; when the processor executes the computer program / instructions, it executes the I / O resource management method for a distributed system described in the first aspect above.
[0015] Accordingly, the present specification also provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the I / O resource management method for a distributed system as described in the first aspect above is executed.
[0016] Accordingly, the present specification also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the I / O resource management method for a distributed system as described in the first aspect above is executed.
[0017] In summary, the distributed system can periodically obtain the I / O resource application amount that each node wants to use for the storage system in the current cycle according to the preset cycle duration, and the I / O resource application amount can be estimated by each node based on its I / O resource usage in the previous cycle. Then, according to the I / O resource application amount of each node in the current cycle, from the total amount of I / O resources preconfigured for the storage system, a suitable I / O resource allocation amount can be allocated to each node, so that each node can access the storage system based on its own I / O resource allocation amount in the current cycle. In this way, the distributed system in this application will allocate an I / O resource allocation amount that matches the I / O resource usage of the previous cycle to each node in each cycle, realizing a balanced and reasonable allocation of limited I / O resources in multiple nodes, ensuring that each node obtains I / O resources fairly, avoiding a hungry state (i.e., being unable to access the storage system normally), and reasonably providing more I / O resources to busier nodes, thereby providing users with more reliable data services. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a schematic diagram of a system architecture provided by an exemplary embodiment;
[0019] Figure 2 It is a flowchart of an I / O resource management method for a distributed system provided by an exemplary embodiment;
[0020] Figure 3 This is a schematic diagram of an I / O resource allocation process provided by an exemplary embodiment;
[0021] Figure 4 is a schematic diagram of another I / O resource allocation process provided by an exemplary embodiment;
[0022] Figure 5 It is a schematic diagram of another I / O resource allocation process provided by an exemplary embodiment;
[0023] Figure 6 is another system architecture schematic diagram provided by an exemplary embodiment;
[0024] Figure 7 It is a flowchart of another I / O resource management method for a distributed system provided by an exemplary embodiment;
[0025] Figure 8 It is a structural diagram of an I / O resource management device for a distributed system provided by an exemplary embodiment;
[0026] Fig. 9 It is a structural diagram of a computing device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0028] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0029] It should be noted that the “plurality” mentioned in this application refers to two or more than two.
[0030] In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0031] This specification provides a technical solution that can allocate an appropriate amount of I / O resources to each node in the distributed system in the current cycle based on the I / O resource usage of each node in the storage system in the previous cycle, thereby achieving balanced and reasonable distribution of limited I / O resources among multiple nodes and ensuring the overall performance of the distributed system.
[0032] In implementation, a distributed system may include multiple nodes, and the multiple nodes may share a storage system. In an illustrated embodiment, the present application may periodically obtain the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and estimate the I / O resource application amount for the storage system in the current cycle. Further, the total amount of I / O resources preconfigured for the storage system in the current cycle may be obtained. Further, based on the I / O resource application amount of each of the multiple nodes, corresponding I / O resource allocation amounts may be allocated to the multiple nodes from the total amount of I / O resources, so that each node may access the storage system based on the allocated I / O resource allocation amount in the current cycle.
[0033] In the above technical scheme, the distributed system can periodically obtain the I / O resource application amount that each node wants to use for the storage system in the current cycle according to the preset cycle duration, and the I / O resource application amount can be estimated by each node based on its I / O resource usage in the previous cycle. Then, according to the I / O resource application amount of each node in the current cycle, from the total amount of I / O resources preconfigured for the storage system, a suitable I / O resource allocation amount can be allocated to each node respectively, so that each node can access the storage system based on its own I / O resource allocation amount in the current cycle. In this way, the distributed system in this application will allocate an I / O resource allocation amount that matches the I / O resource usage of the previous cycle to each node in each cycle, realizing a balanced and reasonable allocation of limited I / O resources in multiple nodes, ensuring that each node obtains I / O resources fairly, avoiding a hungry state (i.e., being unable to access the storage system normally), and reasonably providing more I / O resources to busier nodes, thereby providing users with more reliable data services.
[0034] See also Figure 1 , Figure 1 This is a schematic diagram of a system architecture provided by an exemplary embodiment. One or more embodiments provided in this specification may be Figure 1 The system architecture shown in the figure or a similar system architecture is specifically implemented. Figure 1 As shown, the system architecture may include a distributed system 10 and a storage system 20. The distributed system 10 may include multiple nodes (Servers), such as node 100a, node 100b and node 100c, wherein node 100a may be a master node (RootServer, RS), and node 100b and node 100c may be slave nodes, which is not specifically limited in this specification.
[0035] like Figure 1As shown, the nodes 100a, 100b and 100c in the distributed system 10 can share the storage system 20, that is, the nodes 100a, 100b and 100c can all access the storage system 20 to perform corresponding read and write operations on the data stored in the storage system 20. Considering that the I / O resources of the storage system 20 are limited, or the access traffic that the storage system 20 can afford is limited, therefore, when the nodes 100a, 100b and 100c share the storage system 20, it is necessary to reasonably allocate the limited I / O resources to each node, thereby reasonably limiting the traffic of each node to ensure the performance of each node and the storage system 20.
[0036] Next, we will combine Figure 1 The system architecture shown describes the I / O resource management method for distributed systems provided by the present application.
[0037] In one illustrated embodiment, node 100a, serving as a master node, may periodically obtain the amount of I / O resources requested by all nodes (including node 100a, node 100b, and node 100c) sharing the storage system 20 for the current cycle according to a preset cycle duration.
[0038] The amount of I / O resources requested by each node for the storage system 20 in the current cycle may represent the amount of I / O resources that each node wants to use or requires in the current cycle.
[0039] In an illustrated embodiment, each node can estimate the I / O resource application amount for the storage system 20 in the current cycle based on the I / O resource usage of the storage system 20 in the previous cycle. The specific estimation method can refer to the following Figure 2 The description of the corresponding embodiments will not be repeated here.
[0040] In an illustrated embodiment, when acquiring the I / O resource application amount of all nodes, node 100a may first periodically send acquisition requests for the I / O resource application amount of the current cycle to node 100b and node 100c, which are slave nodes, respectively, according to a preset cycle duration. Accordingly, in response to the received acquisition request, node 100b and node 100c may estimate the I / O resource application amount for the storage system 20 in the current cycle based on the I / O resource usage for the storage system 20 in the previous cycle, and send the estimated I / O resource application amount to node 100a. Accordingly, node 100a may receive the I / O resource application amount for the storage system 20 in the current cycle sent by node 100b and node 100c, respectively. Furthermore, node 100a can also periodically estimate the I / O resource application amount of node 100a for the storage system 20 in the current cycle based on the I / O resource usage of node 100a for the storage system 20 in the previous cycle according to a preset cycle duration.
[0041] At this point, the node 100a has obtained the I / O resource application amount of each of the nodes 100a, 100b and 100c for the storage system 20 in the current cycle.
[0042] Furthermore, the node 100a may obtain the total amount of I / O resources preconfigured for the storage system 20 in the current cycle.
[0043] Further, the node 100a can allocate a corresponding I / O resource allocation amount to each node from the pre-configured I / O resource total amount based on the I / O resource application amount of each node 100a, node 100b and node 100c. For details, please refer to the following Figure 2 The description of the corresponding embodiment will not be repeated here. In this way, in the current cycle, the I / O resources that each node can occupy are equal to the I / O resource allocation amount allocated to each node, so as to limit each node to reasonably access the storage system 20 based on the allocated I / O resource allocation amount.
[0044] It should be noted that this specification does not specifically limit the specific types of I / O resources. In an illustrated embodiment, the I / O resources may include any one or more combinations of the following I / O resources:
[0045] Input Per Second (IPS), which stands for the number of input operations per second;
[0046] Operations Per Second (OPS) represents the number of operations performed per second, which includes any type of operation, such as write operations and read operations;
[0047] Input / Output Operations Per Second (IOPS) represents the number of input and output operations per second and is a key indicator for measuring storage system performance.
[0048] Input Bandwidth (IBW), which represents the speed at which data is transmitted into the storage system;
[0049] Output Bandwidth (OBW) represents the speed at which data is transmitted from the storage system;
[0050] Total input / output bandwidth (IOBW), which represents the sum of input bandwidth and output bandwidth;
[0051] Tags are metadata used to identify and classify storage objects. Tags can add extra information to objects to help users organize, search, and manage data more conveniently. In some aspects, tags can also be used as an I / O resource of the storage system.
[0052] It should be noted that this specification does not specifically limit the specific type of the storage system 20. In an embodiment shown, the storage system 20 can be a storage system based on object storage, or a storage system based on file storage or table storage, etc., and this specification does not specifically limit this.
[0053] It should be noted that this specification does not specifically limit the specific duration of the above cycle. In an embodiment shown, it can be 3 seconds per cycle, or 5 seconds per cycle, etc. This specification does not specifically limit this, and the user can set the appropriate cycle duration according to actual conditions or needs.
[0054] In one illustrated embodiment, Figure 1 The node 100a, node 100b and node 100c shown may be servers with the above functions, or a server cluster composed of multiple servers, or some components in a server, etc., and this specification does not make specific limitations on this.
[0055] It should be understood that Figure 1 The system architecture shown is only for illustrative purposes. In some possible implementations, the system architecture may also include Figure 1 The more or fewer devices shown may include, for example, more nodes, which is not specifically limited in this specification.
[0056] See also Figure 2 , Figure 2is a flowchart of an I / O resource management method for a distributed system provided by an exemplary embodiment. The method can be applied to Figure 1 The system architecture shown can be applied to Figure 1 The distributed system shown in FIG. 1 is a node 100a serving as a master node; wherein the distributed system includes multiple nodes that can share a storage system. Figure 2 As shown, the method may specifically include the following steps S201 to S203.
[0057] Step S201, periodically obtaining the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and estimating the I / O resource application amount for the storage system in the current cycle.
[0058] As described above, the distributed system includes multiple nodes, and the multiple nodes can share a storage system. In an illustrated embodiment, the I / O resource usage of the multiple nodes for the storage system in the previous cycle can be periodically obtained according to a preset cycle duration, and the I / O resource application amount for the storage system in the current cycle can be estimated.
[0059] In an illustrated embodiment, the plurality of nodes may include a master node and at least one slave node. The master node may periodically send an acquisition request for the I / O resource application amount of the current cycle to the at least one slave node according to a preset cycle duration. Exemplarily, the master node may send an acquisition request for the I / O resource application amount to the at least one slave node by remote procedure call (RPC).
[0060] Accordingly, each slave node can calculate the I / O resource application amount required for the current cycle according to its actual needs in response to the received acquisition request. Specifically, each slave node can estimate the I / O resource application amount for the storage system in the current cycle based on its I / O resource usage for the storage system in the previous cycle, and send the estimated I / O resource application amount to the master node. Exemplarily, the slave node can also send the estimated I / O resource application amount to the master node via RPC.
[0061] Accordingly, the master node may receive the I / O resource application amount sent by the at least one slave node. In addition, the master node may also periodically estimate the I / O resource application amount of the master node for the storage system in the current cycle based on the master node's own I / O resource usage for the storage system in the previous cycle according to a preset cycle duration.
[0062] At this point, the master node obtains the I / O resource application amount of each of the multiple nodes in the distributed system that share the same storage system in the current cycle.
[0063] In an illustrated embodiment, when each node estimates the I / O resource application amount for the storage system in the current cycle, it can specifically include: determining whether the I / O resource usage for the storage system in the previous cycle is less than the I / O resource allocation in the previous cycle; if so, multiplying the I / O resource usage in the previous cycle by a preset first application coefficient, and the multiplication result is used as the I / O resource application amount for the storage system in the current cycle; if not, multiplying the I / O resource usage in the previous cycle by a preset second application coefficient, and the multiplication result is used as the I / O resource application amount for the storage system in the current cycle.
[0064] In an illustrated embodiment, the first application coefficient and the second application coefficient may be greater than 1, and the first application coefficient is smaller than the second application coefficient. For example, the first application coefficient may be 1.2, and the second application coefficient may be 1.5, which is not specifically limited in this specification.
[0065] For example, the calculation method of the I / O resource application amount of each node in the current cycle can be shown in the following formula (1):
[0066]
[0067] Among them, B next is the I / O resource request amount in the current cycle, B actual is the actual I / O resource usage in the previous cycle, B prev is the I / O resource allocation in the previous cycle. 1.2 is the first application coefficient. actual Less than B prev When B next =1.2×B actual ; 1.5 is the second application coefficient, when B actual Greater than or equal to B prev When B next =1.5×B actual .
[0068] For example, assuming that the I / O resource allocation of a node in the previous cycle is 100M / s, but its actual I / O resource usage is only 80M / s, then the I / O resource application amount calculated by the node in the current cycle is 80×1.2=96M / s.
[0069] For example, assuming that the I / O resource allocation of a node in the previous cycle is 100M / s, and the actual I / O resource usage also reaches 100M / s, the I / O resource application amount calculated by the node in the current cycle is 100×1.5=150M / s.
[0070] It should be understood that the first application coefficient equal to 1.2 and the second coefficient equal to 1.5 can ensure to a great extent that the resource usage of a single node is stable or does not decrease rapidly, and when other nodes are idle, more available resources are quickly allocated to busy nodes, thereby ensuring the performance of the entire distributed system and storage system.
[0071] Step S202: Obtain the total amount of I / O resources preconfigured for the storage system in the current cycle.
[0072] Furthermore, after obtaining the I / O resource application amount of each of the multiple nodes sharing the same storage system in the current cycle, the master node may also obtain the total amount of I / O resources preconfigured for the storage system in the current cycle.
[0073] In an illustrated implementation, the total amount of I / O resources may be a value set by the user. The user may also dynamically adjust the total amount of I / O resources periodically according to actual conditions or needs, and this specification does not specifically limit this.
[0074] Step S203: Based on the I / O resource application amounts of the multiple nodes respectively, corresponding I / O resource allocation amounts are allocated to the multiple nodes from the total I / O resource amount.
[0075] Furthermore, the master node can allocate corresponding I / O resource allocation amounts to the multiple nodes from the pre-configured I / O resource total amount based on the respective I / O resource application amounts of the multiple nodes. Exemplarily, the master node can also broadcast the I / O resource allocation amount of each node to each node through RPC.
[0076] It should be noted that this specification does not specifically limit the allocation strategy of I / O resources. In one embodiment shown, the allocation strategy of I / O resources can generally be to first satisfy the nodes whose I / O resource applications do not reach the average amount, and the remaining amount of the total I / O resources can be equally divided among other nodes.
[0077] In an illustrated embodiment, the I / O resource application amounts of multiple nodes may be sorted from small to large, and then each node may be traversed in sequence according to the sorted order. During the traversal process, the remaining amount of I / O resources that have not yet been allocated in the total amount of I / O resources may be obtained, and based on the current remaining amount of I / O resources and the number of all remaining nodes that have not yet been allocated, the average remaining amount of I / O resources that can be allocated to all the remaining nodes on average may be calculated. It should be understood that before the traversal begins, or when the first node is traversed, the current remaining amount of I / O resources is equal to the preconfigured total amount of I / O resources, and the current average remaining amount of I / O resources is equal to the average amount of I / O resources that are allocated to all nodes on average from the total amount of I / O resources.
[0078] In an illustrated embodiment, for the currently traversed node, the current remaining I / O resource amount and the average remaining I / O resource amount can be obtained first. If the I / O resource application amount of the currently traversed node is less than or equal to the current average remaining I / O resource amount, then the I / O resource can be allocated to it according to the I / O resource application amount of the node, that is, the node is allocated an I / O resource allocation amount equal to its I / O resource application amount. Furthermore, the I / O resource application amount allocated to the node can be subtracted from the current remaining I / O resource amount to obtain a new remaining I / O resource amount, and based on the new remaining I / O resource amount and the number of remaining nodes that have not yet been allocated, a new remaining I / O resource average amount is calculated, and then traversed to the next node, and so on.
[0079] In an illustrated embodiment, if the I / O resource request amount of the currently traversed node is greater than the current average remaining I / O resources, this means that the current remaining I / O resources will not be sufficient to meet the needs of the current node and all subsequent remaining nodes, because the I / O resource request amount of the node that is closer in order is larger. Therefore, the current remaining I / O resources can be evenly distributed to the current node and all subsequent remaining nodes, that is, the current node and all subsequent remaining nodes are allocated an I / O resource allocation amount equal to the current average remaining I / O resources, and the current remaining I / O resources are updated to 0, and then the loop is terminated.
[0080] In one illustrated embodiment, if after the traversal is completed, there are still unallocated I / O resources remaining in the total amount of I / O resources, that is, there are still remaining I / O resources, then the unallocated I / O resources remaining can be evenly distributed to all nodes, and this specification does not make any specific limitations on this.
[0081] Exemplarily, the pseudo code for allocating I / O resources to each node may be as follows:
[0082] def cal_server_iops_limit(usage,total_limit):
[0083] usage = sorted(usage)
[0084] ret=[]
[0085] for i in range(len(usage)):
[0086] avg=total_limit / (len(usage)-i)
[0087] if usage[i] <avg:
[0088] ret+=[usage[i]]
[0089] total_limit - = usage[i]
[0090] else:
[0091] ret+=[avg]*(len(usage)-i)
[0092] total_limit=0
[0093] break
[0094] if total_limit>0:
[0095] #If there is a surplus, divide it equally among all servers
[0096] for i in range(len(ret)):
[0097] ret[i]+=total_limit / len(ret)
[0098] return ret
[0099] Among them, usage is the I / O resource application amount of each node (for example, the applied IOPS value), total_limit is the current remaining I / O resource amount (in the initial state, the remaining I / O resource amount is equal to the total I / O resource amount), and avg is the current remaining average I / O resource amount (in the initial state, the remaining average I / O resource amount is equal to the average I / O resource amount).
[0100] The steps included in the above pseudo code can be as follows:
[0101] 1. Sorting: Sort the usage of multiple nodes from small to large to ensure that nodes with smaller I / O resource requirements are processed first to meet the I / O resource requirements of more nodes as much as possible.
[0102] 2. I / O resource allocation: traverse the sorted usage and calculate the average remaining amount of I / O resources avg that can be allocated to the remaining nodes based on the current remaining amount of I / O resources total_limit.
[0103] If the usage of the currently traversed node is less than or equal to avg, I / O resources are allocated to it according to the usage of the node, and the usage of the node is subtracted from total_limit.
[0104] If the usage of the currently traversed node is greater than avg, it means that total_limit will not be enough to meet the needs of all current and subsequent nodes. At this time, total_limit can be evenly distributed to the remaining nodes, and total_limit is set to 0, then the loop is terminated.
[0105] 3. Evenly distribute the remaining resources: If there are remaining I / O resources after the traversal is completed (that is, total_limit>0), the remaining I / O resources can be evenly distributed to all nodes.
[0106] 4. Return result: Output the I / O resource allocation of each node.
[0107] In some possible implementations, in addition to the above-mentioned I / O resource allocation strategy of traversing each node in sequence, other similar I / O resource allocation strategies may also be adopted, and this specification does not make specific limitations on this.
[0108] In an illustrated embodiment, the master node may first calculate the average amount of I / O resources corresponding to the multiple nodes based on the total amount of preconfigured I / O resources and the number of multiple nodes. Further, the master node may directly compare the I / O resource application amounts of the multiple nodes with the average amount of I / O resources, and allocate I / O resource allocation amounts that match the I / O resource application amounts of the multiple nodes based on the comparison results.
[0109] In an illustrated embodiment, when the master node allocates I / O resource allocation amounts that match the I / O resource application amounts of the multiple nodes respectively based on the comparison results, it can specifically include: determining from the multiple nodes a number of first nodes whose I / O resource application amounts are less than or equal to the average I / O resource amount, and a number of second nodes whose I / O resource application amounts are greater than the average I / O resource amount; further, from the total amount of I / O resources, first allocating I / O resource allocation amounts equal to the I / O resource application amounts of the several first nodes; further, calculating the remaining I / O resources in the total amount of I / O resources after allocating the I / O resource allocation amounts to the several first nodes; further, allocating I / O resource allocation amounts that match the I / O resource application amounts to the several second nodes from the remaining I / O resources.
[0110] In an illustrated embodiment, the allocation strategy adopted by the master node when allocating I / O resource allocation amounts that match the I / O resource application amounts of the second nodes from the remaining I / O resources is the same as the overall allocation strategy, and it is still necessary to calculate the average amount of I / O resources, and give priority to nodes whose I / O resource application amounts do not reach the average amount of I / O resources. Specifically, the master node can calculate the average amount of remaining I / O resources corresponding to the second nodes based on the remaining I / O resources and the number of the second nodes; further, the master node can compare the I / O resource application amounts of the second nodes with the average amount of remaining I / O resources, and allocate the I / O resource allocation amounts that match the I / O resource application amounts of the second nodes based on the comparison results.
[0111] In an illustrated embodiment, when the master node allocates I / O resource allocation amounts that match the I / O resource application amounts of the second nodes based on the comparison result, the method may specifically include: if the I / O resource application amounts of the second nodes are all greater than the remaining average amount of the I / O resources, then allocate I / O resource allocation amounts that are equal to the remaining average amount of the I / O resources to the second nodes; if the I / O resource application amounts of at least some of the second nodes are less than or equal to the remaining average amount of the I / O resources, then allocate I / O resource allocation amounts to the second nodes from the remaining amount of the I / O resources. Allocate an I / O resource allocation amount equal to its I / O resource application amount, and allocate corresponding I / O resource allocation amounts to other second nodes from the remaining I / O resource remaining amount, and so on; if the I / O resource application amounts of several second nodes are less than or equal to the average remaining I / O resource amount, then the several second nodes can be respectively allocated an I / O resource allocation amount equal to their I / O resource application amount, and further, if there are still remaining I / O resources after the allocation is completed, the remaining I / O resources can be evenly distributed to multiple nodes again, and so on. This manual does not make specific limitations on this.
[0112] The I / O resource allocation strategy provided in this specification will be described below through several specific examples.
[0113] Example 1:
[0114] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of an I / O resource allocation process provided by an exemplary embodiment. Figure 3 As shown, the distributed system includes nodes a, b, c, d and e, and any of the multiple nodes can be a master node. The multiple nodes share a storage system, and the total amount of I / O resources preconfigured for the storage system in the current cycle is 15M / s.
[0115] like Figure 3 As shown, the I / O resource application amount of node a in the current cycle is 3M / s, the I / O resource application amount of node b in the current cycle is 5M / s, the I / O resource application amount of node c in the current cycle is 5M / s, the I / O resource application amount of node d in the current cycle is 1M / s, and the I / O resource application amount of node e in the current cycle is 2M / s.
[0116] like Figure 3 As shown, the I / O resource application amounts of multiple nodes are sorted from small to large, and the sorted order is node d, node e, node a, node b and node C. Further, each node can be traversed in turn according to the sorted order, and the corresponding I / O resource allocation amount can be allocated to each node.
[0117] like Figure 3 As shown, when traversing to node d, the current remaining I / O resource amount is 15M / s, and the current remaining average I / O resource amount is 3M / s. Since the I / O resource application amount of node d is 1M / s, which is less than the current remaining average I / O resource amount, node d can be allocated an I / O resource allocation amount equal to its I / O resource application amount, that is, 1M / s.
[0118] like Figure 3 As shown in the figure, after completing the I / O resource allocation for node d, it is necessary to subtract the allocated 1M / s from the current I / O resource remaining amount, so that the new I / O resource remaining amount is 14M / s. Correspondingly, the number of nodes that have not been allocated is changed to 4, so the new I / O resource remaining average amount is calculated to be 3.5M / s.
[0119] like Figure 3As shown, when traversing to node e, the current remaining I / O resource amount is 14M / s, and the current remaining average I / O resource amount is 3.5M / s. Since the I / O resource application amount of node e is 2M / s, which is less than the current remaining average I / O resource amount, node e can be allocated an I / O resource allocation amount equal to its I / O resource application amount, that is, 2M / s.
[0120] like Figure 3 As shown in the figure, after completing the I / O resource allocation for node e, it is necessary to subtract the allocated 2M / s from the current I / O resource remaining amount, so that the new I / O resource remaining amount is 12M / s. Correspondingly, the number of nodes that have not been allocated is changed to 3, so the new I / O resource remaining average amount is calculated to be 4M / s.
[0121] like Figure 3 As shown, when traversing to node a, the current remaining I / O resource amount is 12M / s, and the current remaining average I / O resource amount is 4M / s. Since the I / O resource application amount of node a is 3M / s, which is less than the current remaining average I / O resource amount, node a can be allocated an I / O resource allocation amount equal to its I / O resource application amount, that is, 3M / s.
[0122] like Figure 3 As shown in the figure, after completing the I / O resource allocation for node a, it is necessary to subtract the allocated 3M / s from the current I / O resource remaining amount, so that the new I / O resource remaining amount is 9M / s. Correspondingly, the number of nodes that have not been allocated is changed to 2, so the new I / O resource remaining average amount is calculated to be 4.5M / s.
[0123] like Figure 3 As shown, when traversing to node b, the current remaining I / O resource amount is 9M / s, and the current remaining average I / O resource amount is 4.5M / s. Since the I / O resource application amount of node b is 5M / s, which is greater than the current remaining average I / O resource amount, the node b and the subsequent node c can be allocated an I / O resource allocation amount equal to the current remaining average I / O resource amount, that is, 4.5M / s.
[0124] So far, the I / O resource allocation to nodes a, b, c, d, and e has been completed.
[0125] Example 2:
[0126] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of another I / O resource allocation process provided by an exemplary embodiment. Figure 4As shown, the distributed system includes nodes a, b, c, d and e, and any of the multiple nodes can be a master node. The multiple nodes share a storage system, and the total amount of I / O resources preconfigured for the storage system in the current cycle is 15M / s.
[0127] like Figure 4 As shown, the I / O resource application amount of node a in the current cycle is 3M / s, the I / O resource application amount of node b in the current cycle is 4M / s, the I / O resource application amount of node c in the current cycle is 4M / s, the I / O resource application amount of node d in the current cycle is 1M / s, and the I / O resource application amount of node e in the current cycle is 2M / s.
[0128] like Figure 4 As shown, the I / O resource application amounts of multiple nodes are sorted from small to large, and the sorted order is node d, node e, node a, node b and node C. Further, each node can be traversed in turn according to the sorted order, and the corresponding I / O resource allocation amount can be allocated to each node.
[0129] In an illustrated embodiment, the I / O resource allocation process for node d, node e, and node a can refer to the above Figure 3 The description of the corresponding embodiments will not be repeated here.
[0130] like Figure 4 As shown, when traversing to node b, the current remaining I / O resource amount is 9M / s, and the current remaining average I / O resource amount is 4.5M / s. Since the I / O resource application amount of node b is 4M / s, which is less than the current remaining average I / O resource amount, node b can be allocated an I / O resource allocation amount equal to its I / O resource application amount, that is, 4M / s.
[0131] like Figure 4 As shown in the figure, after completing the I / O resource allocation for node b, it is necessary to subtract the allocated 4M / s from the current I / O resource remaining amount, so that the new I / O resource remaining amount is 5M / s. Correspondingly, the number of nodes that have not been allocated is changed to 1, so the new I / O resource remaining average amount is calculated to be 5M / s.
[0132] like Figure 4 As shown, when traversing to node c, the current remaining I / O resource amount is 5M / s, and the current remaining average I / O resource amount is 5M / s. Since the I / O resource application amount of node c is 4M / s, which is less than the current remaining average I / O resource amount, node c can be allocated an I / O resource allocation amount equal to its I / O resource application amount, that is, 4M / s.
[0133] like Figure 4As shown in the figure, after the I / O resource allocation to all nodes is completed, there is still 1M / s of I / O resource remaining. At this time, the final remaining I / O resource can be evenly distributed to all nodes, that is, 0.2M / s of I / O resource is allocated to all nodes again. Figure 4 As shown, node d finally obtains an I / O resource allocation of 1.2 M / s, node e obtains an I / O resource allocation of 2.2 M / s, node a obtains an I / O resource allocation of 3.2 M / s, node b obtains an I / O resource allocation of 4.2 M / s, and node c obtains an I / O resource allocation of 4.2 M / s.
[0134] So far, the I / O resource allocation to nodes a, b, c, d, and e has been completed.
[0135] Example 3:
[0136] See also Figure 5 , Figure 5 FIG. 1 is another schematic diagram of an allocation process of I / O resources provided by an exemplary embodiment. Figure 5 As shown, the distributed system includes nodes a, b, c, d and e, and any of the multiple nodes can be a master node. The multiple nodes share a storage system, and the total amount of I / O resources preconfigured for the storage system in the current cycle is 15M / s.
[0137] like Figure 5 As shown, the I / O resource application amount of node a in the current cycle is 3M / s, the I / O resource application amount of node b in the current cycle is 5M / s, the I / O resource application amount of node c in the current cycle is 5M / s, the I / O resource application amount of node d in the current cycle is 1M / s, and the I / O resource application amount of node e in the current cycle is 2M / s.
[0138] like Figure 5 As shown, the I / O resource application amounts of multiple nodes are sorted from small to large, and the sorted order is node d, node e, node a, node b and node c. Alternatively, the subsequent I / O resource allocation process can be directly executed without sorting, and this specification does not make specific restrictions on this.
[0139] like Figure 5 As shown, the average amount of I / O resources calculated based on the total amount of I / O resources 15M / s is 3M / s. Then, the I / O resource application amount of each node can be compared with the average amount of I / O resources.
[0140] like Figure 5As shown, since the I / O resource application amounts of node d, node e and node a are all less than or equal to the average amount of I / O resources, node d, node e and node a can be respectively allocated I / O resource allocations equal to their I / O resource application amounts, that is, 1 M / s of I / O resource allocation amount is allocated to node d, 2 M / s of I / O resource allocation amount is allocated to node e, and 3 M / s of I / O resource allocation amount is allocated to node a.
[0141] like Figure 5 As shown in the figure, after completing the I / O resource allocation for nodes d, e, and a, the allocated 6M / s needs to be subtracted from the current I / O resource remaining amount, so that the new I / O resource remaining amount is 9M / s. Correspondingly, the number of nodes that have not been allocated is changed to 2, so the new I / O resource remaining average amount is calculated to be 4.5M / s. Then, the remaining I / O resource application amounts of nodes b and c can be compared with the new I / O resource remaining average amount.
[0142] like Figure 5 As shown, since the I / O resource application amount of node b and node c is 5M / s, which is greater than the current average remaining I / O resource amount, node b and node c can be allocated an I / O resource allocation amount equal to the current average remaining I / O resource amount, that is, 4.5M / s.
[0143] So far, the I / O resource allocation to nodes a, b, c, d, and e has been completed.
[0144] In addition, in some possible implementations, if the master node in the distributed system does not share a storage system with the slave nodes, that is, multiple nodes of the shared storage system are all slave nodes in the distributed system (that is, node a, node b, node c, node d and node e in the above example can all be slave nodes), then the master node does not need to estimate its own I / O resource application amount for the current cycle, but can allocate corresponding I / O resource allocation amounts to these multiple slave nodes based on the received I / O resource application amounts of the multiple slave nodes for the current cycle, and so on. This specification does not make specific limitations on this.
[0145] Alternatively, in some possible implementations, the master node may also perform the above-mentioned I / O resource application amount estimation process. For example, each slave node may directly send its I / O resource usage in the previous cycle to the master node, and accordingly, the master node may estimate the I / O resource application amount of each slave node in the current cycle based on the received I / O resource usage of each slave node in the previous cycle and the I / O resource allocation amount allocated to each slave node in the previous cycle, etc. This specification does not make specific limitations on this.
[0146] For further information, see Figure 6, Figure 6 is another system architecture diagram provided by an exemplary embodiment. One or more embodiments provided in this specification may be Figure 6 The present invention is specifically implemented in the system architecture shown or a similar system architecture.
[0147] like Figure 6 As shown, the storage system 20 may be a storage system based on object storage service (OSS). Object storage is a data storage architecture mainly used to store a large amount of unstructured data, such as documents, images, videos, etc. In object storage, data is managed as objects, and each object may contain the data itself, metadata, and a unique identifier.
[0148] like Figure 6 As shown, the storage system 20 may include multiple buckets, such as bucket 200a and bucket 200b, etc., and each bucket may store corresponding object data. Accordingly, each node in the distributed system 10 may be connected to any one or more of the multiple buckets to access the object data stored in the one or more buckets.
[0149] like Figure 6 As shown, when nodes 100a, 100b and 100c in the distributed system 10 share the storage system 20, they can specifically be any one or more storage buckets in the shared storage system 20. For example, node 100a and node 100b can share storage bucket 200a, node 100b and node 100c can share storage bucket 200b, and so on.
[0150] As described above, the I / O resources of the storage system 20 are limited, and accordingly, the I / O resources of each storage bucket in the storage system 20 are also limited. Based on this, when the present application allocates I / O resources to each node, it can specifically allocate to each node the I / O resources of one or more storage buckets connected to it.
[0151] like Figure 6 As shown, if node 100a and node 100b share storage bucket 200a, it is necessary to allocate appropriate I / O resources to node 100a and node 100b respectively from the total amount of I / O resources pre-configured for storage bucket 200a; if node 100b and node 100c share storage bucket 200b, it is necessary to allocate appropriate I / O resources to node 100b and node 100c respectively from the total amount of I / O resources pre-configured for storage bucket 200a. The specific I / O resource allocation method can refer to the above Figure 1-5 The description of the corresponding embodiments will not be repeated here.
[0152] In one illustrated embodiment, see Figure 7 , Figure 7 is a flowchart of another I / O resource management method for a distributed system provided by an exemplary embodiment. The method can be applied to Figure 6 The system architecture shown can be applied to Figure 6 The node 100a in the distributed system shown as the master node; wherein the multiple nodes included in the distributed system can share a storage system, specifically one or more storage buckets in the shared storage system. Figure 7 As shown, the method may specifically include the following steps S701 to S706.
[0153] Step S701: The slave node sends a registration request to the master node.
[0154] In an illustrated embodiment, at least one slave node in the distributed system may send a registration request to the master node, and correspondingly, the master node receives the registration request sent by at least one slave node. In an illustrated embodiment, the registration request may include a node identifier of the slave node and a bucket identifier of a storage bucket connected to the slave node (or a storage bucket used by the slave node).
[0155] In an illustrated implementation, the node identifier may be an IP address of the node, or may be any other possible identifier, such as a PN / SN code of a device, etc., which is not specifically limited in this specification.
[0156] Furthermore, the master node may record the correspondence between the node identifier and the bucket identifier of the at least one slave node according to the received registration request. In addition, the master node may also obtain the master node's own node identifier and the bucket identifier of the storage bucket connected to the master node, and record the correspondence between the master node's node identifier and the bucket identifier.
[0157] Furthermore, the master node may determine the bucket sharing relationship between the multiple nodes according to the correspondence between the recorded node identifiers and the bucket identifiers, for example, determine the multiple nodes that share any target bucket among the multiple buckets.
[0158] Exemplarily, a follower_task in a slave node may send a registration request to a master node via RPC, and the registration request may include a node identifier of the slave node and a bucket identifier of a storage bucket used by the slave node. In an illustrated embodiment, each node of a distributed system may include a leader_task and a follower_task, so that any node may efficiently perform corresponding operations after being elected as a master node.
[0159] Step S702: The master node inquires the slave node about the requested amount of I / O resources.
[0160] In an illustrated embodiment, the master node may periodically inquire of multiple slave nodes sharing a target storage bucket about their respective I / O resource application amounts for the target storage bucket in the current cycle according to a preset cycle duration. Figure 6 As shown, node 100a as the master node can respectively inquire node 100b and node 100c of the shared storage bucket 200b about the I / O resource application amount for bucket 200b in the current cycle, and node 100a can also inquire node 100b about the I / O resource application amount for bucket 200a in the current cycle.
[0161] Step S703, the slave node estimates the I / O resource application amount of the current cycle.
[0162] In an illustrated embodiment, the slave nodes sharing the target bucket can estimate the I / O resource application amount for the target bucket in the current cycle based on the I / O resource usage for the target bucket in the previous cycle. The specific estimation method can refer to the above Figure 2 The description of the corresponding embodiment will not be repeated here. Figure 6 As shown, node 100b can estimate the I / O resource application amount for bucket 200a and the I / O resource application amount for bucket 200b in the current cycle respectively; node 100c can estimate the I / O resource application amount for bucket 200b in the current cycle. In addition, node 100a as the master node can also estimate its own I / O resource application amount for bucket 200a in the current cycle.
[0163] Step S704: The slave node sends the I / O resource application amount of the current cycle to the master node.
[0164] Exemplarily, the leader_task in the master node can inquire the slave node about the I / O resource application amount of the current cycle through RPC, and correspondingly, the follower_task in the slave node can send the estimated I / O resource application amount to the master node through RPC.
[0165] Step S705: The master node calculates the I / O resource allocation amount of each node according to the preset I / O resource allocation strategy. For example, the master node may calculate the I / O resource allocation amount of each node that shares the target bucket for the target bucket. For the specific resource allocation method, please refer to the above Figure 1-5 The description of the corresponding embodiments will not be repeated here.
[0166] For example Figure 6As shown, node 100a and node 100b share storage bucket 200a, then the I / O resource allocation amount of node 100a and node 100b for the storage bucket 200a can be calculated. Assuming that the total I / O resource of storage bucket 200a is 20M / s, the I / O resource allocation amount of node 100a for the storage bucket 200a can be 12M / s, and the I / O resource allocation amount of node 100b for the storage bucket 200a can be 8M / s.
[0167] For example Figure 6 As shown, node 100b and node 100c share storage bucket 200b, then the I / O resource allocation amount of node 100b and node 100c for the storage bucket 200b can be calculated. Assuming that the total I / O resource of storage bucket 200b is 15M / s, the I / O resource allocation amount of node 100b for the storage bucket 200b can be 10M / s, and the I / O resource allocation amount of node 100c for the storage bucket 200b can be 5M / s. This manual does not make any specific limitations on this.
[0168] Step S706: The master node sends the calculated I / O resource allocation amount to the corresponding slave node, thereby implementing I / O resource allocation.
[0169] Combined with the above Figure 7-9 , assuming that the preset cycle length is 3s, the following operations can be performed between the master node and the slave node every 3s: the slave node first sends an RPC to the master node to register the node IP address and bucket identifier, and then the master node sends a second RPC to the slave node to inquire about the I / O resource application amount of the slave node in the current cycle. The slave node callback returns the I / O resource application amount. After receiving the returned I / O resource application amount, the master node performs I / O resource allocation calculation locally, and then returns the resource allocation result, that is, the I / O resource allocation amount, to the slave node through an RPC.
[0170] To summarize, the distributed system in the present application allocates an I / O resource allocation amount to each node in each cycle that matches the I / O resource usage of the previous cycle, thereby achieving a balanced and reasonable allocation of limited I / O resources among multiple nodes, ensuring that each node obtains I / O resources fairly, avoiding starvation (i.e., inability to access the storage system normally), and reasonably providing more I / O resources to busier nodes.
[0171] Corresponding to the implementation of the above method flow, the embodiment of this specification also provides an I / O resource management device for a distributed system. Figure 8 , Figure 8 is a schematic diagram of a structure of an I / O resource management device for a distributed system provided by an exemplary embodiment. The device 80 can be applied to Figure 1or Figure 6 The system architecture shown can be applied to Figure 1 or Figure 6 The distributed system shown in FIG. 1 is a node 100a serving as a master node; wherein the distributed system includes multiple nodes that can share a storage system. Figure 8 As shown, the device 80 includes:
[0172] The resource application amount acquisition unit 801 is used to periodically acquire the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and estimate the I / O resource application amount for the storage system in the current cycle;
[0173] A total resource amount acquisition unit 802 is used to acquire the total amount of I / O resources pre-configured for the storage system in the current cycle;
[0174] The resource allocation unit 803 is used to allocate corresponding I / O resource allocation amounts to the multiple nodes from the total I / O resource amount based on the I / O resource application amounts of each of the multiple nodes, so that the nodes access the storage system based on the allocated I / O resource allocation amounts in the current cycle.
[0175] In an illustrated embodiment, the multiple nodes include a master node and at least one slave node, and the device is applied to the master node; the resource application amount acquisition unit 801 is specifically used to:
[0176] According to a preset cycle duration, periodically send an acquisition request for the I / O resource application amount of the current cycle to the at least one slave node, so that each slave node responds to the acquisition request, estimates the I / O resource application amount for the storage system in the current cycle based on the I / O resource usage of the storage system in the previous cycle, and sends the estimated I / O resource application amount for the storage system in the current cycle to the master node;
[0177] receiving the I / O resource request amount respectively sent by the at least one slave node; and,
[0178] According to a preset cycle duration, the I / O resource application amount of the master node for the storage system in the current cycle is estimated periodically based on the I / O resource usage of the master node for the storage system in the previous cycle.
[0179] In an illustrated embodiment, the resource application amount acquisition unit 801 is specifically configured to:
[0180] Determine whether the I / O resource usage for the storage system in the previous cycle is less than the I / O resource allocation in the previous cycle;
[0181] If yes, multiplying the I / O resource usage by a preset first application coefficient to obtain an I / O resource application amount for the storage system in the current cycle;
[0182] If not, multiply the I / O resource usage by a preset second application coefficient to obtain the I / O resource application amount for the storage system in the current cycle; wherein the first application coefficient and the second application coefficient are greater than 1, and the first application coefficient is less than the second application coefficient.
[0183] In an illustrated implementation manner, the resource allocation unit 803 is specifically configured to:
[0184] Sorting the I / O resource application amounts of the multiple nodes from small to large, and traversing each node in turn according to the sorted order;
[0185] For the currently traversed node, obtain the remaining amount of I / O resources that are not currently allocated in the total amount of I / O resources, and the current average remaining amount of I / O resources calculated based on the remaining amount of I / O resources and the number of nodes that are not currently allocated;
[0186] The I / O resource application amount of the current node is compared with the current average remaining amount of I / O resources, and the corresponding I / O resource allocation amount is allocated to the current node based on the comparison result.
[0187] In an illustrated implementation manner, the resource allocation unit 803 is specifically configured to:
[0188] If the I / O resource application amount of the current node is less than or equal to the current average remaining amount of I / O resources, then allocate an I / O resource allocation amount equal to its I / O resource application amount to the current node; and,
[0189] The I / O resource application amount is subtracted from the current I / O resource remaining amount to obtain the new I / O resource remaining amount, and then traverses to the next node.
[0190] In an illustrated implementation manner, the resource allocation unit 803 is specifically configured to:
[0191] If the I / O resource application amount of the current node is greater than the current average remaining I / O resource amount, the current node and the remaining nodes after the current node are respectively allocated I / O resource allocation amounts equal to the current average remaining I / O resource amount.
[0192] In an illustrated implementation manner, the resource allocation unit 803 is specifically configured to:
[0193] If there is still unallocated remaining I / O resources in the total amount of I / O resources after the traversal is completed, the unallocated remaining I / O resources are evenly distributed to the multiple nodes.
[0194] In one illustrated embodiment, the storage system is an object storage-based storage system, which includes multiple storage buckets for storing object data; the node is connected to any one or more of the multiple storage buckets to access the object data stored in the one or more storage buckets.
[0195] In one illustrated embodiment, the multiple nodes share a target storage bucket among the multiple storage buckets; the total amount of I / O resources preconfigured for the storage system is the total amount of I / O resources preconfigured for the target storage bucket; the I / O resource application amount, I / O resource usage amount and I / O resource allocation amount are the I / O resource application amount, I / O resource usage amount and I / O resource allocation amount for the target storage bucket.
[0196] In an illustrated embodiment, the apparatus 80 further includes a registration unit 804, configured to:
[0197] Obtaining the node identifier of the master node and the bucket identifier of the storage bucket connected to the master node, and recording the corresponding relationship between the node identifier of the master node and the bucket identifier; and,
[0198] Receiving a registration request sent by the at least one slave node, wherein the registration request includes a node identifier of the slave node and a bucket identifier of a storage bucket connected to the slave node;
[0199] According to the registration request, record the corresponding relationship between the node identifier and the bucket identifier of each of the at least one slave nodes, and;
[0200] According to the recorded correspondence between the node identifiers and the bucket identifiers, a plurality of nodes that share the target storage bucket among the plurality of storage buckets are determined.
[0201] In one illustrated embodiment, the node identifier includes an IP address.
[0202] In an illustrated embodiment, the I / O resources include any one or more combinations of the following I / O resources: IPS, OPS, IOPS, IBW, OBW, IOBW, and TAG.
[0203] The implementation process of the functions and effects of each unit in the above-mentioned device 80 is specifically described in the above-mentioned embodiment, and will not be repeated here. It should be understood that the above-mentioned device 80 can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor (CPU) of the device where it is located reading the corresponding computer program instructions into the memory and running them. From the hardware level, in addition to the CPU and memory, the device where the above-mentioned device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and / or other hardware such as boards and cards for realizing network communication functions.
[0204] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Those of ordinary skill in the art may understand and implement it without creative work.
[0205] The devices, units, and modules described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device, a vehicle-mounted computer, or a combination of any of these devices.
[0206] Corresponding to the above method embodiment, the embodiment of this specification also provides a computing device. Fig. 9 , Fig. 9 It is a structural diagram of a computing device provided by an exemplary embodiment. Fig. 9 The computing device shown may be Figure 1 or Figure 6 The distributed system shown in FIG. 1 is a node 100a serving as a master node; wherein the distributed system includes multiple nodes that can share a storage system. Fig. 9 As shown, the computing device includes a processor 1001 and a memory 1002, and may further include an input device 1004 (such as a keyboard, etc.) and an output device 1005 (such as a display, etc.). The processor 1001, the memory 1002, the input device 1004, and the output device 1005 may be connected via a bus or other means. Fig. 9As shown, the memory 1002 includes a computer-readable storage medium 1003, which stores a computer program that can be run by the processor 1001. The processor 1001 can be a CPU, a microprocessor, or an integrated circuit for controlling the execution of the above method embodiment. When the processor 1001 runs the stored computer program, it can execute the various steps of the I / O resource management method for a distributed system in the embodiment of this specification, including: according to a preset cycle duration, periodically obtaining the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle, and estimating the I / O resource application amount for the storage system in the current cycle; obtaining the total amount of I / O resources preconfigured for the storage system in the current cycle; based on the I / O resource application amount of each of the multiple nodes, from the total amount of I / O resources, respectively allocate corresponding I / O resource allocation amounts to the multiple nodes, so that each node can access the storage system based on the allocated I / O resource allocation amount in the current cycle, and so on.
[0207] For a detailed description of each step of the above-mentioned I / O resource management method for a distributed system, please refer to the previous content and will not be repeated here.
[0208] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when these computer programs are executed by a processor, the steps of the I / O resource management method for a distributed system in the embodiment of this specification are executed. Please refer to the description of the above embodiment for details, which will not be repeated here.
[0209] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
[0210] In a typical configuration, a terminal device includes one or more CPUs, input / output interfaces, network interfaces, and memory.
[0211] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0212] Computer readable media include permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer readable instructions, data structures, program modules or other data.
[0213] Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0214] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0215] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
Claims
1. A method for managing I / O resources in a distributed system, characterized in that: The distributed system includes a plurality of nodes, and the plurality of nodes share a storage system; the method includes: According to a preset cycle duration, periodically obtaining the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle, and estimating the I / O resource application amount for the storage system in the current cycle; Obtaining the total amount of I / O resources preconfigured for the storage system in the current cycle; Based on the respective I / O resource application amounts of the multiple nodes, corresponding I / O resource allocation amounts are allocated to the multiple nodes from the total I / O resource amount, so that the nodes access the storage system based on the allocated I / O resource allocation amounts in the current cycle.
2. The method according to claim 1, characterized in that The multiple nodes include a master node and at least one slave node, and the method is applied to the master node; the periodic acquisition of the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and the estimated I / O resource application amount for the storage system in the current cycle, includes: According to a preset cycle duration, periodically send an acquisition request for the I / O resource application amount of the current cycle to the at least one slave node, so that each slave node responds to the acquisition request, estimates the I / O resource application amount for the storage system in the current cycle based on the I / O resource usage of the storage system in the previous cycle, and sends the estimated I / O resource application amount for the storage system in the current cycle to the master node; receiving the I / O resource request amount respectively sent by the at least one slave node; and, According to a preset cycle duration, the I / O resource application amount of the master node for the storage system in the current cycle is estimated periodically based on the I / O resource usage of the master node for the storage system in the previous cycle.
3. The method according to claim 2, characterized in that The estimating the I / O resource application amount for the storage system in the current cycle based on the I / O resource usage for the storage system in the previous cycle includes: Determine whether the I / O resource usage for the storage system in the previous cycle is less than the I / O resource allocation in the previous cycle; If yes, multiplying the I / O resource usage by a preset first application coefficient to obtain an I / O resource application amount for the storage system in the current cycle; If not, multiply the I / O resource usage by a preset second application coefficient to obtain the I / O resource application amount for the storage system in the current cycle; wherein the first application coefficient and the second application coefficient are greater than 1, and the first application coefficient is less than the second application coefficient.
4. The method according to claim 2, characterized in that: The allocating corresponding I / O resource allocation amounts to the multiple nodes from the total amount of I / O resources based on the respective I / O resource application amounts of the multiple nodes, comprises: Sorting the I / O resource application amounts of the multiple nodes from small to large, and traversing each node in turn according to the sorted order; For the currently traversed node, obtain the remaining amount of I / O resources that are not currently allocated in the total amount of I / O resources, and the current average remaining amount of I / O resources calculated based on the remaining amount of I / O resources and the number of nodes that are not currently allocated; The I / O resource application amount of the current node is compared with the current average remaining amount of I / O resources, and the corresponding I / O resource allocation amount is allocated to the current node based on the comparison result.
5. The method according to claim 4, characterized in that The allocating a corresponding I / O resource allocation amount to the current node based on the comparison result includes: If the I / O resource application amount of the current node is less than or equal to the current average remaining amount of I / O resources, then allocate an I / O resource allocation amount equal to its I / O resource application amount to the current node; and, The I / O resource application amount is subtracted from the current I / O resource remaining amount to obtain the new I / O resource remaining amount, and then traverse to the next node.
6. The method according to claim 4, characterized in that The allocating a corresponding I / O resource allocation amount to the current node based on the comparison result includes: If the I / O resource application amount of the current node is greater than the current average remaining I / O resource amount, the current node and the remaining nodes after the current node are respectively allocated I / O resource allocation amounts equal to the current average remaining I / O resource amount.
7. The method according to claim 4, characterized in that The method further comprises: If there is still unallocated remaining I / O resources in the total amount of I / O resources after the traversal is completed, the unallocated remaining I / O resources are evenly distributed to the multiple nodes.
8. The method according to claim 2, characterized in that: The storage system is an object storage-based storage system, and the storage system includes multiple storage buckets for storing object data; the node is connected to any one or more of the multiple storage buckets to access the object data stored in the one or more storage buckets.
9. The method according to claim 8, characterized in that The multiple nodes share a target storage bucket among the multiple storage buckets; the total amount of I / O resources preconfigured for the storage system is the total amount of I / O resources preconfigured for the target storage bucket; the I / O resource application amount, I / O resource usage amount and I / O resource allocation amount are the I / O resource application amount, I / O resource usage amount and I / O resource allocation amount for the target storage bucket.
10. The method according to claim 9, characterized in that The method further comprises: Obtaining the node identifier of the master node and the bucket identifier of the storage bucket connected to the master node, and recording the corresponding relationship between the node identifier of the master node and the bucket identifier; and, Receiving a registration request sent by the at least one slave node, wherein the registration request includes a node identifier of the slave node and a bucket identifier of a storage bucket connected to the slave node; According to the registration request, record the corresponding relationship between the node identifier and the bucket identifier of each of the at least one slave nodes, and; According to the recorded correspondence between the node identifiers and the bucket identifiers, a plurality of nodes that share the target storage bucket among the plurality of storage buckets are determined.
11. The method according to claim 10, characterized in that The node identifier includes an IP address.
12. The method according to any one of claims 1 to 11, characterized in that: The I / O resources include any one or more combinations of the following I / O resources: IPS, OPS, IOPS, IBW, OBW, IOBW, and TAG.
13. An I / O resource management device for a distributed system, characterized in that: The distributed system includes a plurality of nodes, and the plurality of nodes share a storage system; the device includes: A resource application amount acquisition unit, used to periodically acquire the I / O resource usage of each of the multiple nodes for the storage system based on the previous cycle according to a preset cycle duration, and estimate the I / O resource application amount for the storage system in the current cycle; A total resource acquisition unit, used to acquire the total I / O resource preconfigured for the storage system in the current cycle; A resource allocation unit is used to allocate corresponding I / O resource allocation amounts to the multiple nodes from the total I / O resource amount based on the I / O resource application amounts of each of the multiple nodes, so that the nodes access the storage system based on the allocated I / O resource allocation amounts in the current cycle.
14. A computing device, characterized in that include: Memory and processor; The memory has stored thereon computer programs / instructions executable by the processor; When the processor runs the computer program / instructions, it performs the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: A computer program / instruction is stored thereon, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
16. A computer program product, characterized in that The computer program product comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Resource allocation method for storage system and electronic equipment
CN120743207A
I / O resource management method for distributed system, and related device
WO2026109037A1