A file system aging method, device and aging degree measurement method thereof

By creating a multi-threaded redo revision history in the file system, the problem that the existing technology is difficult to quickly simulate a natural aging file system is solved, and the real aging simulation of the file system and the intuitive display of the performance decline trend is realized.

CN116010338BActive Publication Date: 2025-05-06CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211646196.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2025-05-06
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

The prior art is difficult to create a naturally aging file system similar to the customer in a short period of time, making it difficult to simulate real file system aging in the development and testing environment.

Method used

By creating the original file system, reworking revision history with multi-threads, fragmenting the file system, and calculating the performance and fragmentation metrics of the file system, the rapid aging measurement of the file system is achieved.

Benefits of technology

Real aging simulation of the file system is realized, fragment distribution is natural and unpredictable, shortening the problem recurrence time, optimizing stress testing, and improving R&D efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010338B_ABST
    Figure CN116010338B_ABST
Patent Text Reader

Abstract

The present invention discloses a file system aging method, device and aging degree measurement method thereof, and relates to the technical field of storage file system. The file system aging method comprises the following steps: creating an original file system according to configuration information and obtaining the original file system performance and fragmentation index; then redoing the revision history according to the configuration; obtaining the performance and fragmentation index of the aged file system, and exiting the program when the set value is reached. The file system aging degree measurement method comprises calculating the number of disk intervals; calculating the sample space of available space fragments; and obtaining the overall available space fragmentation coefficient according to the sample space and the Gaussian kernel function weight model. The file system aging degree measurement method comprises measuring the read performance and the write performance. By redoing the manual operation records, the fragmentation is unpredictable, which solves the problem that it is difficult to create an aged file system similar to that of the customer in a short time in the current development and testing environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage file systems, and in particular to a file system aging method, a device and an aging degree measurement method thereof. Background Art

[0002] After a long period of use, the file system may experience a decrease in read and write performance or the file system may show that there is free space but large files cannot be accessed. One of the main reasons for these problems is the aging of the file system. File system aging is usually caused by the increasing fragmentation of the file system. When the content of a file is scattered, fragmentation may occur inside the file, which is called intra-file fragmentation. Logically related files, such as files in a directory, may also be distributed on the physical disk, which is called inter-file fragmentation. The file system has a large amount of disk fragmentation, resulting in a large number of addressing when reading and writing files again. These addressing increases the time it takes for the disk to rotate to a specified sector and the seek time required for the head to switch tracks, causing a significant decrease in disk performance. Since this aging phenomenon often occurs after users have used it for one or two years, and the longer the system is used, the deeper the aging, most existing tools use fixed algorithms to perform a large number of IO operations on the file system to achieve file system aging.

[0003] Existing aging technologies are relatively scarce. Although they can achieve the purpose of aging file systems, the distribution of fragmentation on the file system is regular, highly correlated with the algorithm, and predictable. In other words, it is difficult to create a natural aged file system similar to that of customers in a short period of time in the current development and testing environment. Summary of the invention

[0004] In view of the deficiencies of the prior art, the present invention provides a test method for measuring rapid aging of a file system, which solves the problem that it is difficult to create a naturally aged file system similar to that of a customer in a short period of time in the current development and testing environment.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for aging a file system comprises the following steps:

[0006] S1, creating an original file system according to the configuration information and obtaining the performance and fragmentation index of the original file system;

[0007] S2, based on the configuration, starts multiple threads to redo the revision history with a certain step size, fragmenting the file system;

[0008] S3, obtains the performance and fragmentation indicators of the aging file system, and exits the program if the set value is reached.

[0009] Furthermore, the specific steps of S1 include:

[0010] S11, read the configuration file;

[0011] S12, determining the total size of files that need to be written into the file system according to the configured file system size and file usage rate;

[0012] S13, according to the configured URL list, clone the code repository of the open source community and make multiple copies to reach the file size required to be written;

[0013] S14, calculating the initial read performance data and free space fragmentation score of the file system.

[0014] Furthermore, the specific steps of S2 include:

[0015] S21, according to the configured number of threads, start the corresponding number of threads to roll back the historical records according to the set step value to perform the file system aging operation;

[0016] S22, when the redo history record is completed, the file system is unmounted and the system cache is cleared;

[0017] S23, remount the file system and calculate the file system read performance data and free space fragmentation score.

[0018] Furthermore, the specific steps of S3 include:

[0019] S31, repeat the operation of S2;

