A method, apparatus, device, and storage medium for flexible file latency control.

By using IO kernel functions in the Elastic File Service to monitor kernel-mode IO latency, the problems of inaccurate latency monitoring and poor user experience in existing technologies are solved, and accurate monitoring and performance optimization of the IO link are achieved.

CN116303323BActive Publication Date: 2026-07-17CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2022-11-30
Publication Date
2026-07-17

Smart Images

  • Figure CN116303323B_ABST
    Figure CN116303323B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and storage medium for flexible file latency management, comprising: a management node obtaining a latency monitoring switch field from a monitoring switch table in a database, and determining the latency monitoring status of each file gateway node based on the latency monitoring switch field; if the latency monitoring status is enabled, the management node sending latency request information to the corresponding file gateway node; the file gateway node receiving the latency request information, calculating the IO latency using the IO kernel function of the distributed file system, and sending the IO latency to the management node; and the management node updating the IO latency to the database. By using the IO kernel function to determine the execution time and IO quantity to calculate the IO latency of each layer of file gateway nodes, the latency information of the entire IO link can be completely monitored, thereby improving the accuracy of latency information and facilitating problem localization and analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of file system IO latency monitoring, and in particular to a method, apparatus, device and storage medium for flexible file latency management. Background Technology

[0002] The existing latency management of Elastic File Service controls the on / off switch for latency monitoring on file storage gateways via configuration files. When the switch is on, a scheduled task is started to acquire latency data on each storage gateway through simulated I / O and save it to the database. The existing latency management method of Elastic File Service, which relies on I / O testing tools such as fio to obtain latency through simulated I / O, is the latency of the user-space file system. It cannot accurately locate the latency of kernel-space I / O, nor can it fully analyze the I / O chain. Summary of the Invention

[0003] This application provides a method, apparatus, device, and storage medium for flexible file latency management, which can obtain the latency of kernel-mode I / O and improve the accuracy of latency data.

[0004] To achieve the above objectives, this application adopts the following technical solution:

[0005] Firstly, a method for managing the latency of flexible files is provided. This method includes: a management node obtaining a latency monitoring switch field from a monitoring switch table in a database, and determining the latency monitoring status of each file gateway node based on the latency monitoring switch field; if the latency monitoring status is enabled, the management node sends a latency request message to the corresponding file gateway node; the file gateway node receives the latency request message, calculates the IO latency using the IO kernel function of the distributed file system, and sends the IO latency to the management node; the management node updates the IO latency to the database.

[0006] As can be seen from the method described in the first aspect, the IO latency of each file gateway node is calculated by using IO kernel functions to determine the execution time and IO quantity. This not only monitors the user-space file system but also the kernel-space IO latency, thus enabling complete monitoring of the latency information of the entire IO link. This improves the accuracy of latency information and facilitates problem localization and analysis.

[0007] In conjunction with the first aspect, in one possible design scheme, the elastic file latency control method further includes: obtaining latency monitoring switch data updated by the user through a REST interface, wherein the latency monitoring switch data is used to indicate the latency monitoring status of at least one file gateway node in the distributed file system; and the management node updates the latency monitoring switch field according to the latency monitoring switch data.

[0008] Based on this possible design scheme, this embodiment can maintain a monitoring switch table in the file system database. The latency monitoring switch is controlled by updating the latency monitoring switch field in the table. It also supports REST interface control, allowing users to request interface control of the switch status, greatly improving the user experience. Users can control the latency monitoring switch to optimize issues causing poor user experience, thereby indirectly improving the maintainability of the file system.

[0009] In conjunction with the above design scheme, in some methods, the management node sends latency request information to the corresponding file gateway node, including: if the management node determines that the corresponding file gateway node has a latency monitoring timed task, it sends latency request information to the file gateway node periodically according to the latency monitoring timed task.

