File system performance determination method, product, distributed storage system and medium
By receiving and analyzing the performance data of nodes in a distributed file system and performing performance monitoring based on the directory level, the problem of insufficient scalability and reliability of traditional file systems is solved, and refined monitoring of file system performance and efficient data processing are realized. .
Patent Information
- Application Number
- CN202411854101.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When facing the demand for large-scale data processing, traditional centralized file systems lack scalability and reliability, making it difficult to meet the growing data processing needs. Especially in the fields of cloud computing and big data, there is a lack of effective performance monitoring and analysis methods. .
Provide a file system performance determination method, by receiving the performance data corresponding to the directory sent by the receiving node, determine the directory performance data according to the read and write operation situation, and use the data structure in the form of key-value pair to save the total read and write operands and the total read and write bytes. The total processing time of the number and read and write requests are sent to the metadata server of the master node for parsing and storage, and performance monitoring and analysis are performed based on the directory level.
It realizes refined monitoring of file system performance, improves the search efficiency and storage efficiency of performance data, ensures efficient, flexible and reliable processing of data, can understand business performance, avoids duplicate data recording, and improves bandwidth utilization and Data transmission efficiency.
Smart Images

Figure CN119322721A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a file system performance determination method, product, distributed storage system and medium. Background Art
[0002] With the rapid development of information technology, the explosive growth of data has brought new challenges to data storage and management. Especially in the fields of cloud computing and big data, the demand for processing and analyzing large-scale data sets is increasing. Traditional centralized file systems have been unable to meet the growing data processing needs due to their scalability, performance and reliability limitations. Therefore, distributed file systems have emerged. By distributing data on multiple physical or logical storage devices, it provides an efficient, scalable and highly fault-tolerant solution.
[0003] Distributed file systems can provide a unified file access interface across multiple servers or nodes, allowing users to access files distributed in different physical locations as if they were local files, thereby greatly improving the efficiency and flexibility of data processing. With the rapid growth of data volume, it is particularly important to monitor and analyze the performance of distributed file systems.
[0004] It can be seen that providing a method for monitoring the performance of a distributed file system is a technical problem that people in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a file system performance determination method, product, distributed storage system and medium to solve the technical problem of monitoring and analyzing the performance of a distributed file system.
[0006] In order to solve the above technical problems, the present invention provides a method for determining file system performance, which is applied to a master node. The method comprises:
[0007] The performance data corresponding to the directory sent by the receiving node includes the master node and the slave node; the performance data corresponding to the directory is determined by the node according to the read and write operation; the directory corresponds to a unique code, and the unique code corresponding to the directory is saved in the form of file extension attributes;
[0008] Determining index data for characterizing directory performance according to performance data corresponding to the directory;
[0009] The performance of the file system is determined according to the indicator data.
[0010] On the one hand, the node determines the performance data corresponding to the directory according to the read and write operation conditions, including:
[0011] Pre-create a data structure in the form of a key-value pair; wherein the key-value pair is composed of a unique code of the directory and performance data corresponding to the directory;
[0012] From the start of the node's client operation to the current moment, the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests stored in the data structure are determined according to the read and write operations to serve as performance data corresponding to the directory.
[0013] On the other hand, the total number of read and write operations, the total number of read and write bytes, and the total processing time of the read and write requests stored in the data structure are determined according to the read and write operations as the performance data corresponding to the directory, including:
[0014] If the current write operation is detected to be completed, the processing time of the current write operation is obtained;
[0015] Obtain the current total number of write operations, the current total number of written bytes, and the total processing time of the current write request recorded in the data structure;
[0016] The current total number of write operations recorded in the data structure is incremented by 1 to serve as the total number of write operations stored in the data structure, the current total number of write bytes is incremented by 1 to serve as the total number of write bytes stored in the data structure, and the sum of the processing duration of the current write operation and the total processing duration of the current write request is taken as the total processing duration of the write request stored in the data structure;
[0017] If it is detected that the current read operation is completed, the processing time of the current read operation is obtained;
[0018] Obtain the current total number of read operations, the current total number of read bytes, and the total processing time of the current read request recorded in the data structure;
[0019] The current total number of read operations recorded in the data structure is increased by 1 as the total number of read operations saved in the data structure, the current total number of read bytes is increased by 1 as the total number of read bytes saved in the data structure, and the sum of the processing time of the current read operation and the total processing time of the current read request is used as the total processing time of the read request saved in the data structure.
[0020] On the other hand, the unique code is a number, and after the node determines the performance data corresponding to the directory according to the read and write operation, it also includes:
[0021] The performance data corresponding to each of the directories are stored in the same table according to the order of the unique codes of the directories and in a preset format;
[0022] Sending a table containing performance data corresponding to the directory to a metadata server of the master node;
[0023] After receiving the performance data corresponding to the directory sent by the node and before determining the indicator data used to characterize the directory performance according to the performance data corresponding to the directory, the method further includes:
[0024] Parsing the table containing the performance data corresponding to the directory in the metadata server according to the preset format to obtain the parsed performance data corresponding to the directory;
[0025] The performance data corresponding to the directory is stored in memory.
[0026] On the other hand, after the receiving node receives the performance data corresponding to the directory and before the determining the indicator data for characterizing the directory performance according to the performance data corresponding to the directory, the method further includes:
[0027] After detecting that the performance data corresponding to the directory is successfully received, sending a prompt message to the node for indicating that the performance data corresponding to the directory is successfully received, and entering the step of determining the indicator data for indicating the directory performance according to the performance data corresponding to the directory;
[0028] After detecting that the performance data corresponding to the directory is not successfully received, a prompt message indicating that the performance data corresponding to the directory is not successfully received is sent to the node, and the performance data corresponding to the directory sent by the receiving node is returned.
[0029] On the other hand, the determining of the indicator data for characterizing the performance of the directory according to the performance data corresponding to the directory includes:
[0030] Acquire performance data corresponding to the directory stored in the memory according to a preset period;
[0031] Obtaining a ratio of a difference between two adjacent performance data corresponding to the directory and the preset period;
[0032] The ratio is used as the indicator data for characterizing the directory performance.
[0033] On the other hand, after obtaining the ratio of the difference between the performance data corresponding to two adjacent directories and the preset period; and using the ratio as the indicator data for characterizing the directory performance, the method further includes:
[0034] The information corresponding to each directory is stored in the memory and the disk in the order of the time in which the performance data corresponding to the directory is obtained from the memory and the order of the unique codes of each directory; wherein the information corresponding to the directory includes the unique code of the directory, the performance data corresponding to the directory and the indicator data used to characterize the directory performance.
[0035] On the other hand, before storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes:
[0036] Obtain the number of directories to be stored and the size of information corresponding to the directories;
[0037] Memory space and disk space are pre-allocated to each of the directories according to the number of the directories and the size of the information corresponding to the directory.
[0038] On the other hand, after storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes:
[0039] Determining whether the information corresponding to the directory stored in the memory is the same as the information corresponding to the directory stored on the disk;
[0040] If not, then in the case where it is detected that the information corresponding to the directory stored in the memory is lost, reading the information corresponding to the directory from the disk;
[0041] The information corresponding to the directory read from the disk is stored in the memory.
[0042] On the other hand, after storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes:
[0043] Obtain the directory path name to be queried by the user through the command query interface;
[0044] Determine the unique code corresponding to the directory path name to be queried according to the pre-established relationship between the directory path name and the unique code corresponding to the directory;
[0045] When the path name of the directory to be queried is obtained from the memory according to the unique code corresponding to the path name of the directory to be queried, the information corresponding to the directory;
[0046] When displaying the path name of the directory to be queried, the information corresponding to the directory.
[0047] On the other hand, when the directory path name to be queried is obtained from the memory according to the unique code corresponding to the directory path name to be queried, after the information corresponding to the directory, and when the directory path name to be queried is displayed, before the information corresponding to the directory, it also includes:
[0048] Obtaining the target format of the information corresponding to the directory;
[0049] Determining whether the format of the information corresponding to the directory is consistent with the target format;
[0050] If yes, then entering the step of displaying the information corresponding to the directory when the directory path name to be queried is displayed;
[0051] If not, the format of the information corresponding to the directory is converted into the target format to obtain the information corresponding to the directory in the target format; and the step of displaying the information corresponding to the directory when the path name of the directory to be queried is entered.
[0052] In order to solve the above technical problems, the present invention also provides a method for determining file system performance, which is applied to a slave node, and the method comprises:
[0053] Get the status of read and write operations;
[0054] Determine the performance data corresponding to the directory according to the read and write operation; wherein the directory corresponds to a unique code, and the unique code corresponding to the directory is saved in the form of file extension attributes;
[0055] The performance data corresponding to the directory is sent to the master node, so that the master node determines the index data used to characterize the directory performance according to the performance data corresponding to the directory; and determines the performance of the file system according to the index data.
[0056] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above file system performance determination method when executed by a processor.
[0057] In order to solve the above technical problems, the present invention further provides a distributed storage system, comprising:
[0058] Memory for storing computer programs;
[0059] A processor is used to implement the steps of the above-mentioned file system performance determination method when executing the computer program.
[0060] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above file system performance determination method are implemented.
[0061] The beneficial effect of the present invention is that in the method, after the master node receives the performance data corresponding to the directory sent by the node, it determines the index data used to characterize the directory performance according to the performance data corresponding to the directory, and finally determines the performance of the file system according to the index data. The method realizes the monitoring of the file system performance; secondly, since the levels of the distributed file system are storage pool level, file system level and directory level from high to low, therefore, compared with the method of monitoring the performance of the file system based on the file system level, the method of analyzing the performance of the file system based on the directory level provided by the present invention realizes the refined monitoring of the file system performance, and by analyzing the performance data corresponding to the directory, it is possible to understand the performance of the business; thirdly, the node sends the performance data corresponding to the directory to the master node, and the master node further processes the performance data corresponding to the directory to determine the index data used to characterize the directory performance, realizing the unified management of the performance data corresponding to the directory of the node (including the master node and the slave node) by the master node. In addition, a unique code is set for the directory, and the path name is replaced by the unique code, which improves the efficiency of performance data search.
[0062] In addition, the unique code corresponding to the directory is saved as a file extension attribute, which reduces the data length of the unique code; the unique code of the directory and the performance data corresponding to the directory are saved in the form of key-value pairs, which can provide an efficient, flexible and reliable data storage solution, especially suitable for scenarios that require fast access and processing of large amounts of data.
[0063] When the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests stored in the data structure are determined according to the read and write operations as the performance data corresponding to the directory, when the read operation or write operation is completed, the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests are updated based on the data recorded in the data structure, thereby avoiding repeated recording of the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests corresponding to the same directory, and reducing the amount of data storage.
[0064] After the node determines the performance data corresponding to the directory according to the read and write operation, it stores the performance data corresponding to each directory in the same table according to the unique coding order of the directory and the preset format; and sends the table containing the performance data corresponding to the directory to the metadata server of the master node. That is, the performance data corresponding to multiple directories is transmitted at the same time, which improves the utilization rate of bandwidth and the efficiency of data transmission.
[0065] The master node uses the ratio of the difference between the performance data corresponding to two adjacent directories and the preset period as the index data for characterizing the directory performance, that is, based on the average value as the index data, which improves the accuracy of determining the file system performance.
[0066] The master node stores the information corresponding to each directory in memory and on disk in the order of the time in which the performance data corresponding to the directory is obtained from the memory and in the order of the unique codes of each directory. On the one hand, it enables the location of the information corresponding to the directory to be found quickly. On the other hand, the information corresponding to the directory is also stored on the disk, which realizes the persistent storage of the information corresponding to the directory, avoiding the situation in which all the data in the memory is lost after a failure scenario such as a power outage occurs, and the data before the failure cannot be obtained. And in the case of detecting that the information corresponding to the directory stored in the memory is lost, the information corresponding to the directory is read from the disk and stored in the memory to ensure that the data before the failure can be queried normally.
[0067] After receiving the performance data corresponding to the directory, the master node determines whether the master node has successfully received the performance data corresponding to the directory, and feeds back to the nodes (including the slave nodes and the master node itself) whether the performance data has been successfully received, so that the nodes can understand the transmission results of the performance data corresponding to the directory. If the master node fails to successfully receive the performance data corresponding to the directory, it returns the performance data corresponding to the directory sent by the receiving node, which ensures that the master node can successfully obtain the performance data corresponding to the directory as much as possible, and then realizes the analysis of the performance data corresponding to the directory.
[0068] The command query interface enables users to view the information corresponding to the directory when the directory path name to be queried; and when the format of the information corresponding to the directory is inconsistent with the target format, the format of the information corresponding to the directory is converted into the target format, so that the obtained information corresponding to the directory meets the user's needs.
[0069] The present invention also provides a file system performance determination method applied to a slave node, a computer program product, a distributed storage system and a computer-readable storage medium, which have the same or corresponding technical features as the file system performance determination method applied to a master node described above, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0071] Figure 1 A flowchart of a method for determining file system performance applied to a master node provided by an embodiment of the present invention;
[0072] Figure 2 An architectural diagram of a distributed file system provided by an embodiment of the present invention;
[0073] Figure 3 A schematic diagram of a message content structure provided by an embodiment of the present invention;
[0074] Figure 4 A schematic diagram of a directory-granularity performance statistics information format provided by an embodiment of the present invention;
[0075] Figure 5 A schematic diagram of a format of performance statistical indicators of each directory provided by an embodiment of the present invention;
[0076] Figure 6 A schematic diagram of querying data provided by an embodiment of the present invention;
[0077] Figure 7 A structural diagram of a distributed storage system provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0079] The core of the present invention is to provide a method, product, distributed storage system and medium for determining the performance of a file system, so as to solve the technical problem of monitoring and analyzing the performance of a distributed file system.
[0080] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 A flowchart of a method for determining file system performance applied to a master node provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0081] S10: receiving performance data corresponding to the directory sent by the node; wherein the performance data corresponding to the directory is determined by the node according to the read and write operation conditions;
[0082] S11: determining indicator data for characterizing directory performance according to performance data corresponding to the directory;
[0083] S12: Determine the performance of the file system according to the indicator data.
[0084] The distributed file system is composed of multiple nodes, including master nodes and slave nodes. There is no limitation on the selected master node, which is determined according to the actual situation. The file system levels are storage pool level, file system level and directory level from high to low. In the method for determining the performance of the file system, in order to achieve refined monitoring of the file system performance, the present invention analyzes the performance data corresponding to the directory.
[0085] Before the node determines the performance data corresponding to the directory according to the read and write operations, it creates the directory of the file system and sets a unique code for the directory. There is no limitation on the method of setting the unique code for the directory, as long as the unique codes corresponding to each directory are different. The unique code corresponding to the directory is saved in the form of file extension attributes, such as directly using a number to represent the unique code corresponding to the directory. The data length of the unique code is relatively short.
[0086] When a node determines the performance data corresponding to a directory according to the read and write operations, it pre-creates a data structure in the form of a key-value pair; wherein the key-value pair consists of a unique code of the directory and the performance data corresponding to the directory;
[0087] From the beginning of the client operation of the node to the current moment, the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests stored in the data structure are determined according to the read and write operations, as the performance data corresponding to the directory. Saving the unique code of the directory and the performance data corresponding to the directory in the form of key-value pairs can provide an efficient, flexible and reliable data storage solution, especially for scenarios that require fast access and processing of large amounts of data.
[0088] In order to avoid repeated recording of the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests corresponding to the same directory, and reduce the amount of data storage, in implementation, the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests stored in the data structure are determined according to the read and write operation conditions, so as to serve as the performance data corresponding to the directory, including:
[0089] If it is detected that the current write operation is completed, the processing time of the current write operation is obtained; the current total number of write operations, the current total number of write bytes, and the total processing time of the current write request recorded in the data structure are obtained; the current total number of write operations recorded in the data structure is increased by 1 as the total number of write operations saved in the data structure, the current total number of write bytes is increased by 1 as the total number of write bytes saved in the data structure, and the sum of the processing time of the current write operation and the total processing time of the current write request is used as the total processing time of the write request saved in the data structure;
[0090] If it is detected that the current read operation is completed, the processing time of the current read operation is obtained; the current total number of read operations, the current total number of read bytes, and the total processing time of the current read request recorded in the data structure are obtained; the current total number of read operations recorded in the data structure is increased by 1 as the total number of read operations saved in the data structure, the current total number of read bytes is increased by 1 as the total number of read bytes saved in the data structure, and the sum of the processing time of the current read operation and the total processing time of the current read request is used as the total processing time of the read request saved in the data structure.
[0091] After completing the read or write operation, the total number of read and write operations, the total number of read and write bytes, and the total processing time of the read and write requests are updated based on the data recorded in the data structure, thereby avoiding repeated recording of the total number of read and write operations, the total number of read and write bytes, and the total processing time of the read and write requests corresponding to the same directory, thereby reducing the amount of data storage.
[0092] In practice, there may be a situation where the master node fails to successfully receive the performance data corresponding to the directory sent by the node. In order to ensure that the master node can successfully receive the performance data corresponding to the directory sent by the node as much as possible, after receiving the performance data corresponding to the directory sent by the node, before determining the indicator data used to characterize the directory performance according to the performance data corresponding to the directory, it also includes:
[0093] After detecting that the performance data corresponding to the directory is successfully received, a prompt message is sent to the node for indicating that the performance data corresponding to the directory is successfully received, and the step of determining the indicator data for indicating the performance of the directory according to the performance data corresponding to the directory is entered;
[0094] After detecting that the performance data corresponding to the directory is not successfully received, a prompt message indicating that the performance data corresponding to the directory is not successfully received is sent to the node, and the step of returning to the performance data corresponding to the directory sent by the receiving node is returned.
[0095] After the above nodes complete the collection of performance data corresponding to the directory, the nodes can upload the performance data corresponding to the directory to the metadata server (MDS) of the master node one by one, or upload the performance data corresponding to multiple directories to the metadata server of the master node at the same time. In order to improve bandwidth utilization and data transmission efficiency, after the node determines the performance data corresponding to the directory according to the read and write operations, it also includes:
[0096] Store the performance data corresponding to each directory in the same table in the order of the unique codes of the directory (such as in the order of ID from small to large) and in accordance with the preset format;
[0097] Send a table containing performance data corresponding to the directory to the metadata server of the master node.
[0098] After receiving the performance data corresponding to the directory sent by the node, and before determining the indicator data used to characterize the performance of the directory according to the performance data corresponding to the directory, the method further includes:
[0099] Parsing the table containing the performance data corresponding to the directory in a preset format in the metadata server to obtain the parsed performance data corresponding to the directory;
[0100] Store the performance data corresponding to the directory in memory.
[0101] There is no limit on the preset format. For example, each row in the table is the directory id from left to right, the read and write operation status. There is no limit on the frequency at which the node sends the table containing the performance data corresponding to the directory to the metadata server of the master node. For example, start a timer in the node's client and send the collected data to the metadata server where the master node is located every 1 second.
[0102] In this method, after the node determines the performance data corresponding to the directory according to the read and write operation, it stores the performance data corresponding to each directory in the same table according to the order of the unique coding of the directory and in a preset format; and sends the table containing the performance data corresponding to the directory to the metadata server of the master node. That is, the performance data corresponding to multiple directories is transmitted at the same time, which improves the utilization rate of bandwidth and the efficiency of data transmission.
[0103] After receiving the performance data corresponding to the directory, the master node determines the indicator data used to characterize the directory performance according to the performance data corresponding to the directory, including:
[0104] Obtain performance data corresponding to the directory stored in the memory according to a preset period;
[0105] Obtaining the ratio of the difference between the performance data corresponding to two adjacent directories and the preset period;
[0106] The ratio is used as an indicator data for characterizing the performance of the directory.
[0107] There is no limit on the preset period, for example, the performance data corresponding to the directory stored in the memory is obtained every 5 seconds. The performance data corresponding to the directory collected at different preset periods can be found by means of timestamps.
[0108] In this method, the master node uses the ratio of the difference between the performance data corresponding to two adjacent directories and a preset period as the indicator data for characterizing the directory performance, that is, based on the average value as the indicator data, which improves the accuracy of determining the file system performance.
[0109] After obtaining the ratio of the difference between the performance data corresponding to two adjacent directories and the preset period; and using the ratio as the index data for characterizing the directory performance, the method further includes:
[0110] The information corresponding to each directory is stored in the memory and disk in the order of the time when the performance data corresponding to the directory is obtained from the memory and the order of the unique code of each directory; wherein the information corresponding to the directory includes the unique code of the directory, the performance data corresponding to the directory and the indicator data used to characterize the performance of the directory.
[0111] In this method, the master node stores the information corresponding to each directory in the memory and on the disk in the order of the time in which the performance data corresponding to the directory is obtained from the memory and the order of the unique codes of each directory. On the one hand, it enables the location of the information corresponding to the directory to be found quickly. On the other hand, the information corresponding to the directory is also stored on the disk, which realizes the persistent storage of the information corresponding to the directory, and avoids the situation in which all the data in the memory is lost after a failure scenario such as a power failure of the device occurs, and the data before the failure cannot be obtained. And in the case of detecting that the information corresponding to the directory stored in the memory is lost, the information corresponding to the directory is read from the disk and stored in the memory to ensure that the data before the failure can be queried normally.
[0112] It is worth noting that when the master node receives the performance data corresponding to the directories sent by multiple nodes (including the master node and the slave node), in order to distinguish the performance data corresponding to the directories sent by different node clients, the performance data corresponding to each directory is stored in the same table according to the order of the unique coding of the directory and in a preset format, including:
[0113] The performance data corresponding to all directories belonging to the same node are stored in the same table in the order of the unique codes of the directories and in a preset format.
[0114] According to the time sequence of obtaining the performance data corresponding to the directory from the memory and the sequence of the unique codes of each directory, the information corresponding to each directory is stored in the memory and the disk, including:
[0115] According to the time sequence of obtaining the performance data corresponding to the directories from the memory and the order of the unique codes of the directories, the information corresponding to all directories belonging to the same node is stored in continuous locations in the memory and in continuous locations in the disk.
[0116] In this method, the performance data corresponding to all directories belonging to the same node are stored in the same table, and the information corresponding to all directories belonging to the same node are stored in consecutive locations in the memory and in consecutive locations on the disk, so that the information corresponding to all directories belonging to the same node can be quickly found.
[0117] Before storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the sequence of the unique codes of each directory, the method further includes: obtaining the number of directories to be stored and the size of the information corresponding to the directory; and allocating memory space and disk space to each directory in advance according to the number of directories and the size of the information corresponding to the directory. By allocating memory space and disk space to each directory in advance, it is ensured that the information corresponding to the directory has enough space in the memory and disk for storage.
[0118] In practice, there may be failure scenarios such as device power failure, resulting in loss of information corresponding to the directory stored in the memory. In order to ensure that the data before the failure can be obtained, in implementation, after the information corresponding to each directory is stored in the memory and disk in the order of the time when the performance data corresponding to the directory is obtained from the memory and the order of the unique codes of each directory, the following is also included:
[0119] Determine whether the information corresponding to the directory stored in the memory is the same as the information corresponding to the directory stored on the disk;
[0120] If not, then in the case where it is detected that the information corresponding to the directory stored in the memory is lost, the information corresponding to the directory is read from the disk;
[0121] Store the information corresponding to the directory read from disk into memory.
[0122] After the information corresponding to the directory is stored in both the memory and the disk, in order to enable the user to understand the information corresponding to the directory, after the information corresponding to each directory is stored in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the sequence of the unique codes of each directory, the method further includes:
[0123] Obtain the directory path name to be queried by the user through the command query interface;
[0124] Determine the unique code corresponding to the directory path name to be queried according to the pre-established relationship between the directory path name and the unique code corresponding to the directory;
[0125] When the directory path name to be queried is obtained from the memory according to the unique code corresponding to the directory path name to be queried, the information corresponding to the directory;
[0126] When displaying the directory path name to be queried, the corresponding information of the directory.
[0127] That is, when the command query interface enables the user to view the directory path name to be queried, the directory corresponding information. The directory corresponding information stored in the memory and disk of the master node may not meet the user's needs (for example, the unit of the directory corresponding information stored in the memory and disk is not the unit commonly used by the user). In order to ensure that the information viewed by the user meets the user's needs, when the directory path name to be queried is obtained from the memory according to the unique code corresponding to the directory path name to be queried, after the directory corresponding information, when the directory path name to be queried is displayed, before the directory corresponding information, it also includes:
[0128] Get the target format of the information corresponding to the directory;
[0129] Determine whether the format of the information corresponding to the directory is consistent with the target format;
[0130] If yes, then the step of displaying the information corresponding to the directory when the directory path name to be queried is entered;
[0131] If not, the format of the information corresponding to the directory is converted into the target format to obtain the information corresponding to the directory in the target format; and the step of displaying the information corresponding to the directory when the directory path name to be queried is entered.
[0132] There is no limitation on the target format, which is determined according to the actual query requirements of the user. In this method, when the format of the information corresponding to the directory is inconsistent with the target format, the format of the information corresponding to the directory is converted into the target format, so that the acquired information corresponding to the directory meets the user's requirements.
[0133] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 2 An architecture diagram of a distributed file system provided by an embodiment of the present invention, such as Figure 2 As shown, it includes a master node and a slave node. Both the master node and the slave node include a client (the client is the interface for interacting with the user in the system, which is responsible for accessing and operating the data in the storage cluster, and realizes data access, request forwarding and interaction interface). In addition, the master node also includes a metadata server, a performance message processing module and a query interface.
[0134] In order to determine the performance of the file system, the nodes (master nodes and slave nodes) include a directory performance data collection module and a data message reporting module. The master node also includes a data message parsing module, a data summary calculation module, a data real-time maintenance and persistence module, and a performance data query and display module. The following describes each module.
[0135] 1. Directory performance data collection module:
[0136] In the node, add directory-level performance statistics function for the file system.
[0137] When creating a directory, a unique ID is assigned to the directory, which is used instead of the path name to improve the efficiency of performance statistics search. This ID is saved in the inode structure as a file extension attribute.
[0138] A global Map structure of directory performance statistics is added at the file system level, with the directory id as the key and the performance statistics data under the directory as the value. When a read or write request is initiated on a specified file system, the Client under the file system of that node will first determine whether the type of this request is read or write, and then accumulate the bandwidth according to the number of read and write bytes carried in the request, and record the time from the start of request processing to the completion of request processing. After the read and write operations are processed, the directory id is searched in the performance statistics Map to see if the data already exists in the Map. If the search is successful, the corresponding performance statistics data are updated; if not, new data is added to the Map.
[0139] 2. Data message reporting module:
[0140] The timer is started in the Client, and the collected Map data is sent to the MDS where the master node is located every second.
[0141] The message sent every second contains the data of all directories in the Client performance statistics Map at the current moment. These data are filled into the message structure in ascending order of id, and then the performance statistics message is sent to the MDS of the master node.
[0142] The Client of each file system on each node periodically sends messages to the master node in the above manner.
[0143] 3. Data message parsing module:
[0144] MDS on the master node: receives performance statistics sent by clients on each node. In the message thread, it processes the performance statistics message, parses the message structure, including the message source client, directory id, and its corresponding performance statistics, and stores it in the memory structure Metrics.
[0145] 4. Data summary calculation module:
[0146] In the performance statistics summary module of the master node, all performance statistics are calculated.
[0147] This module is executed every 5 seconds, traversing the Metrics memory structure. The calculation method is as follows:
[0148] Traverse all directory ids:
[0149] The current data is temporarily stored as the old data value for the next difference calculation.
[0150] Average number of operations per second (OPS): (total OPS of current data – total OPS of last saved data) / 5;
[0151] Average bandwidth: (total number of bytes of current data – total number of bytes of data saved last time) / 5;
[0152] Average latency: (total latency of current data – total latency of last saved data) / (total OPS of current data – total OPS of last saved data).
[0153] 5. Data real-time maintenance and persistence module:
[0154] After the performance data is calculated, it is saved in the memory of the master node performance statistics process for real-time query of performance statistics. At the same time, it is written to a local file in real time to persist on the disk to deal with situations such as device power outages and abnormal program restarts.
[0155] When the program runs normally, the data in the memory is consistent with the data on the disk. When a failure occurs and causes the data in the memory to be lost, the historical data is automatically read from the disk performance statistics file and initialized to the memory to ensure that the statistics before the failure can be queried normally.
[0156] 6. Performance data query and display module:
[0157] Based on the performance analysis tool, the system administrator is allowed to query the detailed performance data of the directory by specifying the directory path. It also supports inputting the query cycle and can query the directory performance statistics within the specified time.
[0158] The following takes the performance statistics of a file system supporting 20,000 secondary directories as an example to describe the specific embodiments of the present invention in detail.
[0159] 1. Assign an id to the directory when creating it:
[0160] When creating a directory under the specified file system fs_example, call the mkdir interface to create a new secondary directory, such as / fs_example / dir_example / ;
[0161] Call the setxattr interface to set the extended attribute dir_id:0 for this new directory;
[0162] When creating other directories under the file system, the extended attributes are also set, and the ID allocation is cumulative to ensure uniqueness under the same file system.
[0163] 2. Statistics directory performance on the Client:
[0164] When the Client is initialized, the global Map structure Perf_Map is allocated to save the statistical data of each directory (that is, the performance data corresponding to the directory) in the form of key-value. The key is the directory id, and the value is the cumulative number of read and write operations, the number of read and write bytes, and the total processing time of read and write requests in the directory since the Client was running.
[0165] Write request statistics: After the write operation is completed, the corresponding data is searched in Perf_Map according to the directory id. If the existing data is found, write_OPS+1, write_bw+number of bytes written this time, and write_delay+processing time of this write operation are updated based on this data.
[0166] Read request statistics: After the read operation is completed, the corresponding data is searched in Perf_Map according to the directory id. If the existing data is found, read_OPS+1, read_bw+number of bytes written this time, and read_delay+processing time of this write operation are updated based on this data.
[0167] 3. Data is aggregated to the master node MDS and analyzed and summarized:
[0168] When the client is initialized, the timer tick is started: it runs once every 1 second, and each cycle is executed as follows:
[0169] Traverse the performance statistics raw data: Perf_Map and fill the message structure. Figure 3 A schematic diagram of a message content structure provided by an embodiment of the present invention, such as Figure 3 As shown, the directories are arranged in ascending order according to their unique numbers, and each row is, from left to right, the unique number of the directory, the number of read operations (r_ops), the number of write operations (w_ops), the number of bytes read (r_bw), the number of bytes written (w_bw), the time consumed for reading (r_delay), and the time consumed for writing (w_delay).
[0170] After the message structure is filled, call send_message to send it to the master node MDS.
[0171] After the master node MDS receives the message from each node Client, it Figure 2 The structure shown parses the directory performance statistics contained in the message and stores the parsed data in the global data structure sum_dir_perf_array.
[0172] It is executed every 5 seconds, traversing the Metrics memory structure. The calculation method is as follows:
[0173] Traverse all directory ids:
[0174] The current data is temporarily stored as the old data value for the next difference calculation. The average OPS, average bandwidth, and average latency are calculated according to the calculation method in the data summary calculation module described above.
[0175] 4. Performance statistics data memory and file format:
[0176] Figure 4 A schematic diagram of a directory-granular performance statistics format provided by an embodiment of the present invention, where timestamps are sorted from small to large, and each row is, from left to right, timestamp, directory 1 statistics, directory 2 statistics, ..., and directory 20000 statistics. The statistics of each directory are read and write iops, bandwidth, and latency, and the length is 32 bytes.
[0177] Figure 4 In the example, the 30-minute real-time performance data of all 20,000 directories is maintained in the memory of the master node process, and the 5-second statistical average of the 20,000 directories is written to the stats_fs.perf file every 5 seconds. The memory space required for the 20,000 directories is reserved when the process is initialized.
[0178] 360 timestamp records are fixedly stored in the perf file; each timestamp record contains the timestamp (4 bytes) of the recording time and the performance statistics of up to 20,000 directories recorded at that time (960,000 bytes); the total length of each timestamp record is 960,004 B, and the space occupied by 360 records is fixed, which is about 330 MiB.
[0179] The data of each directory is stored in the corresponding position according to its id. For example, if the directory id is 0, it is stored in the first position of the timestamp record list, and so on.
[0180] The timestamp value is fixed to an integer multiple of 5 seconds, such as xxxx00, xxxx05, xxxx10, and xxxx15. Figure 5 A schematic diagram of a format of a performance statistical indicator of each directory provided by an embodiment of the present invention, such as Figure 5 As shown, from left to right are: number of read operations (r_ops), number of write operations (w_ops), number of read bytes (r_bw), number of write bytes (w_bw), time consumed in reading (r_delay) and time consumed in writing (w_delay), totaling 32 bytes.
[0181] 5. Query performance data interface:
[0182] When querying data, the directory ID is obtained according to the directory path name specified by the user, the data corresponding to the ID is read from the memory structure, and displayed on the terminal. Figure 6 A schematic diagram of querying data provided by an embodiment of the present invention. Figure 6 As shown in the figure, the timestamps are sorted from small to large, and each row is from left to right: timestamp, directory 1 statistics, directory 2 statistics, ... and directory 20000 statistics. Each time a directory is queried, only 32 * 360 bytes of data need to be read, without traversing the data of all directories.
[0183] In the method provided in the embodiment of the present invention, the file system performance is analyzed based on the performance data at the directory level. Compared with the performance data based on the global or file level, the method provided by the present invention can accurately perform performance statistics at the directory level, accurately reflect the performance differences under different directories, and provide a detailed performance analysis report for the system administrator, which helps to deeply understand the performance of each file system, facilitates the analysis of performance bottlenecks, and improves the accuracy of system optimization and fault diagnosis; and the use of an efficient data structure ensures efficient query and statistical analysis of performance data, thereby improving system maintenance and management efficiency.
[0184] A method for determining the performance of a file system applied to a master node is described above. This embodiment further provides a method for determining the performance of a file system applied to a slave node. The method includes:
[0185] Get the status of read and write operations;
[0186] Determine the performance data corresponding to the directory according to the read and write operation conditions; wherein the directory corresponds to a unique code, and the unique code corresponding to the directory is saved in the form of file extension attributes;
[0187] The performance data corresponding to the directory is sent to the master node, so that the master node determines the index data used to characterize the directory performance according to the performance data corresponding to the directory; and determines the performance of the file system according to the index data.
[0188] The method for determining the performance of a slave node file system provided in this embodiment has the same or corresponding technical features as the method for determining the performance of a master node file system described above. The embodiment of the method for determining the performance of a master node file system has been described in detail above, and the embodiment of the method for determining the performance of a slave node file system will not be repeated here, and the effect is the same as above.
[0189] In the above embodiments, the file system performance determination method is described in detail, and the present invention also provides a corresponding embodiment of the file system performance determination device. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0190] The file system performance determination device provided by the embodiment of the present invention, based on the perspective of functional modules, includes:
[0191] A receiving module, used for receiving performance data corresponding to a directory sent by a node; wherein the performance data corresponding to the directory is determined by the node according to the read and write operation conditions;
[0192] A first determination module, used to determine indicator data for characterizing directory performance according to performance data corresponding to the directory;
[0193] The second determination module is used to determine the performance of the file system according to the indicator data.
[0194] In some embodiments, the file system performance determination device further comprises:
[0195] A first storage module, used to store the performance data corresponding to each directory in the same table according to the order of the unique codes of the directories and in a preset format;
[0196] A first sending module, used for sending a table containing performance data corresponding to the directory to a metadata server of the master node;
[0197] In some embodiments, the file system performance determination device further comprises:
[0198] A parsing module, used to parse the table containing the performance data corresponding to the directory in a preset format in the metadata server to obtain the parsed performance data corresponding to the directory;
[0199] The second storage module is used to store the performance data corresponding to the directory in the memory.
[0200] In some embodiments, the file system performance determination device further comprises:
[0201] The third storage module is used to store the information corresponding to each directory in the memory and the disk according to the chronological order of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory; wherein the information corresponding to the directory includes the unique code of the directory, the performance data corresponding to the directory and the indicator data used to characterize the performance of the directory.
[0202] In some embodiments, the file system performance determination device further comprises:
[0203] A first acquisition module, used to acquire the number of directories to be stored and the size of information corresponding to the directories;
[0204] The allocation module is used to pre-allocate memory space and disk space for each directory according to the number of directories and the size of information corresponding to the directory.
[0205] In some embodiments, the file system performance determination device further comprises:
[0206] The first judgment module is used to judge whether the information corresponding to the directory stored in the memory is the same as the information corresponding to the directory stored on the disk; if not, the reading module is triggered;
[0207] The reading module is used to read the information corresponding to the directory from the disk when it is detected that the information corresponding to the directory stored in the memory is lost;
[0208] The fourth storage module is used to store the information corresponding to the directory read from the disk into the memory.
[0209] In some embodiments, the file system performance determination device further comprises:
[0210] The second acquisition module is used to obtain the directory path name to be queried by the user through the command query interface;
[0211] A third determining module, used to determine the unique code corresponding to the directory path name to be queried according to a pre-established relationship between the directory path name and the unique code corresponding to the directory;
[0212] A third acquisition module is used to acquire information corresponding to the directory when the directory path name to be queried is acquired from the memory according to the unique code corresponding to the directory path name to be queried;
[0213] The display module is used to display the information corresponding to the directory when the directory path name to be queried is displayed.
[0214] In some embodiments, the file system performance determination device further comprises:
[0215] A fourth acquisition module, used to acquire the target format of the information corresponding to the directory;
[0216] The second judgment module is used to judge whether the format of the information corresponding to the directory is consistent with the target format; if so, the display module is triggered; if not, the conversion module is triggered;
[0217] The conversion module is used to convert the format of the information corresponding to the directory into the target format to obtain the information corresponding to the directory in the target format; then trigger the display module.
[0218] In some embodiments, the file system performance determination device further comprises:
[0219] A third judging module is used to judge whether the performance data corresponding to the directory is successfully received; if so, the second sending module is triggered; if not, the third sending module is triggered;
[0220] A second sending module, used to send prompt information indicating that the performance data corresponding to the directory is successfully received to the node, and trigger the first determining module;
[0221] The third sending module is used to send prompt information to the node, which is used to indicate that the performance data corresponding to the directory has not been successfully received, and return to trigger the receiving module.
[0222] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0223] Figure 7 This is a structural diagram of a distributed storage system provided by an embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 7 As shown, the distributed storage system includes:
[0224] A memory 20, used for storing computer programs;
[0225] The processor 21 is used to implement the steps of the method for determining the performance of the file system mentioned in the above embodiment when executing the computer program.
[0226] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0227] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the file system performance determination method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the above-mentioned file system performance determination method, etc.
[0228] In some embodiments, the distributed storage system may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0229] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the distributed storage system, and may include more or fewer components than those shown in the figure.
[0230] The distributed storage system provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: a method for determining file system performance, with the same effect as above.
[0231] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned file system performance determination method when executed by a processor.
[0232] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps described in the above method embodiment (which may be a method corresponding to the master node side, or a method corresponding to the slave node side, or a method corresponding to both the master node side and the slave node side) are implemented.
[0233] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0234] The computer-readable storage medium provided by the present invention includes the above-mentioned method for determining file system performance, and has the same effect as above.
[0235] The above is a detailed introduction to the file system performance determination method, product, distributed storage system and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0236] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for determining file system performance, characterized in that: Applied to the master node, the method comprises: The performance data corresponding to the directory sent by the receiving node includes the master node and the slave node; the performance data corresponding to the directory is determined by the node according to the read and write operation; the directory corresponds to a unique code, and the unique code corresponding to the directory is saved in the form of file extension attributes; Determining indicator data for characterizing directory performance according to performance data corresponding to the directory; The performance of the file system is determined according to the indicator data.
2. The method for determining file system performance according to claim 1, characterized in that: The node determines the performance data corresponding to the directory according to the read and write operation conditions, including: Pre-create a data structure in the form of a key-value pair; wherein the key-value pair is composed of a unique code of the directory and performance data corresponding to the directory; From the start of the node's client operation to the current moment, the total number of read and write operations, the total number of read and write bytes, and the total processing time of read and write requests stored in the data structure are determined according to the read and write operations to serve as performance data corresponding to the directory.
3. The method for determining file system performance according to claim 2, characterized in that: The total number of read and write operations, the total number of read and write bytes, and the total processing time of the read and write requests stored in the data structure are determined according to the read and write operation conditions as the performance data corresponding to the directory, including: If the current write operation is detected to be completed, the processing time of the current write operation is obtained; Obtain the current total number of write operations, the current total number of written bytes, and the total processing time of the current write request recorded in the data structure; The current total number of write operations recorded in the data structure is incremented by 1 to serve as the total number of write operations stored in the data structure, the current total number of write bytes is incremented by 1 to serve as the total number of write bytes stored in the data structure, and the sum of the processing duration of the current write operation and the total processing duration of the current write request is taken as the total processing duration of the write request stored in the data structure; If it is detected that the current read operation is completed, the processing time of the current read operation is obtained; Obtain the current total number of read operations, the current total number of read bytes, and the total processing time of the current read request recorded in the data structure; The current total number of read operations recorded in the data structure is increased by 1 as the total number of read operations saved in the data structure, the current total number of read bytes is increased by 1 as the total number of read bytes saved in the data structure, and the sum of the processing time of the current read operation and the total processing time of the current read request is used as the total processing time of the read request saved in the data structure.
4. The method for determining file system performance according to claim 2 or 3, characterized in that: The unique code is a number. After the node determines the performance data corresponding to the directory according to the read and write operation, it also includes: The performance data corresponding to each of the directories are stored in the same table according to the order of the unique codes of the directories and in a preset format; Sending a table containing performance data corresponding to the directory to a metadata server of the master node; After receiving the performance data corresponding to the directory sent by the node and before determining the indicator data used to characterize the directory performance according to the performance data corresponding to the directory, the method further includes: Parsing the table containing the performance data corresponding to the directory in the metadata server according to the preset format to obtain the parsed performance data corresponding to the directory; The performance data corresponding to the directory is stored in memory.
5. The method for determining file system performance according to claim 4, characterized in that: After the receiving node receives the performance data corresponding to the directory, and before the determining the indicator data for characterizing the directory performance according to the performance data corresponding to the directory, the method further includes: After detecting that the performance data corresponding to the directory is successfully received, sending a prompt message to the node for indicating that the performance data corresponding to the directory is successfully received, and entering the step of determining the indicator data for indicating the directory performance according to the performance data corresponding to the directory; After detecting that the performance data corresponding to the directory is not successfully received, a prompt message indicating that the performance data corresponding to the directory is not successfully received is sent to the node, and the performance data corresponding to the directory sent by the receiving node is returned.
6. The method for determining file system performance according to claim 4, characterized in that: The determining of the indicator data for characterizing the performance of the directory according to the performance data corresponding to the directory includes: Acquire performance data corresponding to the directory stored in the memory according to a preset period; Obtaining a ratio of a difference between two adjacent performance data corresponding to the directory and the preset period; The ratio is used as the indicator data for characterizing the directory performance.
7. The method for determining file system performance according to claim 6, characterized in that: a ratio of a difference between the performance data corresponding to the directories obtained two times in succession and the preset period; After the ratio is used as the index data for characterizing the directory performance, the method further includes: The information corresponding to each directory is stored in the memory and the disk in the order of the time in which the performance data corresponding to the directory is obtained from the memory and the order of the unique codes of each directory; wherein the information corresponding to the directory includes the unique code of the directory, the performance data corresponding to the directory and the indicator data used to characterize the directory performance.
8. The method for determining file system performance according to claim 7, characterized in that: Before storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes: Obtain the number of directories to be stored and the size of information corresponding to the directories; Memory space and disk space are pre-allocated to each of the directories according to the number of the directories and the size of the information corresponding to the directory.
9. The method for determining file system performance according to claim 7, wherein: After storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes: Determining whether the information corresponding to the directory stored in the memory is the same as the information corresponding to the directory stored on the disk; If not, then in the case where it is detected that the information corresponding to the directory stored in the memory is lost, reading the information corresponding to the directory from the disk; The information corresponding to the directory read from the disk is stored in the memory.
10. The method for determining file system performance according to claim 7, characterized in that: After storing the information corresponding to each directory in the memory and the disk according to the time sequence of obtaining the performance data corresponding to the directory from the memory and the order of the unique codes of each directory, the method further includes: Obtain the directory path name to be queried by the user through the command query interface; Determine the unique code corresponding to the directory path name to be queried according to the pre-established relationship between the directory path name and the unique code corresponding to the directory; When the path name of the directory to be queried is obtained from the memory according to the unique code corresponding to the path name of the directory to be queried, the information corresponding to the directory; When displaying the path name of the directory to be queried, the information corresponding to the directory.
11. The method for determining file system performance according to claim 10, characterized in that: When the directory path name to be queried is obtained from the memory according to the unique code corresponding to the directory path name to be queried, after the information corresponding to the directory, and when the directory path name to be queried is displayed, before the information corresponding to the directory, it also includes: Obtaining the target format of the information corresponding to the directory; Determining whether the format of the information corresponding to the directory is consistent with the target format; If yes, then entering the step of displaying the information corresponding to the directory when the directory path name to be queried is displayed; If not, the format of the information corresponding to the directory is converted into the target format to obtain the information corresponding to the directory in the target format; and the step of displaying the information corresponding to the directory when the path name of the directory to be queried is entered.
12. A method for determining file system performance, characterized in that: Applied to a slave node, the method comprises: Get the status of read and write operations; Determine the performance data corresponding to the directory according to the read and write operations; wherein the directory corresponds to a unique code, and the unique code corresponding to the directory is saved in the form of a file extension attribute; send the performance data corresponding to the directory to the master node, so that the master node determines the indicator data used to characterize the directory performance according to the performance data corresponding to the directory; determine the performance of the file system according to the indicator data.
13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method for determining the performance of a file system according to any one of claims 1 to 12 are implemented.
14. A distributed storage system, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for determining file system performance as described in any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the performance of a file system according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
NFS service monitoring method, equipment, device, and readable storage medium
CN109063081A
Node.JS-based NoSQL database and establishing and processing method
CN111488339A
Method for implementing QOS function at directory level of distributed file system
WO2024212618A1