[0020] S32, when it is detected that the file system read performance data and free space fragmentation have dropped to a set value, all aging threads are exited;

[0021] S33, drawing a performance degradation trend graph and a free space fragmentation score trend graph according to the recorded file system read performance data and the free space fragmentation score.

[0022] Furthermore, the revision history record in S2 refers to the existing records of various file operations performed by humans on files in the file system, and redoing the revision history record means redoing the records of human operations.

[0023] A method for measuring the aging degree of a file system, characterized by comprising a method for calculating a free space fragmentation score:

[0024] The first step is to calculate the number of disk extents: starting from the block size and ending with the entire free space block, where blocksize is B KB and the step size is 2 n+1 KB, the number of disk intervals n with M KB space size is:

[0025]

[0026] The second step is to obtain the sample space of free space fragments: the sample space of free space fragments is X i , where i = 1, 2, ... n;

[0027] The third step is to obtain the overall free space fragmentation coefficient based on the sample space of free space fragments and the Gaussian kernel function weight model: the weight value w is obtained using the Gaussian kernel function weight model i (n):

[0028]

[0029] The calculation formula of the overall free space fragmentation coefficient α is:

[0030]

[0031] Further, it includes measuring read performance and write performance.

[0032] Furthermore, the reading performance is measured as follows:

[0033] Step 1. Measure the time required to perform a recursive grep on the root directory of the file system;

[0034] Step 2. The greater the degree of fragmentation, the less sequential this scan will be and the longer it will take.

[0035] Furthermore, the write performance is measured as follows:

[0036] When the file system type is Ext3 or ext4 file system:

[0037] Step 1. Use the e2freefrag tool to scan the block bitmap information;

[0038] Step 2. Check how many free blocks exist as contiguous and aligned free space;

[0039] Step 3. Report the size of the continuous available blocks and the percentage of continuous available blocks;

[0040] Step 4. Display the minimum / maximum / average free block size in the file system, as well as a histogram of all free blocks;

[0041] When the file type is Xfs file system:

[0042] Step 1. Use the xfs_db tool to summarize the available space of the file system;

[0043] Step 2. Check and total the available blocks, display them in the form of a histogram, and count the available blocks for each available block size range.

[0044] A file system aging device includes a reading module, a creation module, an acquisition module, an aging module and a judgment module:

[0045] Reading module: used to read configuration file information;

[0046] Create module: used to create a file system;

[0047] Acquisition module: used to obtain the performance and fragmentation index of the original file system and the performance and fragmentation index of the aged file system;

[0048] Aging module: used to redo revision history in certain steps, fragmenting the file system;

[0049] Judgment module: used to judge whether the performance and fragmentation index of the aging file system have reached the set value, and if so, exit the program.

[0050] The present invention has the following beneficial effects:

[0051] (1) The test method for measuring the rapid aging of the file system uses the existing records of various file operations on the file system files accumulated over the years and redoes the records of the manual operations to more realistically simulate the aging process of the file system. The distribution of fragments on the file system is natural and unpredictable. At the same time, a multi-threaded aging method is adopted to shorten the problem reproduction time, optimize stress testing, etc., improve R&D efficiency, and solve the problem that it is difficult to create a naturally aged file system similar to that of the customer in a short period of time in the current development and testing environment.

[0052] (2) The test method for measuring the rapid aging of the file system can set a target value to quantifiably achieve the aging target of the file system by providing a two-dimensional method for measuring the aging of the file system, and can adapt to different types of fragmentation, making the method for measuring the degree of aging more widely applicable.

[0053] (3) The test method for measuring the rapid aging of the file system achieves the purpose of intuitively displaying the performance degradation trend caused by the aging of the file system by drawing an aging performance degradation trend chart based on the performance degradation rate and free space fragmentation data.

[0054] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A flowchart of the file system aging method of the present invention;

[0056] Figure 2 This is a structural diagram of a file system aging device of the present invention;

[0057] Figure 3 The e2freefrag command output result diagram provided for the implementation scheme of the present invention;

[0058] Figure 4 A histogram based on the output of the e2freefrag command provided for an implementation scheme of the present invention;

[0059] Figure 5 An example diagram of file system fragmentation provided for an implementation scheme of the present invention;

[0060] Figure 6 An overall operation flow chart provided for an embodiment of the present invention;

[0061] Figure 7 A flowchart of an aging thread provided by an embodiment of the present invention;

[0062] Figure 8 Aging performance degradation trend diagram provided by an embodiment of the present invention;

