Kernel mounting mode-based write operation traffic statistics method, system and device
By establishing a mapping relationship between directories and clients in the distributed file system, monitoring storage capacity and file handle access counts, indirectly calculating client write operation traffic and implementing optimization strategies, the problem of difficulty in monitoring client traffic under kernel mounting mode is solved, thus improving the stability and security of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 709TH RESEARCH INSTITUTE CHINA STATE SHIPBUILDING CORP LTD
- Filing Date
- 2026-02-14
- Publication Date
- 2026-06-30
AI Technical Summary
In distributed file systems, when accessing via kernel mounting, it is difficult to achieve real-time and accurate client traffic monitoring, which can lead to a large amount of storage system bandwidth being consumed by a single client or being subjected to denial-of-service attacks, affecting system stability and security.
By establishing a mapping relationship between directories and clients, the storage capacity changes and file handle access counts of the target directory are monitored, the write operation traffic of the client is indirectly calculated, and optimization strategies are implemented to improve system stability.
It enables real-time monitoring and optimization of client write traffic in kernel-mounted mode, preventing excessive client access and improving the stability and security of the distributed file system.
Smart Images

Figure CN122309453A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage system operation and maintenance and optimization technology, and in particular to a write operation traffic statistics method, system and device based on kernel mounting. Background Technology
[0002] In existing distributed file systems, if access to the distributed file system is via a gateway proxy, all client read and write requests must be forwarded through the gateway. The gateway can collect all traffic between clients and the distributed file system, allowing for centralized collection and monitoring of traffic data at the gateway level. However, this approach introduces additional protocol conversion and data forwarding overhead, leading to significant performance degradation. For example, creating a Network File System (NFS) service using a gateway proxy in a distributed file system and publishing the file systems within the distributed file system externally via the NFS protocol, enabling clients to easily access the distributed file system via NFS, introduces additional protocol conversion and data forwarding overhead, resulting in the aforementioned problem. Similarly, providing file-sharing services externally using the Server Message Block (SMB) protocol via a gateway proxy, allowing clients to access the distributed file system from a remote file server via the standard SMB protocol, also introduces additional protocol conversion and data forwarding overhead, resulting in the same problem.
[0003] To improve the performance of distributed file systems (DSPs), many scenarios opt to access the DSP directly via kernel mounting. This method bypasses user-space gateways or intermediate proxies, allowing clients to communicate directly with the DSP, making real-time and accurate client traffic monitoring difficult. Without monitoring client read / write traffic, the storage system's bandwidth can be heavily consumed by a single client or subjected to denial-of-service (DoS) attacks, thus compromising the security and stability of the DSP.
[0004] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention proposes a write operation traffic statistics method and device based on kernel mounting, which can improve the stability of the distributed file system while accessing the distributed file system using kernel mounting.
[0006] The embodiments of the present invention adopt the following technical solutions: In a first aspect, the present invention provides a write operation traffic statistics method based on kernel mounting, specifically: establishing a mapping relationship between all directories in the distributed file system and the client, and identifying at least one target directory accessed by the client within a preset time period; Monitor each target directory, obtain the storage capacity change value of the target directory within the preset time period, and the number of file handle accesses of the target directory; Based on the storage capacity change value and the number of file handle accesses, the write operation traffic of each client to the target directory is calculated, and at least one optimization strategy is implemented based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
[0007] Preferably, the file handle access count includes the client's file handle access count and the total file handle access count. The formula for calculating the directory write operation traffic for each client is as follows: ; in, This represents the write traffic to the directory for each client. This represents the change in storage capacity of the target directory within a preset time period. Represents a preset time period. This represents the number of file handle accesses per client. This represents the total number of file handle accesses.
[0008] Preferably, the method further includes: Using the directory name as the primary key, a mapping relationship between directories and clients is constructed in the distributed file system, generating a target mapping table. Based on the directory status in the directory mapping table, at least one target directory that will be accessed by the client within a preset time period is determined.
[0009] Preferably, the method further includes: Using the directory name of the target directory as the filtering condition, and according to the client IP, the file handle access count of each client is obtained from the directory mapping table, and the sum of the file handle access counts of each client is taken as the total file handle access count.
[0010] Preferably, the directory mapping table includes multiple directory entries, and the method further includes: If an administrator creates a directory in the distributed file system, a directory entry is added to the directory mapping table. If an administrator deletes a directory in the distributed file system, then that directory entry will be deleted from the directory mapping table.
[0011] Preferably, the method further includes: The directory storage capacity is obtained through the rafos interface in the distributed file system, so as to calculate the change in the storage capacity of the target directory within the preset time period.
[0012] Preferably, the method further includes: Monitor the load of the distributed file system and dynamically adjust the preset time period based on the load.
[0013] Secondly, the present invention provides a write operation traffic statistics system based on kernel mounting, specifically: a directory mapping module, used to establish the mapping relationship between all directories in the distributed file system and the client, and to identify at least one target directory accessed by the client within a preset time period. The monitoring module is used to monitor each target directory, obtain the storage capacity change value of the target directory within the preset time period, and the number of file handle accesses of the target directory; The calculation and optimization module is used to calculate the write operation traffic of each client to the target directory based on the storage capacity change value and the number of file handle accesses, and to implement at least one optimization strategy based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
[0014] Thirdly, the present invention provides a write operation traffic statistics device based on kernel mounting, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor to perform the write operation traffic statistics method based on kernel mounting in the first aspect.
[0015] Fourthly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions, which are executed by one or more processors to perform the write operation traffic statistics method based on kernel mounting described in the first aspect.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: For all directories in the distributed file system, at least one target directory accessed by the client within a preset time period is identified, each target directory is monitored, and the storage capacity change value of the target directory is obtained. The storage capacity change of the target directory is considered to be caused by the client accessing the target directory. At this time, the file handle access count of the target directory is obtained, and the write operation traffic of the client to the target directory is indirectly obtained using the storage capacity change value of the target directory and the file handle access count of the target directory. Thus, under the premise that the kernel mounts and accesses the distributed file system, the write traffic of the client is monitored, and at least one optimization strategy is implemented according to the write operation traffic of each client to the target directory to ensure that no client overwhelms the distributed file system, thereby improving the stability of the distributed file system. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0018] Figure 1 This is a flowchart illustrating a write operation traffic statistics method based on kernel mounting provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the method for identifying a target directory provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the method for creating a directory mapping table provided in an embodiment of the present invention; Figure 4 This is a flowchart of a write operation traffic statistics method based on kernel mounting provided in an embodiment of the present invention; Figure 5 A schematic diagram of a write operation traffic statistics device based on kernel mounting method provided in an embodiment of the present invention; The accompanying figure is labeled as follows: 21: Processor; 22: Memory. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0020] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is interpreted as openly inclusive, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples; that is, although they may be incorporated into embodiments or examples using the above terms for reasons such as order and position, it does not limit them to be incorporated in combination by a single embodiment or example.
[0021] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, for example, the description may use the prefix "A" or "B" to describe the same type of nouns as two independent entities. In this case, the corresponding features defined with "A" and "B" are used only to distinguish between similar entities and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.
[0022] In the description of this invention, the expression “A and / or B” (where A and B are used to formally represent specific features) will be used. The corresponding expression includes the following three combinations: only A, only B, and a combination of A and B.
[0023] As used in this invention, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from a particular value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).
[0024] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0025] The inventors discovered that when accessing a distributed file system using kernel mounting, the entire input / output path is completed within the kernel space, and communication is based on the native protocol of the distributed file system without any instrumented or interceptable intermediate layers. Therefore, there is a lack of effective traffic observation points. Furthermore, the operating system kernel itself does not expose fine-grained interfaces for distributed file system read / write traffic statistics. This makes it difficult to monitor client traffic in real-time and accurately for such direct access without modifying kernel modules or the distributed file system's client code. This creates a natural weakness of kernel mounting in monitoring client read / write traffic. Kernel mounting, on the other hand, involves mounting a remote distributed file system to the local directory tree through a kernel-supported client module, allowing applications to access the distributed file system as if it were a local file. This method does not introduce additional protocol conversion or data forwarding overhead.
[0026] To address this issue, this invention proposes a write operation traffic statistics system and a matching traffic statistics method based on kernel mounting, which are used in conjunction with the write operation traffic statistics method based on kernel mounting. By monitoring changes in the storage capacity of the directory, write operation traffic is indirectly calculated, thereby enabling the monitoring of write operation traffic without modifying the kernel module or the client code of the distributed file system. The specific traffic statistics method can be found in the following embodiments.
[0027] Example 1: This invention provides a write operation traffic statistics system based on kernel mounting, which is used in conjunction with a write operation traffic statistics method based on kernel mounting. The system includes a directory mapping module, a monitoring module, and a calculation and optimization module. The directory mapping module establishes a mapping relationship between all directories in the distributed file system and clients, identifying at least one target directory accessed by clients within a preset time period. The monitoring module monitors each target directory, obtaining the storage capacity change value of the target directory within the preset time period, as well as the number of file handle accesses to the target directory. The calculation and optimization module calculates the write operation traffic of each client to the target directory based on the storage capacity change value and the number of file handle accesses, and implements at least one optimization strategy based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
[0028] This invention is based on accessing a distributed file system through kernel mounting of a distributed file system protocol, and monitors the write operation traffic of the client to the directory.
[0029] like Figure 1 As shown, Embodiment 1 of the present invention provides a write operation traffic statistics method based on kernel mounting, which specifically includes the following steps: Step 101: Establish the mapping relationship between all directories in the distributed file system and the client, and identify at least one target directory that is accessed by the client within a preset time period.
[0030] In the kernel-mounted access to distributed file systems, clients access resources in the distributed file system by accessing directories. A directory refers to a local path that the administrator has pre-created and mounted the distributed file system with relevant commands, serving as the entry point for accessing the distributed file system. The distributed file system can be CephFS, GlusterFS, lusterFS, or MooseFS.
[0031] A client can access multiple directories, and a directory can also be accessed by multiple clients. Within a preset time period, at least one target directory is accessed by the client. That is, within the preset time period, the directories accessed by the client in all directories of the distributed file system are taken as target directories. Subsequently, only each target directory and the client related to accessing it are considered.
[0032] Step 102: Monitor each target directory, obtain the storage capacity change value of the target directory within the preset time period, and the number of file handle accesses of the target directory.
[0033] Among them, the change in storage capacity of the target directory refers to the change in the total storage space occupied by all files in the target directory, including the increase or decrease in bytes caused by adding, deleting or modifying files; the number of file handle accesses in the target directory refers to the number of file handles in the target directory that are currently open and being accessed by clients, reflecting the level of concurrent access activity of files in the target directory.
[0034] Step 103: Calculate the write operation traffic of each client to the target directory based on the storage capacity change value and the number of file handle accesses, and implement at least one optimization strategy based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
[0035] If the storage capacity of the target directory changes within a preset time period, and the target directory is accessed by the client, the change in the storage capacity of the target directory can be considered as caused by the client's access. At this time, the number of file handle accesses to the target directory can be obtained, and the write operation traffic of each client to the target directory can be calculated based on the storage capacity change value and the number of file handle accesses. In this way, under the premise that the kernel mounts and accesses the distributed file system, the operation traffic of the client can be monitored.
[0036] In one embodiment, the file handle access count includes the number of file handle accesses by the client and the total number of file handle accesses. The formula for calculating the directory write operation traffic for each client is as follows: ; in, This represents the write traffic to the directory for each client. This represents the change in storage capacity of the target directory within a preset time period. Represents a preset time period. This represents the number of file handle accesses per client. This represents the total number of file handle accesses.
[0037] For example, if the storage capacity of a target directory increases by 10TB, and this target directory is accessed by 3 clients (client 1, client 2, and client 3), client 1 has 100 file handle accesses, client 2 has 200 file handle accesses, and client 3 has 300 file handle accesses, then the total number of file handle accesses is 600. In this case, client 1 is considered to occupy 1 / 6 of the total traffic. The total traffic is the quotient of the change in the target directory's storage capacity and the preset time period.
[0038] Monitoring client operation traffic is crucial to prevent a single client from excessively consuming distributed file system resources due to abnormal behavior or malicious attacks (such as DoS attacks), leading to decreased storage performance or even service unavailability and reduced stability. Therefore, optimization strategies can consider multiple aspects, including bandwidth limiting, abnormal behavior detection and response, and resource priority adjustment. Implementing at least one optimization strategy for the distributed file system can improve the stability and security of the storage system. For example, a bandwidth limiting strategy might be implemented when a client's write operation traffic to a target directory exceeds a preset limit. An abnormal behavior detection and response strategy might be triggered when a client's write operation traffic to a target directory consistently exceeds a preset limit for a certain period, indicating abnormal access behavior, thus triggering an alarm and cutting off access to that client. A resource priority adjustment strategy might lower the priority of a client when its write operation traffic to a target directory exceeds a preset limit, ensuring that other high-priority clients can access the distributed file system.
[0039] In this embodiment, for all directories in the distributed file system, at least one target directory accessed by a client within a preset time period is identified. Each target directory is monitored, and the storage capacity change value of the target directory is obtained. The storage capacity change of the target directory is considered to be caused by the client accessing the target directory. At this time, the file handle access count of the target directory is obtained. The write operation traffic of the client to the target directory is indirectly obtained using the storage capacity change value of the target directory and the file handle access count of the target directory. Thus, under the premise that the kernel mounts and accesses the distributed file system, the write traffic of the client is monitored, and at least one optimization strategy is implemented according to the write operation traffic of each client to the target directory to ensure that no client overwhelms the distributed file system, thereby improving the stability of the distributed file system.
[0040] Furthermore, before calculating the write traffic to the directory for each client, the load of the distributed file system is monitored, and the preset time period is dynamically adjusted based on the load to avoid excessive impact on system load by sacrificing computational accuracy. Specifically: since the computation process frequently uses CPU resources, when the load of the distributed file system storage system is high (greater than the set first load threshold), the preset time period is increased, resulting in a smaller computational load per unit time and lower CPU resource consumption, but lower computational accuracy. When the load of the distributed file system storage system is low (less than the set second load threshold), the preset time period is decreased, resulting in higher CPU resource consumption but higher computational accuracy. For example, the accuracy of computation every 1 second is higher than that of computation every 10 seconds, but the CPU resource consumption per second is also higher. The first and second load thresholds can be set based on experience.
[0041] The present invention also constructs a directory mapping table to record the mapping relationship between directories in the distributed file system and clients.
[0042] like Figure 2 As shown, this embodiment of the invention provides a method for identifying a target directory, which specifically includes the following steps: Step 201: Using the directory name as the primary key, construct the mapping relationship between directories and clients in the distributed file system, and generate the target mapping table.
[0043] The directory mapping table includes multiple directory information entries. Each entry includes the directory name, the client's Internet Protocol (IP), whether it is mounted, and the metadata group it belongs to. A metadata group includes directory attributes for multiple directories, which are used to record client information for mounting the directory (e.g., client IP), client information for accessing the directory, client information for unmounting the directory, and the number of times it has been accessed.
[0044] The monitoring module includes a directory monitoring module and a metadata monitoring module. The directory monitoring module is used to monitor the status of each directory and the changes in the storage capacity of each directory, while the metadata monitoring module is used to monitor the changes in the directory attributes under each metadata group.
[0045] Step 202: Based on the directory status in the directory mapping table, determine at least one target directory that is accessed by the client within a preset time period.
[0046] The directory monitoring module monitors the directory status of each directory. If certain directories are accessed within a preset time period, the accessed directories are used as target directories. The directory mapping module updates the directory mapping table. That is, the directory mapping module records the client IP that accessed the target directory in the corresponding position of the directory mapping table according to the directory name of the target directory, and updates the directory attributes in the corresponding metadata group according to the directory name of the target directory.
[0047] If certain directories are mounted within a preset time period, the directory mapping module updates the directory mapping table. That is, the directory mapping module records the client IP of the mounted directory in the corresponding position of the directory mapping table according to the directory name of the mounted directory. Since the client only establishes a connection with the directory when mounting the directory, it will not generate access counts, so the corresponding metadata group will not be updated at this time.
[0048] If certain directories are uninstalled within a preset time period, the directory mapping module updates the directory mapping table. That is, the directory mapping module records the client IP of the uninstalled directory in the corresponding position of the directory mapping table according to the directory name of the uninstalled directory.
[0049] The directory mapping module updates the directory mapping table based on the administrator's directory operation behavior.
[0050] like Figure 3 As shown, this embodiment of the invention provides a method for creating a directory mapping table, which specifically includes the following steps: Step 301: If the administrator creates a directory in the distributed file system, then add a directory entry to the directory mapping table.
[0051] Specifically, when an administrator creates a directory in a distributed file system, a metadata group is assigned to the created directory, and a directory information is constructed using the directory name of the created directory as the primary key to record information related to the directory. During the initial construction, the client IP and whether it is mounted in the directory information are NULL by default, and the metadata group is filled with the assigned metadata group identifier. In the corresponding metadata group, the client information for the mounted directory, the client information for the accessed directory, the client information for the unmounted directory, and the number of times the directory has been accessed are all set to NULL by default.
[0052] When the directory monitoring module detects that the directory has been accessed, it updates the client IP and whether the directory is mounted (the directory was mounted before the access) in the corresponding directory information, and updates the client information and access count in the metadata group accordingly.
[0053] When the directory monitoring module detects that the directory is mounted, it updates the client IP and whether the directory is mounted (the directory was mounted before access) in the corresponding directory information, and updates the client information of the mounted directory in the metadata group accordingly.
[0054] When the directory monitoring module detects that a directory has been mounted or unmounted, it updates the client IP and whether the directory has been mounted (the directory needs to be mounted before it is unmounted) in the corresponding directory information, and updates the client information of the unmounted directory in the metadata group accordingly.
[0055] Step 302: If the administrator deletes a directory in the distributed file system, then delete a directory entry in the directory mapping table.
[0056] Specifically, the directory name of the directory to be deleted is used as the filtering condition. The directory information that matches the directory name of the directory to be deleted is found in the directory mapping table and then deleted.
[0057] The storage capacity of a directory and the number of file handle accesses can be obtained through the standard interface in a distributed file system, combined with command-line methods.
[0058] Specifically, the storage capacity of the target directory is obtained through the Rafos interface in the distributed file system to calculate the change in storage capacity of the target directory within the preset time period. This involves obtaining the storage capacity of the target directory at the start and end of the preset time period using the Rafos interface, and using the difference between the two values as the change in storage capacity of the target directory within the preset time period.
[0059] Using the directory name of the target directory as the filtering condition, and according to the client IP, the file handle access count of each client is obtained from the directory mapping table. The sum of the file handle access counts of each client is taken as the total file handle access count. The file handle access count of each client is obtained through a standard interface and command. For example, by inputting the directory name of the target directory as a command parameter, a JSON format string is obtained, which records the IP of each client and the number of times the target directory was accessed.
[0060] The following is combined Figure 4 This document details the process of calculating client write operation traffic, specifically: initializing the directory mapping module, directory monitoring module, metadata monitoring module, and calculation and optimization module. The directory mapping module assigns metadata groups to created directories based on administrator actions, and adds the corresponding directory information (including the metadata groups) to the target mapping table. Based on administrator actions of deleting directories, the directory mapping module removes the corresponding directory information from the target mapping table according to the directory name of the deleted directory. When the directory monitoring module detects client access to certain directories, it monitors changes in the storage capacity of the accessed directories. At this time, the metadata monitoring module monitors the metadata group and obtains the total number of file handle accesses to the accessed directory. And the number of file handle accesses by the client. The calculation and optimization module monitors changes in the storage capacity of the accessed directory. Total number of file handle accesses in the accessed directories and the number of file handle accesses by the client The write operation traffic of the client to the accessed directory was calculated. .
[0061] Example 2: Based on the write operation traffic statistics method based on kernel mounting provided in the foregoing embodiments, the present invention also provides an apparatus for implementing write operation traffic statistics based on kernel mounting, such as... Figure 5 The diagram shown is a schematic representation of the device architecture according to an embodiment of the present invention. The device for write operation traffic statistics based on kernel mounting in this embodiment includes one or more processors 21 and a memory 22. Figure 5 Take a processor 21 as an example.
[0062] Processor 21 and memory 22 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0063] The memory 22, as a non-volatile computer-readable storage medium for the kernel-mounted write operation traffic statistics method, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the kernel-mounted write operation traffic statistics method in the aforementioned embodiments. The processor 21 executes various functional applications and data processing of the kernel-mounted write operation traffic statistics device by running the non-volatile software programs, instructions, and modules stored in the memory 22, thereby implementing the kernel-mounted write operation traffic statistics method of the aforementioned embodiments.
[0064] Memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may include memory remotely located relative to processor 21, which can be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0065] The program instructions / modules are stored in memory 22. When executed by one or more processors 21, they execute the write operation traffic statistics method based on kernel mounting in the aforementioned embodiments.
[0066] This invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 5 One of the processors 21 can enable one or more of the processors to execute the write operation traffic statistics method based on kernel mounting in the foregoing embodiments.
[0067] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.
[0068] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0069] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A write operation traffic statistics method based on kernel mounting, characterized in that, Accessing a distributed file system via kernel mount includes: Establish a mapping relationship between all directories in the distributed file system and the client, and identify at least one target directory that is accessed by the client within a preset time period; Monitor each target directory, obtain the storage capacity change value of the target directory within the preset time period, and the number of file handle accesses of the target directory; Based on the storage capacity change value and the number of file handle accesses, the write operation traffic of each client to the target directory is calculated, and at least one optimization strategy is implemented based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
2. The write operation traffic statistics method based on kernel mounting method according to claim 1, characterized in that, The file handle access count includes the client's file handle access count and the total file handle access count. The formula for calculating the directory write operation traffic for each client is as follows: ; in, This represents the write traffic to the directory for each client. This represents the change in storage capacity of the target directory within a preset time period. This represents a preset time period. This represents the number of file handle accesses per client. This represents the total number of file handle accesses.
3. The write operation traffic statistics method based on kernel mounting method according to claim 1, characterized in that, The method further includes: Using the directory name as the primary key, construct the mapping relationship between directories and clients in the distributed file system, and generate the target mapping table; Based on the directory status in the directory mapping table, determine at least one target directory that will be accessed by the client within a preset time period.
4. The write operation traffic statistics method based on kernel mounting method according to claim 3, characterized in that, The method further includes: Using the directory name of the target directory as the filtering condition, and according to the client IP, the file handle access count of each client is obtained from the directory mapping table, and the sum of the file handle access counts of each client is taken as the total file handle access count.
5. The write operation traffic statistics method based on kernel mounting method according to claim 3, characterized in that, The directory mapping table includes multiple directory entries, and the method further includes: If an administrator creates a directory in the distributed file system, a directory entry is added to the directory mapping table. If an administrator deletes a directory in the distributed file system, then that directory entry will be deleted from the directory mapping table.
6. The write operation traffic statistics method based on kernel mounting method according to claim 1, characterized in that, The method further includes: The directory storage capacity is obtained through the rafos interface in the distributed file system, so as to calculate the change in the storage capacity of the target directory within the preset time period.
7. The write operation traffic statistics method based on kernel mounting method according to claim 1, characterized in that, The method further includes: Monitor the load of the distributed file system and dynamically adjust the preset time period based on the load.
8. A write operation traffic statistics system based on kernel mounting, characterized in that, include: The directory mapping module is used to establish the mapping relationship between all directories in the distributed file system and the client, and to identify at least one target directory that is accessed by the client within a preset time period. The monitoring module is used to monitor each target directory, obtain the storage capacity change value of the target directory within the preset time period, and the number of file handle accesses of the target directory; The calculation and optimization module is used to calculate the write operation traffic of each client to the target directory based on the storage capacity change value and the number of file handle accesses, and to implement at least one optimization strategy based on the write operation traffic of each client to the target directory to improve the stability of the distributed file system.
9. A write operation traffic statistics device based on kernel mounting, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the write operation traffic statistics method based on kernel mounting as described in any one of claims 1-7.
10. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which are executed by one or more processors to perform the write operation traffic statistics method based on kernel mounting as described in any one of claims 1-7.