Hierarchical caching method and system, and related component
Through the hierarchical caching method, file IO operations are monitored and redirected, and the aggregation cache layer is used to improve the IO performance of small file data sets in high-performance computing scenarios, solving the performance bottleneck problem in high-concurrency metadata-intensive file systems and achieving better performance. Efficient storage performance.
Patent Information
- Application Number
- PCT/CN2024/080583
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-09
- Filing Date
- 2024-03-07
- Publication Date
- 2024-09-12
AI Technical Summary
In high-performance computing scenarios, high-concurrency IO operations on massive small files lead to high metadata service overhead in distributed storage systems, affecting data storage efficiency. It is difficult for existing technologies to effectively improve small file reading performance.
Adopting a hierarchical caching method, the client process monitors file IO operation requests and redirects them to the server process. The server process determines whether the target storage location is the aggregate cache layer. If there is a miss, it reads the data from the bottom layer and caches it to the aggregate cache layer, improving the performance. IO performance on small file data sets.
It effectively improves the IO performance of massive small file data sets, improves the performance bottleneck caused by metadata in highly concurrent metadata-intensive file systems, and improves the overall performance of the storage system.
Smart Images

Figure CN2024080583_12092024_PF_FP_ABST
Abstract
Description
A hierarchical caching method, system and related components
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 9, 2023, with application number 2023102207693 and application name “A layered caching method, system and related components”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present application relate to the field of distributed storage, and in particular to a layered caching method, system, and related components. Background Art
[0004] With the rapid growth of HPC (High Performance Computing) computing power, large-scale, highly concurrent applications are placing significant pressure on the I / O (Input and Output) capabilities of distributed storage systems. High-performance HPC scenarios involve three key elements: 1. The data and label metadata attributes of each HPC node require large-scale, highly concurrent storage I / O. 80% of this I / O involves loading and modifying datasets for HPC training and random data retrieval, a typical intensive I / O model. 2. The HPC high-performance computing process, including data preprocessing, data labeling, and data compression. 3. Distributed data consistency and synchronization updates.
[0005] By analyzing the three key elements of HPC scenarios, we found that the massive amount of small files generated by high-performance computing (HPC)—highly concurrent IO and random access—can easily saturate the IO read and write performance of distributed storage systems. For example, a common HPC dataset typically contains over 2 million small files of 3,000 different types. If the storage IO read and write software stack cannot meet the requirements of large-scale HPC operations, it will hinder HPC services. Therefore, the IO performance of distributed storage systems is crucial to HPC services. Existing technical solutions have proposed several optimization schemes to improve storage IO performance for HPC, such as prefetching and caching. However, using existing solutions for large-scale, highly concurrent storage IO in HPC scenarios still presents many technical challenges. For example, high-performance IO that is intensive in small file reads generates significant metadata service overhead for the distributed storage system, which in turn affects data storage efficiency.
[0006] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present.
[0007] Summary of the Invention
[0008] The purpose of the embodiments of the present application is to provide a hierarchical caching method, system and related components that can improve the IO performance of massive small file data sets and alleviate the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0009] To solve the above technical problems, embodiments of the present application provide a hierarchical caching method, which is applied to each computing node of a distributed storage system. The hierarchical caching method includes:
[0010] The client process is used to monitor the file IO operation requests sent by the client to the distributed storage system. When a file IO operation request is detected, the file IO operation request is redirected to the server process.
[0011] Use the server process to determine whether the target storage location corresponding to the file IO operation request is the aggregate cache layer;
[0012] If the target storage location is not the aggregate cache layer, the data corresponding to the file IO operation request is read from the bottom layer of the distributed storage system and cached in the aggregate cache layer;
[0013] In a case where the target storage location is the aggregate cache layer, the data is read from the aggregate cache layer and returned to the client process, so that the client process returns the data to the client.
[0014] Optionally, the process of using the server process to determine whether the target storage location corresponding to the file IO operation request is the aggregate cache layer includes:
[0015] Use the server process to insert the received file IO operation request into the shared queue;
[0016] In the shared queue, determine whether the data corresponding to the file IO operation request is cached data;
[0017] In the shared queue, when it is determined that the data corresponding to the file IO operation request is cached data, it is determined that the target storage location corresponding to the file IO operation request is the aggregate cache layer.
[0018] Optionally, in the shared queue, the process of determining whether the data corresponding to the file IO operation request is cached data includes:
[0019] In the shared queue, the data thread is used to determine whether the data corresponding to the file IO operation request is cached data; the data thread is a thread generated when the server process instance is constructed.
[0020] Optionally, the layered caching method also includes:
[0021] When a file IO operation request from a client to a distributed storage system is detected, a server process is started, and a server process instance is dynamically constructed using the status of the current computing node and the status of other computing nodes adjacent to the current computing node.
[0022] Optionally, the process of reading data from the aggregate cache layer includes:
[0023] The file IO operation request is redirected to the aggregation cache layer through the data thread so that data can be read from the aggregation cache layer.
[0024] Optionally, while inserting the received file IO operation request into the shared queue using the server process, the hierarchical caching method further includes:
[0025] Configure a mutex lock on the shared queue.
[0026] Optionally, the shared queue is a FIFO queue.
[0027] Optionally, the data corresponding to the file IO operation request includes a file descriptor, a read offset, and a length.
[0028] Optionally, the layered caching method also includes:
[0029] The data storage location in the aggregate cache layer is determined based on the file path and the compute node to which it belongs.
[0030] Optionally, the layered caching method also includes:
[0031] Broadcast the file IO operation request to the compute nodes adjacent to the current compute node.
[0032] Optionally, the layered caching method also includes:
[0033] Determine whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium;
[0034] When it is determined that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium, a cache eviction operation and a replacement operation are performed.
[0035] Optionally, the layered caching method also includes:
[0036] A dynamic link library is constructed based on the environment variables; the dynamic link library is configured to intercept file IO operation requests.
[0037] Optionally, the process of redirecting the file IO operation request to the server process includes:
[0038] Redirect file IO operation requests to the server process through a hash algorithm.
[0039] Optionally, the aggregate cache layer is a cache layer composed of high-speed storage media in each computing node in the distributed storage system.
[0040] Optionally, the high-speed storage medium is NVMe SSD.
[0041] Optionally, the layered caching method also includes:
[0042] When the clearing conditions are met, the data stored in the high-speed storage media on the computing node is cleared.
[0043] To solve the above technical problems, an embodiment of the present application further provides a hierarchical cache system, which is applied to each computing node of a distributed storage system. The hierarchical cache system includes:
[0044] The monitoring module is configured to monitor file IO operation requests sent by the client to the distributed storage system using the client process, and redirect the file IO operation request to the server process when a file IO operation request is detected;
[0045] a processing module configured to use a server process to determine whether a target storage location corresponding to a file IO operation request is an aggregate cache layer, triggering a first reading module if the target storage location is not an aggregate cache layer, and triggering a second reading module if the target storage location is an aggregate cache layer;
[0046] The first reading module is configured to read data corresponding to the file IO operation request from the bottom layer of the distributed storage system and cache the data in the aggregation cache layer;
[0047] The second reading module is configured to read data from the aggregate cache layer and return the data to the client process, so that the client process returns the data to the client.
[0048] To solve the above technical problems, an embodiment of the present application further provides an electronic device, including:
[0049] a memory arranged to store a computer program;
[0050] A processor is configured to implement the steps of any one of the above hierarchical caching methods when executing a computer program.
[0051] To solve the above technical problems, an embodiment of the present application further provides a distributed storage system, including a storage bottom layer module and multiple nodes, each node including a layered client process, a layered server process, and a storage medium, and the storage medium of each node constitutes an aggregated cache layer, wherein:
[0052] The layered client process is configured to monitor file IO operation requests issued by the client, and when a file IO operation request is detected, redirect the file IO operation request to the layered server process;
[0053] The layered server process is configured to determine whether a target storage location corresponding to a file IO operation request is an aggregate cache layer. If the target storage location is not an aggregate cache layer, the layered server process reads data corresponding to the file IO operation request from a storage bottom layer module and sends the data to the aggregate cache layer. If the target storage location is an aggregate cache layer, the layered server process reads the data from the aggregate cache layer and returns the data to the layered client process so that the layered client process returns the data to the client.
[0054] The aggregation cache layer is set up to store data sent by the layered server processes.
[0055] To solve the above technical problems, an embodiment of the present application further provides a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the hierarchical caching method as described in any one of the above items are implemented.
[0056] An embodiment of the present application provides a layered caching method. After a client process detects a file IO operation request, it redirects the file IO operation request to a server process. The server process first searches for the file in the aggregated cache layer. If the aggregated cache layer misses, the server process retrieves the data from the underlying distributed storage system. This improves the IO performance of massive small file data sets and alleviates the performance bottleneck caused by metadata in highly concurrent metadata-intensive file system services. An embodiment of the present application also provides a layered caching system, electronic device, distributed storage system, and non-volatile readable storage medium, all of which have the same beneficial effects as the above-mentioned layered caching method. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0058] FIG1 is a flowchart of the steps of a hierarchical caching method provided in an embodiment of the present application;
[0059] FIG2 is a schematic diagram of the architecture of a hierarchical cache system provided in an embodiment of the present application;
[0060] FIG3 is a schematic diagram of a hierarchical cache framework of a distributed storage system provided in an embodiment of the present application;
[0061] FIG4 is a schematic structural diagram of a layered cache system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The core of the embodiments of the present application is to provide a hierarchical caching method, system and related components, which can improve the IO performance of massive small file data sets and alleviate the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0063] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the embodiments of the present application.
[0064] In the first aspect, please refer to FIG1 , which is a flowchart of the steps of a layered caching method provided by an embodiment of the present application. The layered caching method includes:
[0065] S1O1: Use the client process to monitor the file IO operation requests sent by the client to the distributed storage system. When a file IO operation request is detected, redirect the file IO operation request to the server process.
[0066] This embodiment proposes an aggregated cache layer, which is a transparent read-only cache layer that builds a cache for a typical intensive IO model. It accelerates the reading of storage data by aggregating the local storage of distributed cluster nodes and local storage of adjacent nodes, thereby improving the IO performance of massive small file data sets.
[0067] The client accesses the distributed storage system through the POSIX (Portable Operating System Interface) file system interface provided by the distributed storage system to accelerate the storage IO access performance of the HPC high-performance scenario, which has read-only data with a high reread rate and has the typical characteristics of an intensive IO model. Referring to Figure 2, the architecture of the layered cache system provided by the embodiment of the present application consists of two main components: a layered cache client process and a layered cache server process. These two components are deployed in the client layer of the distributed storage system. When a job is allocated on a group of computing nodes on the HPC, the layered cache server process is started, and the server process instance is dynamically constructed using the distributed storage node and the local storage of the adjacent nodes. Each node of the distributed storage system deploys a layered cache client process and a server process, which caches the data requested by the HPC high-performance computing job on the Nvme SSD high-speed storage medium device of this node.
[0068] Optionally, the layered cache process of the embodiment of the present application is described. As shown in FIG3 , the client process is first preloaded, and the client process is used to monitor and intercept file system operations, such as open, read, and close. File system calls are intercepted by the process, and there is no need to modify the existing high-performance computing application or the underlying file system of the distributed storage system. It can be understood that the layered cache client process consists of a file system IO interface forwarding module, which captures the file system calls to the distributed storage system and redirects them to the corresponding layered cache server process. Therefore, the layered cache client process first reads the hit data through the aggregated cache layer, which helps meet the performance requirements of high-performance business.
[0069] S102: using the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer, if the target storage location is not an aggregate cache layer, executing S103; if the target storage location is an aggregate cache layer, executing S104;
[0070] S103: Read the data corresponding to the file IO operation request from the bottom layer of the distributed storage system, and cache the data in the aggregate cache layer;
[0071] S104: Read data from the aggregation cache layer and return the data to the client process, so that the client process returns the data to the client.
[0072] After receiving the file IO operation request intercepted by the client process, the server process will retrieve the file from the underlying distributed storage system only when the cache misses. It can be understood that the following description is for two reading scenarios, including first reading and non-first reading.
[0073] For the first read:
[0074] The computing node client in the HPC high-performance scenario initiates a read request to the dataset directory on the distributed storage system. The tiered cache client process intercepts any incoming file IO operation requests and starts tracking them in the dataset directory. The RPC (Remote Procedure Call) handler of the tiered cache client process redirects the requested file IO operation request to the corresponding tiered cache server process. The internal management RPC handler of the tiered cache client process and the server process is responsible for sending and receiving messages over the network.
[0075] As an optional embodiment, the process of using a server process to determine whether the target storage location corresponding to a file IO operation request is an aggregate cache layer includes: using a server process to insert a received file IO operation request into a shared queue; in the shared queue, determining whether the data corresponding to the file IO operation request is cached data; in the shared queue, if it is determined that the data corresponding to the file IO operation request is cached data, then determining that the target storage location corresponding to the file IO operation request is an aggregate cache layer.
[0076] As an optional embodiment, in a shared queue, the process of determining whether the data corresponding to a file IO operation request is cached data includes: in the shared queue, determining whether the data corresponding to a file IO operation request is cached data through a data thread; the data thread is a thread generated when constructing a server process instance.
[0077] Optionally, when the layered cache Server process receives a file IO operation request, the RPC handler will insert the forwarded file IO into the shared FIFO (First Input First Output) queue. In the shared FIFO queue, the move-data data thread will check whether the file has been cached. Since it is the first time to read the file, the data needs to be pulled into the aggregate cache to determine the cached file descriptor, read offset and length.
[0078] For non-first reads:
[0079] As an optional embodiment, the process of reading data from the aggregate cache layer includes:
[0080] The file IO operation request is redirected to the aggregation cache layer through the data thread so that data can be read from the aggregation cache layer.
[0081] Optionally, the data thread redirects IO to the aggregate cache to read the file and returns the file descriptor to the corresponding layered cache Client process. The process then returns the file descriptor, read offset, length, and other data to the HPC application, i.e., the HPC high-performance client requester. As can be seen from the file IO operation request, in this embodiment, after the client process detects the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. If the aggregate cache layer misses, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and alleviate the performance bottleneck caused by metadata in highly concurrent metadata-intensive file system services.
[0082] It can be seen that in this embodiment, after the client process monitors the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. When the aggregate cache layer does not hit, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and improve the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0083] Based on the above embodiment:
[0084] As an optional embodiment, while inserting the received file IO operation request into the shared queue by the server process, the hierarchical caching method further includes:
[0085] Configure a mutex lock on the shared queue.
[0086] Optionally, given that multiple tiered cache client processes may request a single file concurrently, a mutex is used on the shared queue to ensure consistency and avoid duplicate copying of files to the aggregate cache.
[0087] As an optional embodiment, the layered caching method further includes:
[0088] The data storage location in the aggregate cache layer is determined based on the file path and the compute node to which it belongs.
[0089] As an optional embodiment, the layered caching method further includes:
[0090] Broadcast the file IO operation request to the compute nodes adjacent to the current compute node.
[0091] Optionally, the tiered cache process broadcasts file lookup requests to neighboring nodes, helping to balance the load between nodes.
[0092] As an optional embodiment, the layered caching method further includes:
[0093] Determine whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium;
[0094] When it is determined that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium, a cache eviction operation and a replacement operation are performed.
[0095] Optionally, the aggregate cache eviction mechanism is associated with repeated reads of the dataset, and if the dataset is larger than the total capacity of the node's local cache, cache eviction and replacement is performed.
[0096] As an optional embodiment, the layered caching method further includes:
[0097] A dynamic link library is constructed based on the environment variables; the dynamic link library is configured to intercept file IO operation requests.
[0098] Optionally, this embodiment implements a redirected read-only aggregate cache, specifically a read IO interception mechanism. Based on an initial prototype of a distributed storage system high-performance scenario, this embodiment's aggregate cache layer facilitates analysis of high-performance business scenarios, particularly the IO read calls among the three key elements, to understand how data loaders in the framework access files. This embodiment designs an aggregate cache layer that intercepts IO-related function calls and employs a mechanism that selectively loads the same functions from different dynamic link libraries. This mechanism avoids the need to force applications to modify their codebases to support the aggregate cache layer.
[0099] Optionally, the intercepted read IO mechanism of the present embodiment is redirected to the dynamic link library Only_Read_Performance.so. The technical optimization point of this dynamic link library is that once the function of the dynamic library changes, it is transparent to the executable program and the executable program does not need to be recompiled. For statically linked programs in other technologies, a small change in the function library requires the recompilation and release of the entire program. Among them, static linking is to compile all the referenced functions or variables into the executable file. Dynamic linking does not compile the function into the executable file, but dynamically loads the function library when the program is running, that is, runs the link. Therefore, redirecting to the dynamic link library Only_Read_Performance.so has compatibility and portability, and is of great value to distributed storage systems.
[0100] The steps of the embodiment of intercepting the read IO mechanism are as follows:
[0101] (1) For HPC high-performance computing job client requests, file system requests that meet standard POSIX semantics and conform to typical intensive IO model calls to access the underlying distributed storage file system;
[0102] (2) Using the environment variable LD_PRELOAD of the distributed storage system Linux server, which is characterized by dynamic library loading and has the highest priority, is an embodiment method of intercepting the read request processing logic of the embodiment of the present application;
[0103] (3) Intercept the Input of the read IO mechanism:
[0104] a. File system call;
[0105] b.LD_PRELOAD environment variable;
[0106] c. The dynamic link library in the local aggregate cache layer is recorded as Only_Read_Performance.so;
[0107] (4) Intercept the Output of the read IO mechanism:
[0108] Execute Only_Read_Performance.so, as described above, to perform read cache logic processing at the cache aggregation layer.
[0109] As an optional embodiment, the process of redirecting the file IO operation request to the server process includes:
[0110] Redirect file IO operation requests to the server process through a hash algorithm.
[0111] This embodiment uses a hash algorithm for redirection to avoid metadata lookup bottlenecks, aiming to improve random read performance. The tiered cache client process uses a hash to redirect I / O, searching the cache on the tiered cache server process. This eliminates the need to store cached file metadata in distributed metadata storage or in-memory databases. In aggregated caching, the file cache location is determined by the file path and the node to which it belongs.
[0112] As an optional embodiment, the aggregate cache layer is a cache layer composed of high-speed storage media in each computing node in the distributed storage system.
[0113] As an optional embodiment, the high-speed storage medium is an Nvme (Non-Volatile Memory express, non-volatile memory host controller interface specification) SSD (Solid State Disk, solid state drive).
[0114] As an optional embodiment, the layered caching method further includes:
[0115] When the clearing conditions are met, the data stored in the high-speed storage media on the computing node is cleared.
[0116] In this embodiment, the lifecycle of the dataset in the cache is coupled with the lifecycle of the job on the HPC high-performance client. After the job is completed, the cached dataset is cleared from the node local storage.
[0117] In summary, the aggregation cache layer proposed in the embodiment of the present application is independent of the metadata module and data module storage mechanism of the distributed storage system. It is a transparent read-only cache layer. It builds a cache for a typical intensive IO model. Based on the RPC remote procedure call mechanism, it uses the local storage of aggregated distributed cluster nodes and adjacent nodes to accelerate the reading of storage data performance, so as to improve the IO performance of massive small file data sets; it uses a distributed hash algorithm IO redirection to determine the cache location of data requests, and designs the highest priority dynamic link library Only_Read_Performance.so based on the LD_PRELOAD environment variable to intercept Read IO requests to avoid bottlenecks in metadata searches of the distributed storage system. The goal is to improve random read performance; at the same time, it improves the cache hit rate of the distributed storage system, effectively avoiding the performance bottlenecks caused by metadata searches and file lock competition on the storage system IO. At the same time, since the aggregation cache layer of the embodiment of the present application is independent of the distributed storage system, it also has the characteristics of portability and versatility.
[0118] In terms of performance, the embodiments of the present application effectively improve the performance issues of high-concurrency IO models in HPC high-performance scenarios, and improve the performance bottlenecks caused by metadata in high-concurrency metadata-intensive file system services; in terms of stability, the embodiments of the present application design the cache aggregation layer to be independent of the distributed storage underlying system. In the event of a storage medium failure in the cache aggregation layer, it will not affect the normal business calls and has stability; in terms of security, the layered cache architecture is loosely coupled with the distributed storage system, and there is no security risk; in terms of cost, the embodiments of the present application improve the universal storage IO performance issues in HPC high-performance scenarios, and can improve the competitiveness and maintenance costs of distributed file storage; in terms of compatibility, the embodiments of the present application are portable and universal, and do not require modification of HPC job applications, improve the linear scalability of distributed clusters, and are compatible with common file quotas, snapshots and other features.
[0119] In the second aspect, referring to FIG. 4 , FIG. 4 is a schematic diagram of the structure of a hierarchical cache system provided in an embodiment of the present application, which is applied to each computing node of a distributed storage system. The hierarchical cache system includes:
[0120] The monitoring module 41 is configured to monitor file IO operation requests sent by the client to the distributed storage system using the client process, and redirect the file IO operation request to the server process when a file IO operation request is detected;
[0121] The processing module 42 is configured to use the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer, and trigger the first reading module 43 if the target storage location is not an aggregate cache layer, and trigger the second reading module 44 if the target storage location is an aggregate cache layer;
[0122] The first reading module 43 is configured to read the data corresponding to the file IO operation request from the bottom layer of the distributed storage system and cache the data in the aggregate cache layer;
[0123] The second reading module 44 is configured to read data from the aggregate cache layer and return the data to the client process, so that the client process returns the data to the client.
[0124] This embodiment proposes an aggregated cache layer, which is a transparent read-only cache layer that builds a cache for a typical intensive IO model. It accelerates the reading of storage data by aggregating the local storage of distributed cluster nodes and local storage of adjacent nodes, thereby improving the IO performance of massive small file data sets.
[0125] The client accesses the distributed storage system through the POSIX file system interface provided by the distributed storage system in order to accelerate the storage IO access performance of the HPC high-performance scenario, which has read-only data with a high reread rate and has the typical characteristics of an intensive IO model. Referring to Figure 2, the architecture of the layered cache system provided by the embodiment of the present application consists of two main components: a layered cache client process and a layered cache server process. These two components are deployed in the client layer of the distributed storage system. When a job is allocated on a group of computing nodes on the HPC, the layered cache server process is started, and the server process instance is dynamically constructed using the distributed storage node and the local storage of the adjacent nodes. Each node of the distributed storage system deploys a layered cache client process and a server process, which caches the data requested by the HPC high-performance computing job on the Nvme SSD high-speed storage medium device of this node.
[0126] Optionally, the layered cache process of the embodiment of the present application is described. As shown in FIG3 , the client process is first preloaded, and the client process is used to monitor and intercept file system operations such as open, read, and close through cache aggregation and RPC handler (remote procedure call handler). The file system call is intercepted by the process, and there is no need to modify the existing high-performance computing application or the underlying file system of the distributed storage system. It can be understood that the layered cache client process consists of a file system IO interface forwarding module, which captures the file system call to the distributed storage system and redirects it to the corresponding layered cache server process. Therefore, the layered cache client process first reads the hit data through the aggregated cache layer, which helps to meet the performance requirements of high-performance business.
[0127] After receiving the file IO operation request intercepted by the client process, the server process will retrieve the file from the underlying distributed storage system only when the cache misses. It can be understood that the following description is for two reading scenarios, including first reading and non-first reading.
[0128] For the first read:
[0129] The computing node client in the HPC high-performance scenario initiates a read request to the dataset directory on the distributed storage system. The tiered cache client process intercepts any incoming file IO operation requests and starts tracking them in the dataset directory. The RPC (remote procedure call) handler of the tiered cache client process redirects the requested file IO operation request to the corresponding tiered cache server process. The internal management RPC handler of the tiered cache client process and the server process is responsible for sending and receiving messages over the network.
[0130] As an optional embodiment, the process of using a server process to determine whether the target storage location corresponding to a file IO operation request is an aggregate cache layer includes: using the server process to insert a received file IO operation request into a shared queue; in the shared queue, determining whether the data corresponding to the file IO operation request is cached data; in the shared queue, if it is determined that the data corresponding to the file IO operation request is cached data, then determining that the target storage location corresponding to the file IO operation request is an aggregate cache layer. As an optional embodiment, in a shared queue, the process of determining whether the data corresponding to a file IO operation request is cached data includes: in the shared queue, determining whether the data corresponding to the file IO operation request is cached data through a data thread; the data thread is a thread generated when constructing a server process instance.
[0131] Optionally, when the tiered cache server process receives a file IO operation request, the RPC handler inserts the forwarded file IO into the shared FIFO queue. In the shared FIFO queue, the move-data thread checks whether the file has been cached. Since it is the first time to read the file, the data needs to be pulled into the aggregate cache to determine the cached file descriptor, read offset, and length.
[0132] For non-first reads:
[0133] As an optional embodiment, the process of reading data from the aggregate cache layer includes:
[0134] The file IO operation request is redirected to the aggregation cache layer through the data thread so that data can be read from the aggregation cache layer.
[0135] Optionally, the data thread redirects IO to the aggregate cache to read the file and returns the file descriptor to the corresponding layered cache Client process. The process then returns the file descriptor, read offset, length, and other data to the HPC application, i.e., the HPC high-performance client requester. As can be seen from the file IO operation request, in this embodiment, after the client process detects the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. If the aggregate cache layer does not hit, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and alleviate the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0136] It can be seen that in this embodiment, after the client process monitors the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. When the aggregate cache layer does not hit, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and improve the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0137] As an optional embodiment, the process of using the server process to determine whether the target storage location corresponding to the file IO operation request is the aggregate cache layer includes:
[0138] Use the server process to insert the received file IO operation request into the shared queue;
[0139] In the shared queue, determine whether the data corresponding to the file IO operation request is cached data;
[0140] In the shared queue, when it is determined that the data corresponding to the file IO operation request is cached data, it is determined that the target storage location corresponding to the file IO operation request is the aggregate cache layer.
[0141] As an optional embodiment, in a shared queue, the process of determining whether the data corresponding to the file IO operation request is cached data includes:
[0142] In the shared queue, the data thread is used to determine whether the data corresponding to the file IO operation request is cached data; the data thread is a thread generated when the server process instance is constructed.
[0143] As an optional embodiment, the layered cache system further includes:
[0144] The preprocessing module is configured to start the server process when the monitoring client sends a file IO operation request to the distributed storage system, and dynamically construct a server process instance using the status of the current computing node and the status of other computing nodes adjacent to the current computing node.
[0145] As an optional embodiment, the process of reading data from the aggregate cache layer includes:
[0146] The file IO operation request is redirected to the aggregation cache layer through the data thread so that data can be read from the aggregation cache layer.
[0147] As an optional embodiment, while the server process inserts the received file IO operation request into the shared queue, the hierarchical cache system further includes:
[0148] Configuration module, which is set to configure the shared queue mutex.
[0149] As an optional embodiment, the shared queue is a FIFO queue.
[0150] As an optional embodiment, the data corresponding to the file IO operation request includes a file descriptor, a read offset, and a length.
[0151] As an optional embodiment, the layered cache system further includes:
[0152] The determination module is configured to determine a storage location of the data in the aggregate cache layer based on a file path and a corresponding computing node.
[0153] As an optional embodiment, the layered cache system further includes:
[0154] The broadcast module is configured to broadcast the file IO operation request to the computing nodes adjacent to the current computing node.
[0155] As an optional embodiment, the layered cache system further includes:
[0156] The judgment module is configured to judge whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium, and perform cache eviction and replacement operations if it is judged that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium.
[0157] As an optional embodiment, the layered cache system further includes:
[0158] The building module is configured to build a dynamic link library based on environment variables; the dynamic link library is configured to intercept file IO operation requests.
[0159] As an optional embodiment, the process of redirecting the file IO operation request to the server process includes:
[0160] Redirect file IO operation requests to the server process through a hash algorithm.
[0161] As an optional embodiment, the aggregate cache layer is a cache layer composed of high-speed storage media in each computing node in the distributed storage system.
[0162] As an optional embodiment, the high-speed storage medium is an Nvme SSD.
[0163] As an optional embodiment, the layered cache system further includes:
[0164] The clearing module is configured to clear the data stored in the high-speed storage medium on the computing node when a clearing condition is met.
[0165] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0166] a memory arranged to store a computer program;
[0167] A processor is configured to implement the steps of any one of the above hierarchical caching methods when executing a computer program.
[0168] Optionally, the memory includes a non-volatile readable storage medium and an internal memory. The non-volatile readable storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile readable storage medium. The processor provides computing and control capabilities for the electronic device, and when executing the computer program stored in the memory, the following steps can be implemented: using the client process to monitor the file IO operation request issued by the client to the distributed storage system, and when the file IO operation request is monitored, redirecting the file IO operation request to the server process; using the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer; if the target storage location is not an aggregate cache layer, reading the data corresponding to the file IO operation request from the bottom layer of the distributed storage system, and caching the data to the aggregate cache layer; if the target storage location is an aggregate cache layer, reading the data from the aggregate cache layer, and returning the data to the client process, so that the client process returns the data to the client.
[0169] It can be seen that in this embodiment, after the client process monitors the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. When the aggregate cache layer does not hit, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and improve the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0170] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: using the server process to insert the received file IO operation request into the shared queue; in the shared queue, determining whether the data corresponding to the file IO operation request is cached data; in the shared queue, if it is determined that the data corresponding to the file IO operation request is cached data, then determining that the target storage location corresponding to the file IO operation request is the aggregate cache layer.
[0171] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: in the shared queue, determine through the data thread whether the data corresponding to the file IO operation request is cached data; the data thread is a thread generated when building the server process instance.
[0172] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: when monitoring the file IO operation request issued by the client to the distributed storage system, start the server process, and dynamically build a server process instance using the status of the current computing node and the status of other computing nodes adjacent to the current computing node.
[0173] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: redirecting the file IO operation request to the aggregate cache layer through the data thread, so as to read data from the aggregate cache layer.
[0174] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: configuring a mutual exclusion lock on the shared queue.
[0175] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: determining the storage location of the data in the aggregate cache layer based on the file path and the corresponding computing node.
[0176] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: broadcasting the file IO operation request to the computing nodes adjacent to the current computing node.
[0177] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: determining whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium; and performing cache eviction and replacement operations if it is determined that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium.
[0178] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: a dynamic link library is constructed based on the environment variables; and the dynamic link library is configured to intercept file IO operation requests.
[0179] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: redirecting the file IO operation request to the server process through a hash algorithm.
[0180] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: when a clearing condition is met, clear the data stored in the high-speed storage medium on the computing node.
[0181] Based on the above embodiment, as a preferred implementation manner, the electronic device further includes:
[0182] The input interface, connected to the processor, is configured to retrieve externally imported computer programs, parameters, and instructions and, under the processor's control, store them in memory. This input interface can be connected to an input device to receive parameters or instructions manually entered by the user. This input device can be a touchscreen overlay on the display, or a keypad, trackball, or touchpad on the terminal housing.
[0183] The display unit is connected to the processor and is configured to display data sent by the processor. The display unit may be a liquid crystal display or an electronic ink display.
[0184] The network port is connected to the processor and is configured to communicate with various external terminal devices. The communication technology used for the communication connection can be a wired communication technology or a wireless communication technology, such as Mobile High-Definition Link (MHL), Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), Wireless Fidelity (WiFi), Bluetooth communication technology, Bluetooth Low Energy communication technology, and communication technology based on IEEE802.11s.
[0185] In a fourth aspect, an embodiment of the present application further provides a distributed storage system, including a storage bottom layer module and multiple nodes, each node including a layered client process, a layered server process, and a storage medium, and the storage medium of each node constitutes an aggregated cache layer, wherein:
[0186] The layered client process is configured to monitor file IO operation requests issued by the client, and when a file IO operation request is detected, redirect the file IO operation request to the layered server process;
[0187] The layered server process is configured to determine whether a target storage location corresponding to a file IO operation request is an aggregate cache layer. If the target storage location is not an aggregate cache layer, the layered server process reads data corresponding to the file IO operation request from a storage bottom layer module and sends the data to the aggregate cache layer. If the target storage location is an aggregate cache layer, the layered server process reads the data from the aggregate cache layer and returns the data to the layered client process so that the layered client process returns the data to the client.
[0188] The aggregation cache layer is set up to store data sent by the layered server processes.
[0189] In a fifth aspect, an embodiment of the present application further provides a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the hierarchical caching method as described in any one of the above items are implemented.
[0190] Optionally, the non-volatile readable storage medium may include various media capable of storing program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the following steps are implemented: using a client process to monitor a file IO operation request issued by a client to a distributed storage system, and when a file IO operation request is detected, redirecting the file IO operation request to a server process; using the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer; if the target storage location is not an aggregate cache layer, reading data corresponding to the file IO operation request from the bottom layer of the distributed storage system and caching the data in the aggregate cache layer; if the target storage location is an aggregate cache layer, reading data from the aggregate cache layer and returning the data to the client process, so that the client process returns the data to the client.
[0191] It can be seen that in this embodiment, after the client process monitors the file IO operation request, it redirects the file IO operation request to the server process. The server process first retrieves the file in the aggregate cache layer. When the aggregate cache layer does not hit, it retrieves the data from the bottom layer of the distributed storage system to improve the IO performance of massive small file data sets and improve the performance bottleneck caused by metadata in high-concurrency metadata-intensive file system services.
[0192] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps can be implemented: using the server process to insert the received file IO operation request into the shared queue; in the shared queue, determining whether the data corresponding to the file IO operation request is cached data; in the shared queue, if it is determined that the data corresponding to the file IO operation request is cached data, then determining that the target storage location corresponding to the file IO operation request is the aggregate cache layer.
[0193] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps can be implemented: in the shared queue, determine through the data thread whether the data corresponding to the file IO operation request is cached data; the data thread is a thread generated when building the server process instance.
[0194] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps can be implemented: when monitoring the file IO operation request issued by the client to the distributed storage system, start the server process, and dynamically construct a server process instance using the status of the current computing node and the status of other computing nodes adjacent to the current computing node.
[0195] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps may be implemented: redirecting the file IO operation request to the aggregate cache layer through the data thread to read data from the aggregate cache layer.
[0196] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps may be implemented: configuring a mutual exclusion lock on the shared queue.
[0197] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps may be implemented: determining the storage location of the data in the aggregate cache layer based on the file path and the corresponding computing node.
[0198] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps may be implemented: broadcasting the file IO operation request to the computing nodes adjacent to the current computing node.
[0199] As an optional embodiment, when a computer subroutine stored in a non-volatile readable storage medium is executed by a processor, the following steps can be implemented: determining whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium; and performing cache eviction and replacement operations if it is determined that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium.
[0200] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps can be implemented: a dynamic link library is constructed based on the environment variables; and the dynamic link library is configured to intercept file IO operation requests.
[0201] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps may be implemented: redirecting the file IO operation request to the server process through a hash algorithm.
[0202] As an optional embodiment, when the computer subroutine stored in the non-volatile readable storage medium is executed by the processor, the following steps can be implemented: when the clearing condition is met, clear the data stored in the high-speed storage medium on the computing node.
[0203] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0204] The above description of the disclosed embodiments enables those skilled in the art to implement or use the embodiments of the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the embodiments of the present application. Therefore, the embodiments of the present application are not limited to the embodiments shown herein, but are intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A hierarchical caching method, characterized in that: Applied to each computing node of the distributed storage system, the hierarchical caching method includes: Using the client process to monitor the file IO operation request sent by the client to the distributed storage system, when the file IO operation request is monitored, redirecting the file IO operation request to the server process; Using the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer; In the case where the target storage location is not the aggregate cache layer, reading data corresponding to the file IO operation request from the bottom layer of the distributed storage system, and caching the data to the aggregate cache layer; In a case where the target storage location is the aggregate cache layer, the data is read from the aggregate cache layer and the data is returned to the client process so that the client process returns the data to the client.
2. The hierarchical caching method according to claim 1, characterized in that: The process of using the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer includes: Using the server process to insert the received file IO operation request into a shared queue; In the shared queue, determining whether the data corresponding to the file IO operation request is cached data; In the shared queue, when it is determined that the data corresponding to the file IO operation request is the cached data, it is determined that the target storage location corresponding to the file IO operation request is an aggregate cache layer.
3. The hierarchical caching method according to claim 2, characterized in that: In the shared queue, the process of determining whether the data corresponding to the file IO operation request is cached data includes: In the shared queue, whether the data corresponding to the file IO operation request is cached data is determined through a data thread; the data thread is a thread generated when constructing a server process instance.
4. The hierarchical caching method according to claim 3, characterized in that: The layered caching method further includes: When a file IO operation request from the client to the distributed storage system is monitored, the server process is started, and the server process instance is dynamically constructed using the status of the computing node and the status of other computing nodes adjacent to the computing node.
5. The hierarchical caching method according to claim 3, characterized in that: The process of reading the data from the aggregation cache layer includes: The file IO operation request is redirected to the aggregate cache layer through a data thread, so as to read the data from the aggregate cache layer.
6. The hierarchical caching method according to claim 2, characterized in that: While inserting the received file IO operation request into the shared queue by the server process, the layered caching method further includes: The shared queue is configured with a mutex lock.
7. The hierarchical caching method according to claim 2, characterized in that: The shared queue is a FIFO queue.
8. The hierarchical caching method according to claim 1, characterized in that: The data corresponding to the file IO operation request includes a file descriptor, a read offset and a length.
9. The hierarchical caching method according to claim 1, characterized in that: The layered caching method further includes: The storage location of the data in the aggregate cache layer is determined based on the file path and the corresponding computing node.
10. The hierarchical caching method according to claim 1, characterized in that: The layered caching method further includes: The file IO operation request is broadcasted to computing nodes adjacent to the computing node.
11. The hierarchical caching method according to claim 1, characterized in that: The layered caching method further includes: Determine whether the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium; When it is determined that the data set corresponding to the file IO operation request is larger than the total capacity of the local storage medium, a cache eviction operation and a replacement operation are performed.
12. The hierarchical caching method according to claim 1, characterized in that: The layered caching method further includes: A dynamic link library is constructed based on the environment variables; the dynamic link library is configured to intercept the file IO operation request.
13. The hierarchical caching method according to claim 1, characterized in that: The process of redirecting the file IO operation request to the server process includes: The file IO operation request is redirected to the server process through a hash algorithm.
14. The hierarchical caching method according to any one of claims 1 to 13, characterized in that: The aggregate cache layer is a cache layer composed of high-speed storage media in each of the computing nodes in the distributed storage system.
15. The hierarchical caching method according to claim 14, characterized in that: The high-speed storage medium is Nvme SSD.
16. The hierarchical caching method according to claim 14, characterized in that: The layered caching method further includes: When the clearing condition is met, the data stored in the high-speed storage medium on the computing node is cleared.
17. A hierarchical cache system, characterized in that: Applied to each computing node of the distributed storage system, the hierarchical cache system includes: A monitoring module is configured to monitor the file IO operation request sent by the client to the distributed storage system by using the client process, and redirect the file IO operation request to the server process when the file IO operation request is detected; a processing module configured to use the server process to determine whether the target storage location corresponding to the file IO operation request is an aggregate cache layer, and trigger a first reading module if the target storage location is not the aggregate cache layer, and trigger a second reading module if the target storage location is the aggregate cache layer; A first reading module is configured to read data corresponding to the file IO operation request from the bottom layer of the distributed storage system, and cache the data to the aggregate cache layer; The second reading module is configured to read the data from the aggregation cache layer and return the data to the client process, so that the client process returns the data to the client.
18. An electronic device, characterized in that: include: a memory arranged to store a computer program; A processor is configured to implement the steps of the hierarchical caching method according to any one of claims 1 to 16 when executing the computer program.
19. A distributed storage system, characterized in that: It includes a storage bottom layer module and multiple nodes, each of which includes a layered client process, a layered server process and a storage medium, and the storage medium of each node constitutes an aggregate cache layer, wherein: The layered client process is configured to monitor a file IO operation request issued by a client, and when the file IO operation request is monitored, redirect the file IO operation request to the layered server process; The layered server process is configured to determine whether the target storage location corresponding to the file IO operation request is the aggregate cache layer, and if the target storage location is not the aggregate cache layer, read the data corresponding to the file IO operation request from the storage bottom layer module and send the data to the aggregate cache layer, and if the target storage location is the aggregate cache layer, read the data from the aggregate cache layer and return the data to the layered client process, so that the layered client process returns the data to the client; The aggregation cache layer is configured to store data sent by the layered server process.
20. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hierarchical caching method according to any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Efficient data read from distributed storage systems
CN106164899A
Efficient data method and system in distributed storage system
CN110737541A
Multi-client cache method and system supporting distributed storage
CN111984191A
Control method and system based on low access delay distributed storage system
CN112363676A
SSD intelligent caching method and system based on distributed file storage client
CN113835614A
Cited By
Multi-stage caching method for accelerating AI data processing
CN119782008A
Target object processing method and device, storage medium and electronic equipment
CN120045472A
Key value cache management system and method in model, equipment and medium
CN120578608A
Key-value cache management system, method, device and medium in model
CN120578608B