[0063] Fig. 9 The process of the method for measuring the aging degree of the file system of the present invention is as follows Figure 1 ;

[0064] Fig.10 The process of the method for measuring the aging degree of the file system of the present invention is as follows Figure 2 ;

[0065] Fig.11 The process of the method for measuring the aging degree of the file system of the present invention is as follows Figure 3 . DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] See also Figure 1-Figure 11 , an embodiment of the present invention provides a technical solution: a method for aging a file system, such as Figure 1 , including the following steps:

[0068] S1, creating an original file system according to the configuration information and obtaining the performance and fragmentation index of the original file system;

[0069] S2, based on the configuration, starts multiple threads to redo the revision history with a certain step size, fragmenting the file system;

[0070] S3, obtains the performance and fragmentation indicators of the aging file system, and exits the program if the set value is reached.

[0071] Specifically, the specific steps of S1 include:

[0072] S11, read the configuration file;

[0073] S12, determining the total size of files that need to be written into the file system according to the configured file system size and file usage rate;

[0074] S13, according to the configured URL list, clone the code repository of the open source community and make multiple copies to reach the file size required to be written;

[0075] S14, calculating the initial read performance data and free space fragmentation score of the file system.

[0076] In this implementation scheme, the client file system type, size, and file system aging degree need to be confirmed before reading the configuration file. The configuration file should set the target aging degree and comparative performance degradation rate in advance;

[0077] The main parameters of the configuration file include: file system type, file system size, file system usage, aging performance degradation ratio, free space fragmentation coefficient, open source repository URL list, and number of aging threads:

[0078] File system type: defines the type of file system to be aged, and supports common Linux file systems such as ext3, ext4, and xfs;

[0079] File system size: defines the size of the file system, and is used together with the file system utilization to determine the total size of files written in GB;

[0080] File system usage: defines the ratio of the files written to the file system to the total size of the file system;

[0081] Aging performance degradation ratio: defines the desired performance degradation ratio. For example, 25% means that the performance of the aged file system is 25% lower than that of the new file system.

[0082] Free space fragmentation factor: defines the free space fragmentation factor we want to achieve;

[0083] Open source repository url list: defines the URL address of the open source community to pull the project repository. There can be multiple URLs. The recommended one is the Linux kernel repository on the open source community.

[0084] Number of aging threads: defines the number of threads for aging the file system.

[0085] Specifically, the specific steps of S2 include:

[0086] S21, according to the configured number of threads, start the corresponding number of threads to roll back the historical records according to the set step value to perform the file system aging operation;

[0087] S22, when the redo history record is completed, the file system is unmounted and the system cache is cleared;

[0088] S23, remount the file system and calculate the file system read performance data and free space fragmentation score.

[0089] In this implementation scheme, a multi-threaded aging file system can significantly accelerate the aging process of the file system, especially for new generation file systems such as ext4 and xfs, whose designs themselves include several strategies to reduce fragmentation. However, although ext4 and XFS already have these functions to reduce fragmentation, parallel writing of multiple parallel files will still cause fragmentation and reduce file reading performance, so multi-threading is introduced in the design to speed up the overall aging process.

[0090] Specifically, the specific steps of S3 include:

[0091] S31, repeat the operation of S2;

[0092] S32, when it is detected that the file system read performance data and free space fragmentation have dropped to a set value, all aging threads are exited;

[0093] S33, drawing a performance degradation trend graph and a free space fragmentation score trend graph according to the recorded file system read performance data and the free space fragmentation score.

[0094] In this implementation scheme, since the command output is a set of distributed data, taking ext3 and ext4 file systems as an example, the e2freefrag command output is as follows: Figure 3 As shown in the figure, the histogram based on the output of the e2freefrag command is as follows Figure 4 shown.

[0095] A method for measuring the aging degree of a file system, such as Fig. 9 , including the method for calculating the free space fragmentation fraction:

[0096] The first step is to calculate the number of disk extents: starting from the block size and ending with the entire free space block, where blocksize is B KB and the step size is 2 n+1 KB, the number of disk intervals n with M KB space size is:

[0097]

[0098] The second step is to obtain the sample space of free space fragments: the sample space of free space fragments is X i , where i=1,2,......n:

[0099] X i ,(i=1,2,…,n);

[0100] The third step is to obtain the overall free space fragmentation coefficient based on the sample space of free space fragments and the Gaussian kernel function weight model: the weight value w is obtained using the Gaussian kernel function weight model i (n):