[0010] The latency monitoring timed task used in this embodiment may include a `probe start` function and a `probe end` function. Based on the possible design schemes described above, the step of calculating IO latency using the current file system's IO kernel function includes: executing the `probe start` function and recording the start time; continuously executing the IO kernel function when IO exists on the file gateway node; executing the `probe end` function, recording the timestamp of the distributed file system, calculating the function execution time of the IO kernel function (including the maximum and minimum execution times), and counting the number of IOs during the execution of the IO kernel function; and calculating the IO latency data based on the start time, the timestamp, the function execution time, and the number of IOs.

[0011] Based on this possible design scheme, this embodiment can calculate the IO latency of each file gateway node by controlling the IO kernel function execution time and IO quantity through a latency monitoring timer task. This enables the distributed file system to analyze the latency of the entire IO link, improves the accuracy of latency information, and facilitates problem localization and analysis.

[0012] Based on the above possible design schemes, the elastic file latency control method further includes: if the latency monitoring status is off, then the file gateway node does not have a latency monitoring scheduled task.

[0013] In conjunction with the first aspect, in another possible design, the IO kernel functions include one or more of nfsd / smb, vfs, xfs, krbd, and block.

[0014] In conjunction with the first aspect, in another possible design scheme, the distributed file system is the Cstor-SFS elastic file system.

[0015] Secondly, a flexible file latency control device is provided. This flexible file latency control device includes a management unit and a file gateway unit.

[0016] The management unit is used to obtain the latency monitoring switch field from the monitoring switch table of the database, and determine the latency monitoring status of each file gateway unit based on the latency monitoring switch field.

[0017] The management unit is also configured to send a latency request to the corresponding file gateway unit if the latency monitoring status is enabled.

[0018] The file gateway unit is used to receive the latency request information, calculate the IO latency using the IO kernel function of the distributed file system, and send the IO latency to the management unit.

[0019] The management unit is also used to update the IO latency to the database.

[0020] Optionally, the management unit for elastic file latency control described in the second aspect can also be used to: obtain latency monitoring switch data updated by the user through a REST interface, wherein the latency monitoring switch data is used to indicate the latency monitoring status of at least one file gateway node in the distributed file system, and the management node updates the latency monitoring switch field according to the latency monitoring switch data.

[0021] The aforementioned latency monitoring scheduled task may include a `probe start` function and a `probe end` function. Based on this, in some embodiments, the file gateway unit for elastic file latency management described in the second aspect above can specifically be used to: execute the `probe start` function and record the start time; continuously execute the IO kernel function when IO exists on the file gateway node; execute the `probe end` function, record the timestamp of the distributed file system, calculate the function execution time of the IO kernel function, the function execution time including the maximum execution time and the minimum execution time, and count the number of IOs during the execution of the IO kernel function; calculate the IO latency data based on the start time, the timestamp, the function execution time, and the number of IOs.

[0022] Optionally, in the elastic file latency management device described in the second aspect above, if the latency monitoring status is off, then the file gateway node does not have a latency monitoring timed task.

[0023] Optionally, in the elastic file latency management device described in the second aspect above, the IO kernel function includes one or more of nfsd / smb, vfs, xfs, krbd, and block.

[0024] Optionally, in the elastic file latency control device described in the second aspect above, the distributed file system is a Cstor-SFS elastic file system.

[0025] Furthermore, the technical effects of the flexible file latency control device described in the second aspect can be referred to the technical effects of the flexible file latency control method described in the first aspect, and will not be repeated here.

[0026] Thirdly, embodiments of this application provide an electronic device. The electronic device includes a processor and a memory; the memory stores a computer program, which, when executed by the processor, causes the electronic device to perform the method described in any of the implementations of the first aspect.

[0027] Fourthly, embodiments of this application provide a computer-readable storage medium, including: a computer program or instructions; when the computer program or instructions are run on a computer, the computer causes the computer to perform the method described in any possible implementation of the first aspect.

[0028] Fifthly, embodiments of this application provide a computer program product containing instructions, characterized in that the computer program product stores instructions that, when run on a computer, cause the computer to perform the method described in any possible implementation of the first aspect. Attached Figure Description

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

[0030] Figure 1 This is a schematic diagram illustrating the existing latency control methods for distributed file systems.

