A method, device, equipment and medium for optimizing performance of a distributed storage system

By partitioning data objects and centrally distributing partial or full copies in the Sheepdog distributed storage system, the network performance degradation caused by the two-layer hash algorithm is solved, and IO performance is improved.

CN116360686BActive Publication Date: 2026-05-29JINAN INSPUR DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2023-01-30
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In the Sheepdog distributed storage system, the two-layer hash algorithm causes network performance loss when accessing data objects, especially in the sequential I/O model, where I/O performance is reduced.

Method used

By creating volumes in a distributed storage system and dividing them into several data objects according to a first threshold size, and evenly distributing them to server nodes, and setting virtual data objects of a second threshold size, node hash calculations are performed based on object IDs and virtual data object sizes to achieve local or full centralized distribution of data object replicas.

Benefits of technology

It improves the I/O read/write performance of distributed storage systems, reduces network forwarding requests, and increases access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116360686B_ABST
    Figure CN116360686B_ABST
Patent Text Reader

Abstract

The application provides a method, device and equipment for optimizing performance of a distributed storage system and a readable medium, the method comprising: creating a volume in the distributed storage system, and dividing the created volume into a plurality of data objects according to a first threshold size; uniformly setting the divided data objects to each server node in the distributed storage system; setting a virtual data object with a second threshold size; and in response to the distributed storage system receiving a data read / write request, performing node hash calculation based on an object ID contained in the request and a size of the virtual data object to obtain a server node where the object in the request is distributed. By using the scheme of the application, the centralized distribution effect of partial or all copies of a VDI data object can be achieved, and the IO read / write performance of the distributed storage system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more specifically to a method, apparatus, device, and readable medium for optimizing the performance of a distributed storage system. Background Technology

[0002] Distributed storage systems distribute data across multiple independent devices. They employ a scalable system architecture, utilizing multiple storage servers to share the storage load and location servers to locate stored information. This not only improves system reliability, availability, and access efficiency but also provides high scalability and extremely low cost control, enabling the construction and delivery of enterprise-grade storage. Sheepdog (a distributed storage system), as a distributed block storage system, uses a completely symmetrical structure with no central metadata node. It relies on a large number of servers interconnected via a network to provide distributed storage services.

[0003] Sheepdog uses a consistent hashing algorithm to determine the storage location of data objects. It employs a two-layer consistent hashing algorithm to identify the storage location of data objects. Figure 1 As shown, for any data object request, a node hash is performed based on the object ID contained in the request, thus calculating which node in the cluster the data object request should be distributed on. Furthermore, for different replication strategies, the nodes where replicas are distributed can be further calculated. After the data request reaches a node, a disk hash is performed based on the node's disk information to calculate which disk or disk group the data object contained in the request is distributed on. Figure 1 The diagram shown in the Sheepdog diagram illustrates the two-layer hashing approach and the characteristics and implementation of the consistent hashing algorithm. It can be seen that as the number of objects in the cluster increases, the distribution of object replicas among nodes will become uniform, meaning that the storage occupancy rate of each node is close. Similarly, data objects are also evenly distributed among the disks within the nodes, meaning that the utilization rate of each disk is close.

[0004] However, the even data distribution achieved by Sheepdog using two-layer hashing actually reduces the IO performance of the VDIs (volumes in Sheepdog). This is because the even distribution of replicas means that accessing different data objects requires forwarding requests to different nodes, resulting in network performance degradation, especially for sequential IO models, such as... Figure 2 As shown, data objects 1, 2, and 3 are any three consecutive data objects in the VDI of the sheepdog, and are arranged according to... Figure 2 The illustrated strategy is distributed among servers A, B, and C. If server A is a VDI service access node, then for a read request for data object 1, A can return directly. However, for a read request for data object 2, the request needs to be forwarded to B or C. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device and readable medium for optimizing the performance of a distributed storage system. By using the technical solution of this invention, the centralized distribution effect of partial or all copies of VDI data object replicas can be achieved, thereby improving the IO read and write performance of the distributed storage system.

[0006] To achieve the above objectives, one aspect of the present invention provides a method for performance optimization of a distributed storage system, comprising the following steps:

[0007] Create a volume in the distributed storage system, and then divide the created volume into several data objects according to a first threshold size;

[0008] The data objects are evenly distributed across the server nodes of the distributed storage system.

[0009] Set a virtual data object with a second threshold size;