[0101]

[0102] The calculation formula of the overall free space fragmentation coefficient α is:

[0103]

[0104] In this implementation, since the size of each fragmentation interval has different effects on the overall fragmentation degree, the smaller the continuous fragmentation space, the heavier the degree of fragmentation, and vice versa, the larger the continuous space, the lighter the degree of fragmentation, so the weight function adopts a modified Gaussian kernel function weight model;

[0105] The purpose of choosing this weight function is:

[0106] First point. Strengthen the weight of small fragment space;

[0107] Second point. Normalize the values, the range is [0,2] (the reason for taking 2 is that the maximum value of the minimum interval of 4KB-8KB is 50%, which means that in the extreme case, the entire disk space is full of 4k-8k fragments, and the fragments and files are exactly half interlaced. Taking 2 can normalize the indicator function result to the interval [0,1]);

[0108] The third point: When i=n, ​​the weight is 0, and when i=1, the weight is 2.

[0109] Specifically, the revision history record in S2 refers to the existing records of various file operations performed by humans on the file system files, and redoing the revision history record means redoing the records of human operations.

[0110] In this implementation, redoing the repository's revision history on files will cause file system fragmentation, similar to the fragmentation experienced by developers when working on a project, with the goal of simulating a more realistic file system aging process.

[0111] A method for measuring the aging degree of a file system also includes measuring read performance and write performance.

[0112] In this embodiment, if Figure 5 , file system fragmentation can be roughly divided into three different types of fragmentation:

[0113] The first type: Fragmentation within a single file: Fragmentation of a single file occurs when a single file is divided into multiple discontinuous spaces when it is stored, which will reduce the performance of accessing a single file;

[0114] The second type. Fragmentation between files in a folder: refers to the fact that files in the same folder are scattered in the file system fragments. This is the main reason for the performance degradation of applications that access many small files.

[0115] The third type. Free space fragmentation: refers to when the file system has many small non-contiguous free areas and no large continuous free space. This will make the other two types of fragmentation more serious and cause the file system performance to degrade when writing large files;

[0116] The first two types of fragmentation directly affect the read performance of the file system, also known as read aging. When the file system scans file data, fragmented blocks will produce non-sequential reads, which are slower than sequential reads on most modern storage hardware;

[0117] The third type affects file writing performance, as files need to be written on non-contiguous blocks when being written to disk.

[0118] Specifically, Fig.10 , read performance measurement method:

[0119] Step 1. Measure the time required to perform a recursive grep on the root directory of the file system;

[0120] Step 2. The greater the degree of fragmentation, the less sequential this scan will be and the longer it will take.

[0121] In this embodiment, recursive scanning of data and metadata of the file system is performed to measure the read performance to measure the intra-file fragmentation and the inter-file fragmentation in the folder.

[0122] Specifically, Fig.11 , write performance measurement method:

[0123] When the file system type is Ext3 or ext4 file system:

[0124] Step 1. Use the e2freefrag tool to scan the block bitmap information;

[0125] Step 2. Check how many free blocks exist as contiguous and aligned free space;

[0126] Step 3. Report the size of the continuous available blocks and the percentage of continuous available blocks;

[0127] Step 4. Display the minimum / maximum / average free block size in the file system, as well as a histogram of all free blocks;

[0128] When the file type is Xfs file system:

[0129] Step 1. Use the xfs_db tool to summarize the available space of the file system;

[0130] Step 2. Check and total the available blocks, display them in the form of a histogram, and count the available blocks for each available block size range.

[0131] In this implementation scheme, free space fragmentation is measured. Most file systems provide corresponding tools. Here, the more commonly used file systems ext3, ext4 and xfs file systems are taken as examples.

[0132] Block bitmap information can be used to measure the level of free space fragmentation in the file system;

[0133] xfs_db is a debug tool for an xfs file system.

[0134] A file system aging device, such as Figure 2 , including reading module, creating module, acquiring module, aging module and judging module:

[0135] Reading module: used to read configuration file information;

[0136] Create module: used to create a file system;

[0137] Acquisition module: used to obtain the performance and fragmentation index of the original file system and the performance and fragmentation index of the aged file system;

[0138] Aging module: used to redo revision history in certain steps, fragmenting the file system;

[0139] Judgment module: used to judge whether the performance and fragmentation index of the aging file system have reached the set value, and if so, exit the program.