[0031] Figure 2 A flowchart illustrating the flexible file latency control method provided in this application embodiment;

[0032] Figure 3 A flowchart illustrating a flexible file latency control method provided in another embodiment of this application;

[0033] Figure 4A schematic diagram illustrating the execution process of a flexible file latency control method provided in an embodiment of this application;

[0034] Figure 5 A schematic diagram illustrating the execution process of a flexible file latency control method provided in another embodiment of this application;

[0035] Figure 6 A schematic diagram of the flexible file latency control device provided in the embodiments of this application;

[0036] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0037] Reference numerals: 600 - Flexible file latency control device; 610 - Management unit; 620 - File gateway unit; 2000 - Electronic device; 2001 - Processor; 2002 - Memory; 2003 - Transceiver; 2004 - Processor. Detailed Implementation

[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0039] In the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as an "example" in this application should not be construed as being better or more advantageous than other embodiments or design options. Specifically, the use of the word "example" is intended to present the concept in a concrete manner. Furthermore, in the embodiments of this application, the meaning expressed by "and / or" can be both, or it can be either one or the other.

[0040] In the embodiments of this application, "file storage gateway" and "file gateway node" may sometimes be used interchangeably. It should be noted that when the distinction is not emphasized, their intended meanings are consistent. Similarly, "of," "corresponding, relevant," and "corresponding" may sometimes be used interchangeably. It should be noted that when the distinction is not emphasized, their intended meanings are consistent.

[0041] The existing latency management of Elastic File Service controls the on / off switch for latency monitoring on file storage gateways via configuration files. When the switch is on, a scheduled task is started to acquire latency data on each storage gateway through simulated I / O and save it to the database. The existing latency management method of Elastic File Service, which relies on I / O testing tools such as fio to obtain latency through simulated I / O, is the latency of the user-space file system. It cannot accurately locate the latency of kernel-space I / O, nor can it fully analyze the I / O chain.

[0042] Compared to traditional file-sharing storage, Elastic File Service offers advantages such as file sharing, elastic scaling, high performance, high reliability, seamless integration with NFS and CIFS, ease of use, and low cost. Elastic File Service requires specific metrics to measure its operational status; IO latency is one of the key performance indicators for a file system. Developers and operations personnel can obtain latency information from Elastic File Service to promptly identify and locate problems when service anomalies occur.

[0043] The existing latency management method for Elastic File Service controls the on / off switch of latency monitoring on file storage gateways through configuration files. When the switch is on, a scheduled task is started to acquire latency data on each storage gateway through simulated I / O and save it to the database. The main problems are as follows:

[0044] 1. Controlling the latency monitoring switch via configuration file is very inflexible. Switching the switch status requires logging into all storage gateway nodes and modifying the configuration file, resulting in a poor user experience.

[0045] 2. The existing latency control methods of Elastic File Service are based on IO testing tools such as fio. The latency obtained by simulating IO is the latency of the user-space file system, which cannot accurately locate the latency of kernel-space IO and cannot fully analyze the IO link.

[0046] 3. The existing latency control method of Elastic File Service simulates I / O, which will preempt the hardware resources of the file storage service server and affect performance.

[0047] A file system centered on elastic file services can also be called a distributed file system. The latency management methods of a distributed file system mainly include four core steps, which will be discussed below. Figure 1 This paper elaborates on the latency management methods currently provided by distributed file systems.

[0048] Step 1: Update the latency monitoring switch by modifying the file gateway node configuration file.

[0049] Specifically, a field in the configuration file of each file gateway node can be used to control the on / off state of latency monitoring. If the field is a boolean value of True, it means that the switch is on; if the field is a boolean value of False, it means that the switch is off.

[0050] Step 2: The management node sends a request to obtain latency information based on the switch status.

[0051] Specifically, the management node can periodically obtain the on / off status of each file gateway node, and periodically send requests to file gateway nodes that are in the on state to obtain latency information.

[0052] Step 3: The file gateway node simulates I / O to obtain latency information and returns it to the management node.