[0010] In response to a data read / write request received by the distributed storage system, a node hash calculation is performed based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the requested object is distributed.

[0011] According to one embodiment of the present invention, creating a volume in a distributed storage system and dividing the created volume into several data objects according to a first threshold size includes:

[0012] Create a volume of a preset size in a distributed storage system;

[0013] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0014] According to one embodiment of the present invention, the virtual data object for which a second threshold size is set includes:

[0015] A virtual data object is set to an integer multiple of the size of the data object, preferably 1024 times.

[0016] According to one embodiment of the present invention, it further includes:

[0017] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0018] In another aspect, embodiments of the present invention also provide an apparatus for optimizing the performance of a distributed storage system, the apparatus comprising:

[0019] Create a module, configured to create volumes in a distributed storage system and divide the created volumes into several data objects according to a first threshold size;

[0020] The distribution module is configured to evenly distribute the divided data objects across the server nodes of the distributed storage system.

[0021] The module is configured to set a virtual data object with a second threshold size.

[0022] The computing module is configured to respond to a data read / write request received by the distributed storage system by performing node hash calculations based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the object in the request is distributed.

[0023] According to one embodiment of the present invention, the creation module is further configured as follows:

[0024] Create a volume of a preset size in a distributed storage system;

[0025] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0026] According to one embodiment of the present invention, the setting module is further configured to:

[0027] A virtual data object is set to an integer multiple of the size of the data object, preferably 1024 times.

[0028] According to one embodiment of the present invention, the computing module is further configured as follows:

[0029] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0030] Another aspect of the embodiments of the present invention also provides a computer device, the computer device comprising:

[0031] At least one processor; and

[0032] The memory stores computer instructions that can be executed by a processor, which, when executed by the processor, implement the steps of any of the methods described above.

[0033] In another aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0034] The present invention has the following beneficial technical effects: The method for optimizing the performance of a distributed storage system provided in the embodiments of the present invention creates a volume in the distributed storage system and divides the created volume into several data objects according to a first threshold size; evenly distributes the divided data objects to each server node in the distributed storage system; sets virtual data objects of a second threshold size; and, in response to the distributed storage system receiving a data read / write request, performs node hash calculation based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the requested objects are distributed. This technical solution can achieve the centralized distribution effect of partial or all copies of VDI data object replicas and improve the IO read / write performance of the distributed storage system. Attached Figure Description

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

[0036] Figure 1 A schematic diagram of the existing sheepdog two-layer hash calculation technology;

[0037] Figure 2 A schematic diagram illustrating existing techniques for accessing sheepdog data objects;

[0038] Figure 3 This is a schematic flowchart illustrating a method for performance optimization of a distributed storage system according to an embodiment of the present invention.

[0039] Figure 4 This is a schematic diagram of the data distribution after using virtual object data according to an embodiment of the present invention;

[0040] Figure 5 A schematic diagram of an apparatus for optimizing the performance of a distributed storage system according to an embodiment of the present invention;

[0041] Figure 6 This is a schematic diagram of a computer device according to an embodiment of the present invention;

[0042] Figure 7 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0044] Based on the above objectives, a first aspect of the embodiments of the present invention provides an embodiment of a method for performance optimization of a distributed storage system. Figure 3 The diagram shown is a schematic flowchart of the method.

[0045] like Figure 3 As shown, the method may include the following steps:

[0046] S1 creates a volume in the distributed storage system and divides the created volume into several data objects according to a first threshold size. This invention adopts a strategy of partially or fully distributed replicas to improve the read and write performance of the sheepdog. In this invention, the sheepdog's two-layer hash strategy remains unchanged, which ensures good compatibility with the original logic while also guaranteeing even data distribution and minimizing data changes caused by changes in cluster nodes and node disks. The sheepdog provides VDI (volume) services. When creating a VDI in the distributed storage system, a replica strategy can be specified, specifying the number of replicas to be stored. Data is stored as multiple replicas, and the volume is divided into several data objects of 4MB size. For example, in a distributed storage system, a 20GB volume is created, and each data object in this volume is 4MB in size.

[0047] S2 distributes the divided data objects evenly across the server nodes of the distributed storage system. In practical applications, the data objects of a volume are evenly distributed across the server nodes of the distributed storage system. For example, if there are 3 server nodes in the system, the number of data objects of the volume in each server node is roughly the same.