[0140] In this implementation scheme, the reading module first reads the configuration file information, and then the creation module creates the file system. Next, the acquisition module obtains the original file system performance and fragmentation index and the performance and fragmentation index of the aged file system. Then, the aging module redoes the revision history with a certain step size to fragment the file system. Finally, the judgment module determines whether the performance and fragmentation index of the aged file system reach the set value. If so, the program exits.

[0141] When using it, here we take a customer's complaint about the deterioration of file performance on a cloud disk as an example to explain in detail how to use this design method to reproduce the process of the customer's file system after the performance has deteriorated.

[0142] The first step is to confirm the client's file system type, size, and file system aging level.

[0143] 1. The client file system type, size and usage can be easily found through system commands;

[0144] 2. File system aging degree:

[0145] I. The degree of free space fragmentation of the file system is checked according to the file system type. For ext3 and ext4, use the system command e2freefrag. For xfs, use the command xfs_db -c freesp to check and calculate the free space fragmentation coefficient (xfs can also use xfs_db -c frag to check the intra-file fragmentation and inter-file fragmentation information).

[0146] II. File read performance degradation rate, by creating a new file system of the same type and size, and then copying the original file system data to the new file system (the new file system can be regarded as a non-aging file system), and then performing a grep full disk scan on the original file system and the new file system respectively, to obtain the time of scanning the full disk. Assuming that the scanning time of the original file system is t1 and the scanning time of the new file system is t2, the file system performance degradation ratio (R) is (t1-t2) / t1*100%.

[0147] Step 2: Modify the configuration file.

[0148] Modify the following configuration items in the configuration file: file system type, file system size, file system usage, read / write performance degradation ratio, free space fragmentation level, open source repository URL list, and number of aging threads.

[0149] Step 3: Start the aging process. For detailed steps, refer to Figure 6 and Figure 7 flow chart.

[0150] 1) Select code repositories of several large open source projects, with a focus on multi-person collaborative development projects with a large number of file operation records. For example, the Linux kernel project on gitee https: / / gitee.com / mirrors / linux can be recommended. You can see that the project currently has more than 50,000 commit records, covering all modifications from 2005 to the present, and the size is about 4.5GB.

[0151] 2) Clone the code repository repo to the file system under test. It can be placed on the file system under test. This repository serves as the source repository for redoing file operations.

[0152] 3) Create multiple independent directories on the file system to be tested and initialize (git init) the directory, which serves as the destination repo for redoing file operations.

[0153] 4) Configure the source repo as follows:

[0154] git config uploadpack.allowReachableSHA1InWant True,

[0155] The purpose of this configuration is to allow git to fetch all available commit records.

[0156] 5) Get the SHA-1 list of historical commit records of the cloned source repo (git rev-list --reverseHEAD).

[0157] 6) Through the obtained commit record list, redo each commit one by one on the tested file system (git pull-no-deit-qs recursive-X theirs) to modify and delete files. According to the actual needs of the test (aging degree), we can choose to redo some commit records, such as intercepting 10,000 records in the list for redoing.

[0158] 7) Every time you redo S records, you need to unmount the file system, refresh the system cache, restart it, and then obtain the file system full scan time and free space fragmentation data.

[0159] 8) Check whether the system read performance rate and free space fragmentation data after aging meet the set requirements. If not, continue to execute the next aging thread.

[0160] When the entire aging process reaches the set performance degradation rate and free space fragmentation data, draw an aging performance degradation trend chart based on the saved data, such as Figure 8 .

[0161] In summary, the present invention proposes a method to quickly age a file system, and provides a method to measure the degree of aging in two dimensions. According to the set value, a file system with the same aging degree as the customer, which has been used for one year or more than several years, can be quantitatively simulated in a few hours. This greatly shortens the aging time of the simulated file system, and provides an effective means of reproducing the problem site for locating customer problems and performance testing.