[0053] Specifically, after receiving a latency request from the management node, the file gateway uses open-source I / O testing tools such as fio to simulate I / O and obtain the current latency of the file gateway. Finally, it returns the latency data to the management node.

[0054] Step 4: The management node updates the latency data to the database.

[0055] Therefore, it is evident that the latency monitoring method of the Elastic File Service, which involves modifying the file gateway node configuration file to update the latency monitoring switch, results in a poor user experience. Furthermore, obtaining the current file gateway latency through simulated I / O only captures the latency of the user-space file system and cannot accurately pinpoint the latency of kernel-space I / O. In other words, latency obtained through simulated I / O cannot provide a complete analysis of the I / O chain, severely impacting file gateway performance.

[0056] To address the aforementioned issues, the inventors of this application, after careful research, discovered that obtaining the latency of the file gateway through IO kernel functions can not only monitor the user-mode file system but also the latency of kernel-mode IO. This means that the latency information of the entire IO link can be monitored completely, thereby improving the accuracy of latency information and facilitating problem localization and analysis.

[0057] The following will combine Figure 2 The flexible file latency control method provided in the embodiments of this application will be described in detail. For example, Figure 2 This is a flowchart illustrating the flexible file latency control method provided in an embodiment of this application.

[0058] like Figure 2 As shown, the elastic file latency control method includes the following steps:

[0059] S210: The management node obtains the latency monitoring switch field from the monitoring switch table in the database, and determines the latency monitoring status of each file gateway node based on the latency monitoring switch field.

[0060] Specifically, if the latency monitoring switch field is a Boolean value of True, it means that the latency monitoring status is on, i.e., the switch is turned on. If the latency monitoring switch field is a Boolean value of False, it means that the latency monitoring status is off, i.e., the switch is off.

[0061] The management node can periodically update the latency monitoring switch field in the monitoring switch table of the database. As a specific implementation, the management node can obtain user-updated latency monitoring switch data via a REST interface. This latency monitoring switch data can be used to indicate the latency monitoring status of one or more file gateway nodes in the distributed file system. In other words, users can set the latency monitoring status of file gateway nodes through the REST interface. Upon receiving a REST request, the management node periodically updates the latency monitoring switch field in the database.

[0062] S220: If the latency monitoring status is enabled, the management node sends a latency request message to the corresponding file gateway node.

[0063] In some implementations, the management node, after determining that latency monitoring is enabled, must also ensure that a latency monitoring scheduled task exists at regular intervals when the switch is enabled before sending latency request information to the corresponding file gateway node.

[0064] Optionally, the distributed file system includes multiple file gateway nodes, each corresponding to a latency monitoring status. The management node will only send latency request information to file gateway nodes whose latency monitoring status is enabled and which have a latency monitoring scheduled task.

[0065] Optionally, if the latency monitoring status of the file gateway node is off, then the corresponding file gateway node does not have a latency monitoring scheduled task.

[0066] S230: The file gateway node receives the latency request information, calculates the IO latency using the IO kernel function of the distributed file system, and sends the IO latency to the management node.

[0067] Specifically, the elastic file service is implemented based on the kernel KRBD and shared via NFS or CIFS by the file gateway node. Data flows from the gateway node through kernel modules such as nfsd / smb, vfs, xfs, krbd, and block to the backend storage cluster. Therefore, in some embodiments of this application, after the file gateway node receives latency request information sent by the management node, it can use IO kernel functions such as sd / smb, vfs, xfs, krbd, and block to calculate the IO latency. Then, the IO latency is sent to the management node.

[0068] S240: The management node updates the IO latency to the database.

[0069] The management node updates the IO latency to the database, allowing developers and operations personnel to more thoroughly read the file system IO latency from the database.

[0070] The following will address... Figure 2 For a detailed explanation of the implementation details of S230, please refer to [link / reference]. Figure 3 .

[0071] Optionally, in some implementations, the latency monitoring timer task includes a `probe start` function and a `probeend` function. Then, the process of calculating IO latency using the IO kernel functions of the distributed file system in step S230 may include the following steps:

[0072] S310: Execute the probe start function and record the start time.