[0048] S3 sets the virtual data object to a second threshold size. The virtual data object is set to an integer multiple M of the data object size, i.e., M times 4M. By setting the size of the virtual data object, the ID of the data object can be mapped to the virtual object's data ID. Thus, the virtual data object ID actually includes data objects within the range of multiples of [0, M).

[0049] S4 responds to data read / write requests received by the distributed storage system by performing node hash calculations based on the object ID and the size of the virtual data object contained in the request to determine the server nodes where the requested object is distributed. When the distributed storage system receives a data read / write request, it uses the virtual object data ID instead of the data object ID during the first layer of hash calculation to distribute the nodes. This ensures that data objects within the range [0, M) of the virtual data object ID will be distributed on the same node. M can be set according to the system configuration, thereby achieving partial or complete centralized distribution of VDI data objects. Taking M=1024 as an example, meaning a virtual object data will contain 1024 data objects, if the VDI ID is 6b4fac, and the sheepdog divides the data objects into 4M units, the data object ID is 006b4fac00000001, representing a data space allocation unit with a logical address of [4M, 8M) for storing the VDI. After converting this to a virtual object data ID, the virtual object data ID will become 006b4fac00000000. Furthermore, the data space within the logical address space of the VDI with ID 6b4fac ([0, 1024 * 4M)) will all be represented by 006b4fac00000000. After the above conversion, a hash is performed on the virtual object data ID, and the node location information of the virtual object data ID is calculated through hashing as the location information corresponding to the object data. Figure 4 As shown, data objects 1, 2, 3 and data objects 4, 5, 6 are different virtual object IDs. After calculation using the above method, data objects 1, 2, and 3 are all located on servers A and C, while data objects 4, 5, and 6 are located on servers B and C, achieving centralized distribution of partial replicas. If the value of M is modified to include all data objects of the VDI, then centralized distribution of complete replicas can be achieved. Centralized distribution of partial or complete replicas allows VDI access to occur on a single node. For sequential read requests or random reads, there is no need to forward them to other nodes via the network. For sequential writes and random writes, it can be determined that a copy of each data object will exist on the local node.

[0050] By using the technical solution of the present invention, it is possible to achieve the centralized distribution effect of partial or all copies of VDI data object replicas, thereby improving the IO read and write performance of distributed storage systems.

[0051] In a preferred embodiment of the present invention, creating a volume in a distributed storage system and dividing the created volume into several data objects according to a first threshold size includes:

[0052] Create a volume of a preset size in a distributed storage system;

[0053] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0054] In a preferred embodiment of the present invention, the virtual data object with a second threshold size includes:

[0055] The virtual data object is set to an integer multiple of the data object size, preferably 1024 times. By setting the size of the virtual data object, the ID of the data object can be mapped to the virtual object data ID, so the virtual data object ID actually includes data objects in the range of multiples of [0, M). The value of the multiple can be modified as needed. When the multiple value is large enough, it can cover all data objects of the VDI, enabling centralized distribution of complete copies.

[0056] In a preferred embodiment of the present invention, it further includes:

[0057] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0058] By using the technical solution of the present invention, it is possible to achieve the centralized distribution effect of partial or all copies of VDI data object replicas, thereby improving the IO read and write performance of distributed storage systems.

[0059] It should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The embodiments of the computer program described above can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

[0060] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0061] Based on the above objectives, a second aspect of the embodiments of the present invention provides an apparatus for optimizing the performance of a distributed storage system, such as... Figure 5 As shown, the device 200 includes:

[0062] Create a module, configured to create volumes in a distributed storage system and divide the created volumes into several data objects according to a first threshold size;

[0063] The distribution module is configured to evenly distribute the divided data objects across the server nodes of the distributed storage system.

[0064] The module is configured to set a virtual data object with a second threshold size.

[0065] The computing module is configured to respond to a data read / write request received by the distributed storage system by performing node hash calculations based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the object in the request is distributed.

[0066] In a preferred embodiment of the present invention, the creation module is further configured as follows:

[0067] Create a volume of a preset size in a distributed storage system;

[0068] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0069] In a preferred embodiment of the present invention, the setting module is further configured as follows:

[0070] A virtual data object is set to an integer multiple of the size of the data object, preferably 1024 times.

[0071] In a preferred embodiment of the present invention, the computing module is further configured as follows:

[0072] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0073] In view of the above objectives, a third aspect of the present invention provides a computer device. Figure 6 The diagram shown is a schematic representation of an embodiment of the computer device provided by the present invention. Figure 6 As shown, embodiments of the present invention include the following apparatus: at least one processor 21; and a memory 22 storing computer instructions 23 executable on the processor, which, when executed by the processor, implement the following method:

[0074] Create a volume in the distributed storage system, and then divide the created volume into several data objects according to a first threshold size;

[0075] The data objects are evenly distributed across the server nodes of the distributed storage system.

[0076] Set a virtual data object with a second threshold size;

[0077] In response to a data read / write request received by the distributed storage system, a node hash calculation is performed based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the requested object is distributed.

[0078] In a preferred embodiment of the present invention, creating a volume in a distributed storage system and dividing the created volume into several data objects according to a first threshold size includes:

[0079] Create a volume of a preset size in a distributed storage system;

[0080] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0081] In a preferred embodiment of the present invention, the virtual data object with a second threshold size includes:

[0082] A virtual data object is set to an integer multiple of the size of the data object, preferably 1024 times.

[0083] In a preferred embodiment of the present invention, it further includes:

[0084] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0085] In view of the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium. Figure 7 The diagram shown is a schematic representation of an embodiment of the computer-readable storage medium provided by the present invention. Figure 7 As shown, computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the following methods:

[0086] Create a volume in the distributed storage system, and then divide the created volume into several data objects according to a first threshold size;

[0087] The data objects are evenly distributed across the server nodes of the distributed storage system.

[0088] Set a virtual data object with a second threshold size;

[0089] In response to a data read / write request received by the distributed storage system, a node hash calculation is performed based on the object ID and the size of the virtual data object contained in the request to obtain the server nodes where the requested object is distributed.

[0090] In a preferred embodiment of the present invention, creating a volume in a distributed storage system and dividing the created volume into several data objects according to a first threshold size includes:

[0091] Create a volume of a preset size in a distributed storage system;

[0092] The created volume is divided into several data objects with a size of 4MB. The data objects are used to store data.

[0093] In a preferred embodiment of the present invention, the virtual data object with a second threshold size includes:

[0094] A virtual data object is set to an integer multiple of the size of the data object, preferably 1024 times.

[0095] In a preferred embodiment of the present invention, it further includes:

[0096] Disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID for the object distribution in the request.

[0097] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0098] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.

[0099] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0100] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0101] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0102] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.

[0103] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0104] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0105] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A method for performance optimization of a distributed storage system, characterized in that, Includes the following steps: In a distributed storage system, a volume is created, and the created volume is divided into several data objects according to a first threshold size, wherein the data objects are used to store data; The data objects are evenly distributed across the server nodes of the distributed storage system. Set a virtual data object whose size is an integer multiple of the data object size; Map data object IDs to virtual object IDs; In response to a data read / write request received by the distributed storage system, a disk hash calculation is performed based on the volume's data object size and disk information to obtain the volume's data object ID where the requested object is distributed. The virtual object ID is then used to replace the data object ID in the request to perform a node hash calculation to obtain the server node where the requested data object is distributed.

2. The method according to claim 1, characterized in that, In a distributed storage system, a volume is created, and the created volume is divided into several data objects according to a first threshold size, including: Create a volume of a preset size in a distributed storage system; The created volume is divided into several data objects with a size of 4MB.

3. The method according to claim 1, characterized in that, The integer multiple is 1024 times.

4. A device for optimizing the performance of a distributed storage system, characterized in that, The device includes: A creation module is configured to create a volume in a distributed storage system and divide the created volume into several data objects according to a first threshold size, wherein the data objects are used to store data; A distribution module, configured to evenly distribute the divided data objects across the server nodes of the distributed storage system; The setting module is configured to set virtual data objects that are integer multiples of the size of the data object, so as to map the data object ID to the virtual object ID; The computing module is configured to, in response to a data read / write request received by the distributed storage system, perform disk hash calculation based on the volume's data object size and disk information to obtain the volume's data object ID where the requested object is distributed, and perform node hash calculation using the virtual object ID instead of the data object ID contained in the base request to obtain the server node where the requested data object is distributed.

5. The apparatus according to claim 4, characterized in that, The creation module is also configured as follows: Create a volume of a preset size in a distributed storage system; The created volume is divided into several data objects with a size of 4MB.

6. The apparatus according to claim 4, characterized in that, The integer multiple is 1024 times.

7. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-3.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-3.