[0162] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0163] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for aging a file system, characterized in that: The following steps are involved: S1, creating an original file system according to the configuration information and obtaining the performance and fragmentation index of the original file system; S2, based on the configuration, starts multiple threads to redo the revision history with a certain step size, fragmenting the file system; S3, obtaining the performance and fragmentation index of the aging file system, and exiting the program if the set value is reached; the program is all aging threads; The specific steps of S1 include: S11, read the configuration file; S12, determining the total size of files that need to be written into the file system according to the configured file system size and the file system usage rate; S13, according to the configured URL list, clone the code repository of the open source community and make multiple copies to reach the file size required to be written; S14, calculating the initial read performance data and free space fragmentation score of the file system; The parameters of the configuration file include at least: file system type, file system size, file system usage, aging performance degradation ratio, free space fragmentation coefficient, open source repository urllist, and number of aging threads; Calculation method of free space fragmentation score: The first step is to calculate the number of disk extents: starting from the block size and ending with the entire free space block, with a block size of B KB and a step size of 2 n+1 KB, the number of disk intervals n with M KB space size is: The second step is to obtain the sample space of free space fragments: the sample space of free space fragments is X i , where i = 1, 2, ... n; The third step is to obtain the overall free space fragmentation score based on the sample space of free space fragments and the Gaussian kernel function weight model: the weight value w is obtained using the Gaussian kernel function weight model i (n): The calculation formula of the overall free space fragmentation fraction α is:

2. A method for aging a file system according to claim 1, characterized in that: The specific steps of S2 include: S21, according to the configured number of threads, start the corresponding number of threads to roll back the historical records according to the set step value to perform the file system aging operation; S22, when the redo history record is completed, the file system is unmounted and the system cache is cleared; S23, remount the file system and calculate the file system read performance data and free space fragmentation score.

3. The method for aging a file system according to claim 1, characterized in that: The specific steps of S3 include: S31, repeat the operation of S2; S32, when it is detected that the file system read performance data and free space fragmentation have dropped to a set value, all aging threads are exited; S33, drawing a performance degradation trend graph and a free space fragmentation score trend graph according to the recorded file system read performance data and the free space fragmentation score.

4. The method for aging a file system according to claim 1, characterized in that: The revision history records in S2 refer to existing records of various file operations performed by humans on files in the file system. Redoing the revision history records means redoing the records of human operations.

5. The method for aging a file system according to claim 1, characterized in that: Includes measuring read performance and write performance.

6. A method for aging a file system according to claim 5, characterized in that: The read performance measurement method is: Step 1. Measure the time required to perform a recursive grep on the root directory of the file system; Step 2. The greater the degree of fragmentation, the less sequential this scan will be and the longer it will take.

7. The method for aging a file system according to claim 5, characterized in that: The write performance is measured as follows: When the file system type is Ext3 or ext4 file system: Step 1. Use the e2freefrag tool to scan the block bitmap information; Step 2. Check how many free blocks exist as contiguous and aligned free space; Step 3. Report the size of the continuous available blocks and the percentage of continuous available blocks; Step 4. Display the minimum / maximum / average free block size in the file system, as well as a histogram of all free blocks; When the file type is Xfs file system: Step 1. Use the xfs_db tool to summarize the available space of the file system; Step 2. Check and total the available blocks, display them in the form of a histogram, and count the available blocks for each available block size range.

8. A device for aging a file system, characterized in that: Including reading module, creating module, acquiring module, aging module and judging module: Reading module: used to read configuration file information; Create module: used to create a file system; Acquisition module: used to obtain the performance and fragmentation index of the original file system and the performance and fragmentation index of the aged file system; Aging module: used to redo revision history in certain steps, fragmenting the file system; Judgment module: used to judge whether the performance and fragmentation index of the aging file system have reached the set value, and if so, exit the program; the program is all aging threads; The specific steps of the reading module include: S11, read the configuration file; S12, determining the total size of files that need to be written into the file system according to the configured file system size and the file system usage rate; S13: Clone the code repository of the open source community according to the configured URL list, and make multiple copies to reach the required file size; S14, calculating the initial read performance data and free space fragmentation score of the file system; The parameters of the configuration file include at least: file system type, file system size, file system usage, aging performance degradation ratio, free space fragmentation coefficient, open source repository urllist, and number of aging threads; Calculation method of free space fragmentation score: The first step is to calculate the number of disk extents: starting from a block size of B KB and ending with a total available space of M KB, with a block size of B KB and a step size of 2. n+1 KB, the number of disk intervals n with M KB space size is: The second step is to obtain the sample space of free space fragments: the sample space of free space fragments is X i , where i=1,2,......n: X i ,(i=1,2,…,n); The third step is to obtain the overall free space fragmentation score based on the sample space of free space fragments and the Gaussian kernel function weight model: the weight value w is obtained using the Gaussian kernel function weight model i (n): The calculation formula of the overall free space fragmentation fraction α is:

Citation Information

Patent Citations

  • File system aging evaluation method and device, storage medium and terminal

    CN114238249A

  • Method for managing file system, electronic device and computer program product

    CN114328373A