[0073] Specifically, the file gateway node can execute the probe start function registered in the latency monitoring task to register a structure that stores latency-related information, while also recording the current time and other information.

[0074] S320: When I / O exists at the file gateway node, the I / O kernel function is continuously executed.

[0075] Specifically, when the file storage gateway has I / O, the file gateway node can continuously execute the I / O kernel function.

[0076] S330: Execute the probe end function, record the timestamp of the distributed file system, calculate the function execution time of the IO kernel function, including the maximum execution time and the minimum execution time, and count the number of IOs during the execution of the IO kernel function.

[0077] Specifically, the file gateway node can execute the probe end function, which internally records timestamps, calculates function execution time, counts the number of I / O operations during the execution of the I / O kernel function, and updates and records the maximum and minimum execution times of the kernel function to a structure.

[0078] S340: The IO latency data is calculated based on the start time, the timestamp, the function execution time, and the number of IOs.

[0079] Specifically, the file gateway node can calculate the IO latency data within a given time period based on the start time, timestamp, function execution time, and IO quantity in the structure.

[0080] It should be noted that the distributed file system described in this application embodiment can be the Cstor-SFS elastic file system. Please refer to... Figure 4 In some implementations, the above-mentioned elastic file latency control method may specifically include the following steps:

[0081] Step 1: Request the REST interface to update the latency monitoring switch.

[0082] Specifically, the Cstor-SFS Elastic File Service provides a REST API to control the latency monitoring switch, and users can request the interface to control the switch status.

[0083] Step 2: The management node updates the latency monitoring switch status data in the database and updates the latency monitoring scheduled task.

[0084] Specifically, after receiving a REST request, the management node updates the latency monitoring switch field in the data, where True indicates the switch is on and False indicates the switch is off. It also ensures that a latency monitoring scheduled task exists when the switch is on, and does not exist when the switch is off.

[0085] Step 3: The management node periodically sends requests to the file gateway to obtain latency information.

[0086] Step 4: The file gateway node calculates the latency based on kernel functions and returns the result to the management node.

[0087] Specifically, it includes four processes. Figure 5 The diagram shows the Cstor-SFS elastic file service's latency calculation method based on kernel functions.

[0088] Procedure 1: Start the investigation (Probe start).

[0089] The probe start function registered by the line latency monitoring tool registers a structure that stores latency-related information, while also recording the current time and other information.

[0090] Step 2: Execute the kernel function.

[0091] When there is I / O at the file storage gateway, I / O-related kernel functions will be continuously executed.

[0092] Procedure 3: Probe end.

[0093] The `probe end` function is executed, which internally records the timestamp, calculates the function execution time, counts the number of I / O operations, and updates and records the maximum and minimum execution times of the kernel function to the structure.

[0094] Step 4: Data analysis.

[0095] The I / O latency data within the time period is calculated.

[0096] Step 5: The management node updates the latency data to the database.

[0097] In summary, the elastic file latency management method, apparatus, device, and storage medium proposed in this application can be applied to the file storage products of the CStor distributed file storage system. When analyzing the performance of the elastic file system, the method proposed in this application can significantly reduce the performance impact, while enabling the CStor-SFS elastic file service to analyze the latency of the entire IO link, thus improving the accuracy of monitoring information. Providing a REST interface to control the latency monitoring switch greatly enhances the user experience.

[0098] The specific execution process and effects of this flexible file latency control method have been described in the relevant parts of the above embodiments, and will not be repeated here.

[0099] based on Figure 1-5 The method for managing the latency of flexible files provided in the embodiments of this application has been described in detail. The following will describe in detail the virtual device corresponding to the method for managing the latency of flexible files provided in the embodiments of this application, namely the flexible file latency management device.

[0100] For example, Figure 6 This is a schematic diagram of the flexible file latency control device 600 provided in an embodiment of this application. Figure 6 As shown, the flexible file latency control device 600 includes a management unit 610 and a file gateway unit 620.

[0101] For ease of explanation, Figure 6 Only the main components of the flexible file latency control device 600 are shown. In some embodiments, the flexible file latency control device 600 is not limited to... Figure 6 The components shown may also include Figure 6 Other components besides those shown.

