Parameter adjusting method and device of NFS system and electronic equipment
By using normalization processing and training models in the NFS system to automatically adjust the read ahead and rsize values, the problem that fixed parameters cannot adapt to dynamic business I/O patterns is solved, and efficient storage performance is improved.
Patent Information
- Application Number
- CN202511028977.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-11
AI Technical Summary
In existing NFS systems, fixed read ahead and rsize values cannot adapt to dynamically changing business I/O patterns, resulting in storage performance not being maximized and manual adjustments being difficult to make accurate and efficient.
By using a normalization function in user space to process historical runtime data collected by kernel-mode probe components, training data is extracted and a parameter prediction model is trained. The read ahead value and rsize value are automatically adjusted to adapt to the business I/O mode.
It achieves precise matching between NFS system parameters and business I/O modes, improves storage performance, reduces kernel-level burden, and improves system efficiency.
Smart Images

Figure CN120929439A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage, and in particular to parameter adjustment methods, apparatus, and electronic devices for NFS systems. Background Technology
[0002] In practical applications, the workload of services (such as user A's traffic service) in a Network File System (NFS) changes in real time. Fixed NFS system parameters (such as read ahead value, read size rsize value, etc.) cannot adapt to dynamically changing input / output I / O patterns and cannot maximize the utilization of NFS system storage performance.
[0003] Currently, the read ahead and rsize values are adjusted manually based on experience. However, this method of manually adjusting NFS system parameters still cannot accurately and efficiently adapt the NFS system parameters to match the business IO mode. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, apparatus, and electronic device for adjusting parameters of an NFS system, so as to accurately and efficiently achieve precise matching between NFS system parameters and business IO modes, thereby improving the storage performance of the NFS storage system.
[0005] This application provides a parameter adjustment method for an NFS system, which is applied to an NFS client. The method includes:
[0006] In user space, the normalization function that is currently built and matches this client is used to normalize the historical running data of each service running on this client within the historical running cycle, which is collected by the probe component deployed in kernel space.
[0007] Based on the normalization result, the following training data is extracted: pre-read readahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; the NFS read request time difference information and the NFS read request offset information are used to determine the rsize value; the NFS read request time difference information is determined based on the time difference of each NFS read request pair, and the NFS read request offset information is determined based on the offset of each NFS read request pair; the NFS read request pair refers to NFS read requests with consecutive timestamps.
[0008] A parameter prediction model is trained based on the training data, and the trained parameter prediction model is loaded in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and to adjust the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
[0009] This application embodiment also provides a parameter adjustment device for an NFS system, which is applied to an NFS client, and the device includes:
[0010] The preprocessing module is used in user space to normalize the historical running data of each service running on this client within the historical running cycle, which is collected by the probe component deployed in kernel space, using the normalization function that has been built and matches this client.
[0011] The extraction module is used to extract the following training data from the normalized processing result: read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; the NFS read request time difference information and the NFS read request offset information are used to determine the rsize value; the NFS read request time difference information is determined based on the time difference of each NFS read request pair, and the NFS read request offset information is determined based on the offset of each NFS read request pair; the NFS read request pair refers to NFS read requests with consecutive timestamps.
[0012] The adjustment module is used to train a parameter prediction model based on the training data and load the trained parameter prediction model in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and adjust the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
[0013] This application also provides an electronic device, including: a processor and a memory for storing computer program instructions, which, when executed by the processor, cause the processor to perform the steps of the method described above.
[0014] This application also provides a machine-readable storage medium storing computer program instructions that, when executed, enable the implementation of the steps described above.
[0015] As can be seen from the above technical solutions, in this embodiment, by utilizing a trained parameter prediction model, the read ahead value and rsize value of the service in the next operating cycle are evaluated based on the current operating data of the collected service in the current operating cycle. Based on the evaluated read ahead value and rsize value, the read ahead value and rsize value corresponding to the current service are adjusted. This method of periodically and automatically adjusting the read ahead value and rsize value corresponding to the current service, compared with fixed read ahead value and rsize value or manual adjustment of read ahead value and rsize value, accurately and efficiently achieves precise matching between NFS system parameters and service IO mode, thereby improving the storage performance of NFS storage system.
[0016] Furthermore, when training the parameter prediction model, the historical running data of each service running on the client within the historical running cycle, collected by the probe component deployed in kernel space, is first normalized in user space using the currently constructed normalization function that matches the client. This normalization process eliminates noise and extracts effective training data. Then, from the normalization result, read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information are extracted as training data. Since this training data accurately reflects the IO mode (i.e., workload type) of the historical running cycle, the trained parameter prediction model can better learn how to accurately match the appropriate read-ahead and rsize values under different IO modes. This allows the obtained parameter prediction model to accurately evaluate the read-ahead and rsize values that precisely match the service IO mode. Finally, the trained parameter prediction model can accurately evaluate the read-ahead and rsize values that are suitable for the next running cycle, further improving the storage performance of the NFS storage system.
[0017] Furthermore, historical runtime data is collected in kernel mode, while resource-intensive normalization processing and model training are performed in user mode. This eliminates the need for model training in kernel mode; instead, the trained parameter prediction model is loaded back into kernel mode for execution, reducing the burden on kernel mode and thus improving the efficiency of the NFS storage system. Attached Figure Description
[0018] Figure 1 This is a network architecture diagram of the NFS system provided in the embodiments of this application;
[0019] Figure 2 A flowchart illustrating the method provided in the embodiments of this application;
[0020] Figure 3 A flowchart illustrating the method provided in the embodiments of this application;
[0021] Figure 4 This is a schematic diagram of the device provided in the embodiments of this application;
[0022] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0023] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0024] To facilitate understanding of this solution, before describing it, we will first consider... Figure 1 The network architecture diagram of the NFS system shown below describes the existing technical problems in detail:
[0025] The NFS system uses a distributed file system protocol, designed to allow NFS clients to access NFS server files over the network as if they were local storage. An NFS server allows NFS clients to mount directories shared by a remote NFS server onto their local machine. On the local machine, the NFS server's directory is a disk partition within that machine, facilitating management. For example... Figure 1 As shown, the three NFS clients are mounted on the NFS server, and the three clients use the NFS server's directories as if they were local directories.
[0026] When an NFS system is working, its performance often depends on how well the NFS system parameters match the workload. Two commonly considered NFS system parameters are the read ahead value and the rsize value.
[0027] Read-ahead is a technique that prefetches additional stored data into the operating system's cache for short-term use. Determining how much data to read ahead (i.e., the read-ahead value) has always been a challenge. Reading too little data ahead requires more disk reads, while reading too much can pollute the cache with useless data, both impacting performance. Therefore, configuring a read-ahead value that suits the current I / O pattern is crucial.
[0028] In an NFS system, `rsize` (read size) is the data block size negotiated between the NFS client and the NFS server for each network read / write operation, directly impacting system performance and network load. The `rsize` value defines the maximum amount of data an NFS client can read in each operation. When the file size exceeds this value, the server will split the data into multiple packets for transmission. Properly setting the `rsize` value can optimize network bandwidth utilization. For example, in high-speed network environments, increasing the `rsize` value can reduce the number of transmissions and improve efficiency; conversely, when network latency or bandwidth is limited, decreasing the `rsize` value can reduce the risk of packet loss. Therefore, configuring an `rsize` value that adapts to the current I / O mode is crucial.
[0029] In related technologies, some users lack the time or expertise to adjust these parameters, especially in certain production environments where NFS system parameters are set quite conservatively to prevent instability or data loss. Therefore, fixed read-ahead and rsize values are used. However, fixed read-ahead and rsize values cannot adapt to the constantly changing workloads and system diversity of NFS systems.
[0030] Another group of users manually adjusts the read-ahead and rsize values based on experience (i.e., providing many heuristic algorithms to adjust read-ahead and rsize values). However, the accuracy of manually adjusting read-ahead and rsize values periodically based on experience is limited, and it cannot work well under all conditions and workloads, wasting a lot of time. In other words, related technologies cannot accurately and efficiently adapt NFS system parameters to match business I / O patterns, affecting the storage performance of NFS storage systems.
[0031] Based on this, embodiments of this application provide a method, apparatus, and electronic device for adjusting parameters of an NFS system, so as to accurately and efficiently achieve precise matching between NFS system parameters and business IO modes, thereby improving the storage performance of the NFS storage system.
[0032] based on Figure 1 The network architecture shown below illustrates the method provided in the embodiments of this application:
[0033] See Figure 2 , Figure 2 This is a flowchart illustrating a method provided in an embodiment of this application. In one embodiment, the method is executed by an NFS client.
[0034] like Figure 2 As shown, the process includes the following steps:
[0035] S201, in user space, uses the currently constructed normalization function that matches this client to normalize the historical running data of each service running on this client within the historical running cycle, which is collected by the probe component deployed in kernel space.
[0036] As an example, historical runtime data can be collected in the following way: using a system tool (Linux Trace Toolkit NextGeneration, LTTng) to trace and analyze system performance in kernel-mode and user-mode buffers. The LTTng system tool includes at least a probe component deployed in kernel-mode and a tracing memory management system, which is the memory management subsystem in LTTng responsible for recording trace point information. Historical runtime data is collected by the probe component deployed in kernel-mode and categorized and placed using the tracing memory management system. The historical runtime data is also transferred from kernel-mode to user-mode via the LTTng system tool for normalization processing in kernel-mode.
[0037] In this embodiment, the normalization function that has been built and matches this client is stored in the function library of the currently built adapted client (the adapted function library is built by itself and is different from existing third-party function libraries). When performing normalization processing, the normalization function is called from the function library. By normalizing the historical running data, the data is pulled into a specific range to eliminate noise and make it more statistically meaningful, thereby extracting effective training data.
[0038] S202, for the normalization result, extract the following training data from the normalization result: readahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; NFS read request time difference information and NFS read request offset information are used to determine the rsize value; NFS read request time difference information is determined based on the time difference of each NFS read request pair, and NFS read request offset information is determined based on the offset of each NFS read request pair; NFS read request pair refers to NFS read requests with consecutive timestamps.
[0039] Any historical operational data includes: the historical operational data of any service within each historical period, including at least: the amount of data requested by each read request of the service within that historical period, the timestamp of each read request being split into multiple NFS read requests and sent to the NFS server, and the page offset. The page offset of any NFS read request is used to indicate the logical and / or physical location of the data read by that NFS read request.
[0040] It should be noted that the normalization results of historical operation data still include the data described above, but all within a specific range. For ease of description, the data names mentioned above will still be used in the following descriptions. For example, the amount of data requested by a read request in the normalization process will still be described as the amount of data requested by the request, and so on.
[0041] Extract the read-ahead related data (for example, the average data volume of read requests and the fluctuation information of read request data volume), the NFS read request time difference information used to determine the rsize value, and the NFS read request offset information from the normalized processing result of any historical running data. This can also be described as extracting the above four feature data associated with read-ahead and rsize.
[0042] The specific methods for obtaining the average data volume of read requests, the fluctuation information of read request data volume, the time difference information of NFS read requests, and the offset information of NFS read requests will be described in detail in the following text with specific embodiments, and will not be elaborated here.
[0043] As an example, step S202 is implemented by calling the function library built to adapt to the client. The function library stores functions for extracting the training data. In user space, the functions in the function library are called through the corresponding interface to extract the training data. In this way, by using the function library built by the NFS client itself to provide the functions and matrix operation interfaces required for model training, compared with the independent function libraries of third-party libraries, the goal of low overhead, lightweight, high adaptability, and efficient operation can be achieved for normalization processing and training data extraction.
[0044] S203 trains a parameter prediction model based on training data and loads the trained parameter prediction model in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and adjusts the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
[0045] In this embodiment, the specific implementation method of training the parameter prediction model using training data will be described later, and will not be repeated here.
[0046] As an example, the parameter prediction model trained in user space is saved to a specific deployment file. This deployment file is then transferred from user space to kernel space using the LTTng system tool, and loaded into the kernel module, thus enabling the trained parameter prediction model to be loaded into the kernel. In this way, training the model offline in user space and performing parameter prediction in kernel space—offline user space training and kernel space inference prediction—not only reduces the burden on the kernel space, thereby improving the efficiency of the NFS storage system, but also makes the trained model easier to embed into the storage system and easier to maintain.
[0047] In this embodiment, the specific implementation of evaluating the read ahead value and rsize value of the service in the next running cycle, and adjusting the read ahead value and rsize value of the current service based on the evaluated read ahead value and rsize value, will be described later, and will not be repeated here.
[0048] This concludes the process. Figure 2 The process is shown below.
[0049] pass Figure 2 As can be seen from the process shown, in this embodiment, a trained parameter prediction model is used to evaluate the read ahead value and rsize value of the service in the next running cycle based on the collected service's current running data within the current running cycle. Based on the evaluated read ahead value and rsize value, the read ahead value and rsize value corresponding to the current service are adjusted. This method of periodically and automatically adjusting the read ahead value and rsize value corresponding to the current service, compared with fixed read ahead value and rsize value or manual adjustment of read ahead value and rsize value, accurately and efficiently achieves precise matching between NFS system parameters and service IO mode, thereby improving the storage performance of the NFS storage system.
[0050] Furthermore, when training the parameter prediction model, the historical running data of each service running on the client within the historical running cycle, collected by the probe component deployed in kernel space, is first normalized in user space using the currently constructed normalization function that matches the client. This normalization process eliminates noise and extracts effective training data. Then, from the normalization result, read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information are extracted as training data. Since this training data accurately reflects the IO mode (i.e., workload type) of the historical running cycle, the trained parameter prediction model can better learn how to accurately match the appropriate read-ahead and rsize values under different IO modes. This allows the obtained parameter prediction model to accurately evaluate the read-ahead and rsize values that precisely match the service IO mode. Finally, the trained parameter prediction model can accurately evaluate the read-ahead and rsize values that are suitable for the next running cycle, further improving the storage performance of the NFS storage system.
[0051] Furthermore, historical runtime data is collected in kernel mode, while resource-intensive normalization processing and model training are performed in user mode. This eliminates the need for model training in kernel mode; instead, the trained parameter prediction model is loaded back into kernel mode for execution, reducing the burden on kernel mode and thus improving the efficiency of the NFS storage system.
[0052] The following section provides a detailed explanation of how to obtain the average data volume of read requests, data volume fluctuation information of read requests, NFS read request time difference information, and NFS read request offset information.
[0053] It should be noted that when the NFS kernel receives a read request for a single large file from the NFS user space, if the amount of data to be read in the read request is greater than the rsize value set in the NFS client, it will be split into multiple NFS read requests and sent to the NFS server through the TCP / IP protocol stack.
[0054] The average data volume of read requests is determined based on the average data volume requested by each read request in the historical running data.
[0055] The fluctuation information of read request data volume is determined based on the average difference between the data volume requested by each read request and the average data volume of read requests in the historical operation data.
[0056] The average read request data volume and read request data volume fluctuation information extracted in the above way can accurately reflect the continuity characteristics, fluctuation patterns and stability of the NFS system load. Therefore, using this as training data can enable the model to better learn how to analyze load characteristics in order to evaluate the appropriate read ahead value.
[0057] NFS read request offset information is determined through the following steps: First, the average time difference of each NFS read request pair is obtained. Here, an NFS read request pair refers to NFS read requests with consecutive timestamps under the same read request. For example, if a read request is split into 10 NFS read requests, there are 9 NFS read request pairs. Based on the average time difference of each read request, the NFS read request time difference information is determined. Optionally, the average time difference of each read request can be directly determined as the NFS read request time difference information, or a specified calculation can be performed on the average time difference to obtain the NFS read request time difference information.
[0058] NFS read request offset information is determined through the following steps: The average offset of the offsets of each NFS read request pair is obtained. Here, an NFS read request pair refers to NFS read requests with consecutive timestamps under the same read request. The NFS read request offset information is determined based on the average offset of each read request. Optionally, as an example, there are K read requests. For each read request, the average offset of the offsets of each NFS read request pair under that read request is obtained. After obtaining the average offsets for the K read requests, the average offsets for the K read requests are averaged or summed to obtain the NFS read request offset information.
[0059] The NFS read request time difference information and NFS read request offset information extracted in the above way can accurately reflect the access pattern of read requests (the access pattern is determined by whether sequential read or random access accounts for a larger proportion) and the physical distribution access pattern. Therefore, using this as training data can enable the model to better learn how to analyze the characteristics of IO patterns in order to evaluate the appropriate rsize value.
[0060] The above provides a detailed explanation of how to obtain average data volume for read requests, data volume fluctuation information for read requests, NFS read request time difference information, and NFS read request offset information.
[0061] The training and optimization of the training parameter prediction model will be explained in detail below:
[0062] As an example, after extracting the average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information from the normalized processing results of multiple historical running data, a training sample corresponding to each historical running data is constructed based on the extracted average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information. The training sample includes feature samples and sample labels. The feature samples are the average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information extracted from the historical running data. The sample labels are the adapted read-ahead value and rsize value determined based on the extracted feature values; for example, manually determined read-ahead and rsize values are used as labels. Multiple training samples are obtained in this manner.
[0063] In user mode, the parameter prediction model is trained using the above training samples until the set stop training condition is met, and the trained parameter prediction model is obtained.
[0064] As one embodiment, the method further includes: at regular intervals, obtaining runtime data collected in kernel mode within the specified time period or within a sub-time period of the specified time period in user mode, and using the obtained runtime data to optimize the training parameter prediction model to obtain optimized parameters. The optimized parameters are then transferred from user mode to kernel mode using the LTTng system tool. In kernel mode, the optimized parameters are loaded to update the parameter prediction model.
[0065] In this way, a closed loop is formed between the running data and the model. After the parameter prediction model is updated in kernel mode, the data collected in kernel mode changes, the input of the parameter prediction model in kernel mode will change, and the final model prediction will also change, thus completing the closed loop of model iteration.
[0066] The training and optimization of the training parameter prediction model have been explained in detail above.
[0067] The following section elaborates on evaluating the read ahead and rsize values for this service in the next operating cycle, and on adjusting the current read ahead and rsize values for this service based on the evaluated read ahead and rsize values:
[0068] The above assessment of the read ahead value and rsize value for this service in the next operating cycle includes the following steps:
[0069] For any service running on this NFS client, the system collects current running data within the current cycle in kernel mode. It then calls the corresponding normalization function in the function library that matches this client's normalization function to normalize the current running data. From the normalization result of the current running data, it extracts the average data volume of read requests, the fluctuation information of read request data volume, the NFS read request offset information, and the NFS read request offset information.
[0070] The extracted average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information are input into the parameter prediction model configured in kernel mode. The parameter prediction model analyzes the above four input data to determine the workload type and outputs read ahead and rsize values to obtain the read ahead and rsize values for that service in the next runtime cycle. This process is repeated to obtain the read ahead and rsize values for each service in the next runtime cycle.
[0071] The above-mentioned adjustment of the current read ahead value and rsize value corresponding to this service based on the evaluated read ahead value and rsize value includes the following steps:
[0072] For any given service, when the evaluated read-ahead and rsize values for that service match the current read-ahead and rsize values for that service (optionally, for each service, a match is considered to be achieved when the proportion of evaluated read-ahead values that differ from the read-ahead values used in the current cycle is less than or equal to a set threshold, and the proportion of evaluated rsize values that differ from the rsize values used in the current cycle is less than or equal to a set threshold), the current read-ahead and rsize values for that service are not adjusted. When the evaluated read-ahead and rsize values for that service do not match the current read-ahead and rsize values for that service (optionally, for each service, a mismatch is considered to be achieved when the proportion of evaluated read-ahead values that differ from the read-ahead values used in the current cycle is greater than a set threshold, and the proportion of evaluated rsize values that differ from the rsize values used in the current cycle is greater than a set threshold), a target read-ahead value is determined based on the evaluated read-ahead value for the next cycle of that service and the evaluated read-ahead values for the next cycle of other services. The target read-ahead value is determined as the read-ahead value adapted for this service in the next runtime cycle. The evaluated rsize value is determined as the rsize value adapted for this service in the next runtime cycle.
[0073] In other words, after the model outputs the read-ahead and rsize values for each service in the next runtime, if the proportion of services whose evaluated read-ahead values differ from those used in the current runtime exceeds a set threshold, and the proportion of services whose evaluated rsize values differ from those used in the current runtime exceeds a set threshold, the kernel module in the NFS client kernel mode determines the average or maximum read-ahead value of each service in the next runtime as the target read-ahead value. Through the parameter configuration interface, it uses the input / output control block layer (blocklayerioctl) to update the current read-ahead value to the target read-ahead value. The NFS client then updates the current read-ahead value to the rsize value that is expected to be suitable for that service in the next runtime through the parameter adjustment module attached to the client for that service.
[0074] This method differs from traditional storage systems that require technical personnel to periodically fine-tune the parameters of the NFS storage environment. Instead, it utilizes a parameter prediction model to automatically adjust the appropriate read-ahead and rsize values. This significantly improves the overall IO performance of the NFS system and drastically reduces the time required for manual system maintenance.
[0075] The above provides a detailed explanation of how to evaluate the read ahead value and rsize value of the service in the next operating cycle, and how to adjust the current read ahead value and rsize value of the service based on the evaluated read ahead value and rsize value.
[0076] To illustrate the method provided in this application in more detail, the following will be combined with... Figure 1 The network architecture shown, combined with Figure 3 The flowchart shown below provides a more detailed description of the solution provided in this application through specific embodiments.
[0077] like Figure 3 As shown, the method includes the following steps:
[0078] Training phase:
[0079] 1. For each service running in this NFS client, historical running data is collected using the probe component deployed in kernel mode in the LTTng system tool, and the collected historical running data is classified and saved using the trace memory management system. The historical running data is then transferred from kernel mode to user mode through the LTTng system tool.
[0080] 2. In user mode, the normalization function matching the client in the function library is called through the corresponding interface to normalize each historical running data.
[0081] 3. Extract the average data volume of read requests, the fluctuation information of read request data volume, the NFS read request offset information, and the NFS read request offset information from the normalization processing results of each historical running data.
[0082] 4. For each historical data set, construct training samples based on the extracted average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information. The training samples include feature samples and sample labels. The feature samples are the extracted average read request data volume, read request data volume fluctuation information, NFS read request offset information, and NFS read request offset information from the historical data set. The sample labels are the adapted read ahead value and rsize value determined based on the extracted feature values.
[0083] 5. In user mode, train the parameter prediction model using training samples until the set stop training condition is met, and obtain the trained parameter prediction model.
[0084] 6. In user space, save the trained parameter prediction model to a specific deployment file and transfer it from user space to kernel space using the LTTng system tool. Then, load the deployment file into the kernel module to load the trained parameter prediction model in the kernel.
[0085] Application phase:
[0086] 7. For any service running on this NFS client, collect the current running data within the current running cycle in kernel mode, and call the normalization function in the function library that matches this client through the corresponding interface in kernel mode to normalize the current running data.
[0087] 8. Extract four feature data from the normalized processing results of the currently running data in kernel mode: average data volume of read requests, data volume fluctuation information of read requests, NFS read request offset information, and NFS read request offset information.
[0088] 9. In kernel mode, the four extracted feature data are input into the parameter prediction model. The parameter prediction model analyzes the workload type by analyzing the above four input data and outputs the read ahead value and rsize value of the service in the next running cycle.
[0089] It should be noted that normalization and feature extraction are performed by calling function libraries through different interfaces in kernel mode and user mode.
[0090] 10. In the next operating cycle, if the proportion of services whose evaluated read ahead values differ from the read ahead values used in the current operating cycle is less than or equal to a set proportion threshold, and the proportion of services whose evaluated rsize values differ from the rsize values used in the current operating cycle is also less than or equal to a set proportion threshold, they are considered to be matched. The read ahead value and rsize value corresponding to that service will not be adjusted.
[0091] 11. If the proportion of read ahead values that are different from the read ahead values used in the current running cycle is greater than a set proportion threshold, and the proportion of read ahead values that are different from the read ahead values used in the current running cycle is also greater than a set proportion threshold, it is considered a mismatch. The average read ahead value of each service in the next running cycle will be determined as the target read ahead value.
[0092] Through the parameter configuration interface, the current readahead value is updated to the target read ahead value using the input / output control block layer ioctl. The NFS client, on the other hand, updates the current read ahead value to the rsize value that the service will adapt to in the next evaluated runtime cycle through the parameter adjustment module attached to this service.
[0093] This concludes the description of the method provided in this embodiment. The apparatus provided in this application embodiment will now be described:
[0094] See Figure 4 , Figure 4 This is a schematic diagram of the device provided in an embodiment of this application. The device is applied to an NFS client. Figure 4 As shown, the device 400 includes: a preprocessing module 401, an extraction module 402, and an adjustment module 403.
[0095] The preprocessing module 401 is used in user space to normalize the historical running data of each service running on the client within the historical running cycle, which is collected by the probe component deployed in kernel space, using the normalization function that has been built and matches the client.
[0096] Extraction module 402 is used to extract the following training data from the normalization processing result: read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; the NFS read request time difference information and NFS read request offset information are used to determine the rsize value; the NFS read request time difference information is determined based on the time difference of each NFS read request pair, and the NFS read request offset information is determined based on the offset of each NFS read request pair; an NFS read request pair refers to NFS read requests with consecutive timestamps.
[0097] The adjustment module 403 is used to train a parameter prediction model based on training data and load the trained parameter prediction model in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and adjust the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
[0098] As an example, read-ahead related data includes at least:
[0099] Average data volume per read request, and information on fluctuations in the data volume per read request;
[0100] The average data volume of read requests is determined based on the data volume requested by each read request; the data volume fluctuation information of read requests is determined based on the average of the differences between the data volume requested by each read request and the average data volume of read requests.
[0101] As an example, the NFS read request offset information is determined through the following steps:
[0102] Obtain the average time difference of each NFS read request pair;
[0103] Based on the average time difference of each read request, determine the time difference information of NFS read requests.
[0104] As an example, the NFS read request offset information is determined through the following steps:
[0105] Obtain the average offset of the offsets for each NFS read request pair;
[0106] Based on the average offset of each read request, determine the NFS read request offset information.
[0107] As an example, when the evaluated read ahead and rsize values of the service do not match the current read ahead and rsize values corresponding to the service, adjusting the current read ahead and rsize values corresponding to the service based on the evaluated read ahead and rsize values includes:
[0108] Based on the evaluated read ahead value and the read ahead values of other services in the next running cycle, determine the target read ahead value; set the target read ahead value as the read ahead value adapted to the service in the next running cycle;
[0109] The evaluated rsize value will be determined as the rsize value that the service will adapt to in the next running cycle.
[0110] As an example, the steps of normalization and extracting the following training data from the normalization results are implemented by calling a function library built to adapt to the client; the function library is different from existing third-party function libraries.
[0111] This concludes the process. Figure 4 Structural description of the device shown.
[0112] Please see Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0113] Based on the same application concept as the above method, this application embodiment also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0114] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0115] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A parameter adjustment method for an NFS system, characterized in that, This method is applied to an NFS client, and the method includes: In user space, the normalization function that is currently built and matches this client is used to normalize the historical running data of each service running on this client within the historical running cycle, which is collected by the probe component deployed in kernel space. Based on the normalization result, the following training data is extracted: read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; the NFS read request time difference information and the NFS read request offset information are used to determine the rsize value; the NFS read request time difference information is determined based on the time difference of each NFS read request pair, and the NFS read request offset information is determined based on the offset of each NFS read request pair; the NFS read request pair refers to NFS read requests with consecutive timestamps. A parameter prediction model is trained based on the training data, and the trained parameter prediction model is loaded in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and to adjust the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
2. The method according to claim 1, characterized in that, The read-ahead related data includes at least: Average data volume per read request, and information on fluctuations in the data volume per read request; The average data volume of the read request is determined based on the data volume requested by each read request; the data volume fluctuation information of the read request is determined based on the average value of the difference between the data volume requested by each read request and the average data volume of the read request.
3. The method according to claim 1, characterized in that, The NFS read request offset information is determined through the following steps: Obtain the average time difference of each NFS read request pair; The NFS read request time difference information is determined based on the average time difference under each read request.
4. The method according to claim 1, characterized in that, The NFS read request offset information is determined through the following steps: Obtain the average offset of the offsets for each NFS read request pair; The NFS read request offset information is determined based on the average offset under each read request.
5. The method according to claim 1, characterized in that, When the evaluated read ahead and rsize values of the service do not match the current read ahead and rsize values corresponding to the service, adjusting the current read ahead and rsize values corresponding to the service based on the evaluated read ahead and rsize values includes: Based on the evaluated read ahead value and the read ahead values of other services in the next running cycle, a target read ahead value is determined; the target read ahead value is determined as the read ahead value adapted to the service in the next running cycle. The evaluated rsize value is determined as the rsize value adapted for the service in the next operating cycle.
6. The method according to claim 1, characterized in that, The normalization process and the step of extracting the training data from the normalization result are implemented by calling a function library adapted to the client; the function library is different from existing third-party function libraries.
7. A parameter adjustment device for an NFS system, characterized in that, This device is used in NFS clients, and the device includes: The preprocessing module is used in user space to normalize the historical running data of each service running on this client within the historical running cycle, which is collected by the probe component deployed in kernel space, using the normalization function that has been built and matches this client. The extraction module is used to extract the following training data from the normalized processing result: read-ahead related data, NFS read request time difference information after each read request is split into multiple NFS read requests and sent to the NFS server, and NFS read request offset information; the NFS read request time difference information and the NFS read request offset information are used to determine the rsize value; the NFS read request time difference information is determined based on the time difference of each NFS read request pair, and the NFS read request offset information is determined based on the offset of each NFS read request pair; the NFS read request pair refers to NFS read requests with consecutive timestamps. The adjustment module is used to train a parameter prediction model based on the training data and load the trained parameter prediction model in kernel mode. The parameter prediction model is used in subsequent applications to evaluate the read ahead value and rsize value of the service in the next running cycle based on the current running data of the collected service in the current running cycle, and adjust the read ahead value and rsize value corresponding to the current service based on the evaluated read ahead value and rsize value.
8. The apparatus according to claim 7, characterized in that, The read-ahead related data includes at least: Average data volume per read request, and information on fluctuations in the data volume per read request; The average data volume of the read request is determined based on the data volume requested by each read request; the data volume fluctuation information of the read request is determined based on the average difference between the data volume requested by each read request and the average data volume of the read request. And / or, The NFS read request offset information is determined through the following steps: Obtain the average time difference of each NFS read request pair; The NFS read request time difference information is determined based on the average time difference under each read request; And / or, The NFS read request offset information is determined through the following steps: Obtain the average offset of the offsets for each NFS read request pair; The NFS read request offset information is determined based on the average offset under each read request; And / or, When the evaluated read-ahead and rsize values for the service do not match the current read-ahead and rsize values corresponding to the service, adjusting the current read-ahead and rsize values based on the evaluated read-ahead and rsize values includes: Based on the evaluated read ahead value and the read ahead values of other services in the next running cycle, a target read ahead value is determined; the target read ahead value is determined as the read ahead value adapted to the service in the next running cycle. The evaluated rsize value is determined as the rsize value adapted for this service in the next running cycle; And / or, The normalization process and the step of extracting the training data from the normalization result are implemented by calling a function library adapted to the client; the function library is different from existing third-party function libraries.
9. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for dynamically adjusting reading order number and writing order number in storage device Cache
CN104090728A
Running state evaluation method and system, electronic equipment and storage medium
CN115204674A
Data processing method, apparatus and device, and readable storage medium
WO2020093714A1