[0102] The management unit 610 is used to obtain the latency monitoring switch field from the monitoring switch table of the database, and determine the latency monitoring status of each file gateway unit based on the latency monitoring switch field.

[0103] The management unit 610 is also configured to send a latency request to the corresponding file gateway unit if the latency monitoring status is enabled.

[0104] File gateway unit 620 is used to receive the latency request information, calculate the IO latency using the IO kernel function of the distributed file system, and send the IO latency to the management unit;

[0105] The management unit 610 is also used to update the IO latency to the database.

[0106] Optionally, the management unit 610 for elastic file latency control can also be used to: obtain latency monitoring switch data updated by the user through a REST interface, wherein the latency monitoring switch data is used to indicate the latency monitoring status of at least one file gateway node in the distributed file system, and the management node updates the latency monitoring switch field according to the latency monitoring switch data.

[0107] The aforementioned latency monitoring scheduled task may include a `probe start` function and a `probe end` function. Based on this, in some embodiments, the file gateway unit 620 for elastic file latency control can specifically be used to: execute the `probe start` function and record the start time; continuously execute the IO kernel function when IO exists on the file gateway node; execute the `probe end` function, record the timestamp of the distributed file system, calculate the function execution time of the IO kernel function, the function execution time including the maximum and minimum execution times, and count the number of IOs during the execution of the IO kernel function; calculate the IO latency data based on the start time, the timestamp, the function execution time, and the number of IOs.

[0108] Optionally, in the above-mentioned flexible file latency control device, if the latency monitoring status is off, then the file gateway node does not have a latency monitoring timed task.

[0109] Optionally, in the above-mentioned elastic file latency control device, the IO kernel function includes one or more of nfsd / smb, vfs, xfs, krbd, and block.

[0110] Optionally, in the above-mentioned elastic file latency control device, the distributed file system is the Cstor-SFS elastic file system.

[0111] Furthermore, the technical effects of the aforementioned flexible file latency control device 600 can be referenced from the technical effects of the flexible file latency control method described in any of the above embodiments, and will not be repeated here.

[0112] Optionally, embodiments of this application also provide a computer-readable storage medium, which includes a computer program or instructions that, when executed on a computer, cause the flexible file latency control method or training method provided in any embodiment of this application to be executed.

[0113] Optionally, embodiments of this application also provide an electronic device for executing the flexible file latency control method and apparatus provided in any embodiment of this application.

[0114] like Figure 7As shown, electronic device 2000 may include processor 2001.

[0115] Optionally, the electronic device 2000 may also include a memory 2002 and / or a transceiver 2003.

[0116] The processor 2001 is coupled to the memory 2002 and the transceiver 2003, which can be connected via a communication bus.

[0117] The following is combined with Figure 7 A detailed introduction to each component of the electronic device 2000:

[0118] The processor 2001 is the control center of the electronic device 2000. It can be a single processor or a collective term for multiple processing elements. For example, the processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0119] Optionally, the processor 2001 can perform various functions of the electronic device 2000 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0120] In a specific implementation, as one example, the processor 2001 may include one or more CPUs, for example... Figure 7 CPU0 and CPU1 are shown in the diagram.

[0121] In a specific implementation, as one example, the electronic device 2000 may also include multiple processors, for example... Figure 7 The processors 2001 and 2004 are shown. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0122] The memory 2002 is used to store the software program that executes the solution of this application, and is controlled by the processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0123] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the processor 2001 or may exist independently and be accessible through the interface circuit of the electronic device 2000. Figure 7 (Not shown in the image) is coupled to processor 2001, and this embodiment does not specifically limit this.

[0124] Transceiver 2003 is used for communication with other electronic devices. For example, if electronic device 2000 is a mobile terminal, transceiver 2003 can be used to communicate with a network device or with another terminal device. As another example, if electronic device 2000 is a network device, transceiver 2003 can be used to communicate with a terminal device or with another network device.

[0125] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 7 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0126] Optionally, the transceiver 2003 can be integrated with the processor 2001, or it can exist independently and be connected via the interface circuit of the electronic device 2000. Figure 7 (Not shown in the image) is coupled to the processor 2001, and this embodiment does not specifically limit this.

[0127] It should be noted that, Figure 7The structure of the electronic device 2000 shown does not constitute a limitation on the electronic device. Actual electronic devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0128] Furthermore, the technical effects of the electronic device 2000 can be referenced from the technical effects of the flexible file latency control method described in the above method embodiments, and will not be repeated here.

[0129] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0130] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0131] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0132] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0133] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0134] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0135] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0136] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0139] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0140] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0141] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for flexible file latency control, characterized in that, Applied to a distributed file system, which includes a management node and a file gateway node, the method includes: The management node obtains the latency monitoring switch field from the monitoring switch table in the database, and determines the latency monitoring status of each file gateway node based on the latency monitoring switch field. If the latency monitoring status is enabled, the management node sends latency request information to the corresponding file gateway node. If the management node determines that the corresponding file gateway node has a latency monitoring scheduled task, it sends latency request information to the file gateway node at regular intervals according to the latency monitoring scheduled task. The file gateway node receives the latency request information, calculates the IO latency using the IO kernel function of the distributed file system, and sends the IO latency to the management node. The latency monitoring scheduled task includes the `probe start` function and the `probe end` function, which calculate IO latency using the current distributed file system's IO kernel functions, including: Execute the probe start function and record the start time. When I / O exists at the file gateway node, the I / O kernel function is continuously executed; The probe end function is executed to record the timestamp of the distributed file system, calculate the function execution time of the IO kernel function, including the maximum and minimum execution times, and count the number of IO operations during the execution of the IO kernel function. The IO latency data is calculated based on the start time, the timestamp, the function execution time, and the number of IOs. The management node updates the IO latency to the database.

2. The method according to claim 1, characterized in that, The method further includes: The latency monitoring switch data updated by the user is obtained through the REST interface. The latency monitoring switch data is used to indicate the latency monitoring status of at least one file gateway node in the distributed file system. The management node updates the latency monitoring switch field based on the latency monitoring switch data.

3. The method according to claim 1, characterized in that, If the latency monitoring status is off, then the file gateway node does not have a latency monitoring scheduled task.

4. The method according to claim 1, characterized in that, The IO kernel functions include one or more of nfsd / smb, vfs, xfs, krbd, and block.

5. The method according to claim 1, characterized in that, The distributed file system is the Cstor-SFS elastic file system.

6. A flexible file latency control device, characterized in that, The device includes: The management unit is used to obtain the latency monitoring switch field from the monitoring switch table of the database, and determine the latency monitoring status of each file gateway unit based on the latency monitoring switch field. The management unit is further configured to send latency request information to the corresponding gateway unit if the latency monitoring status is enabled; if the management unit determines that the corresponding file gateway node has a latency monitoring timed task, it sends latency request information to the file gateway node at regular intervals according to the latency monitoring timed task; wherein the file gateway node receives the latency request information, calculates the IO latency using the IO kernel function of the distributed file system, and sends the IO latency to the management unit. The file gateway unit is used to receive the latency request information, calculate the I / O latency using the I / O kernel functions of the distributed file system, and send the I / O latency to the management unit. The latency monitoring scheduled task includes a probestart function and a probe end function, and calculates the I / O latency using the current distributed file system's I / O kernel functions, including: Execute the probe start function and record the start time. When I / O exists at the file gateway node, the I / O kernel function is continuously executed; The probe end function is executed to record the timestamp of the distributed file system, calculate the function execution time of the IO kernel function, including the maximum and minimum execution times, and count the number of IO operations during the execution of the IO kernel function. The IO latency data is calculated based on the start time, the timestamp, the function execution time, and the number of IOs. The management unit is also used to update the IO latency to the database.

7. An electronic device, characterized in that, include: Processor, the processor being coupled to memory; The processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program or instructions that, when executed on a computer, cause the method as described in any one of claims 1-5 to be performed.