A hard disk parameter tuning method, device, equipment and readable storage medium
By employing an automated iterative optimization mechanism, the problem of traditional hard drive tuning methods relying on manual experience is solved. This enables efficient exploration of high-dimensional parameter combination space and rapid convergence to a globally optimal configuration, thereby improving the efficiency and stability of hard drive performance tuning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINHUASAN INFORMATION TECH CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional server hard drive performance tuning methods rely heavily on engineers' personal experience, making it difficult to standardize, scale, and replicate. Furthermore, they are inefficient when dealing with complex systems, easily getting stuck in local optima, and unable to efficiently explore globally optimal configurations.
An automated iterative optimization mechanism is adopted. Several sets of configuration parameters are pre-set, and the configuration is tested and optimized according to the fitness algorithm. New configuration parameter sets are randomly generated, and the process is iterated until the termination condition is met, and the configuration parameter set with the best fitness is output.
Significantly improves tuning efficiency, quickly converges to the global optimal configuration, greatly shortens the tuning cycle, reduces operation and maintenance costs, and enables the hard drive to stably perform close to its theoretical limit under diverse business workloads.
Smart Images

Figure CN122195347A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technology, and in particular to a method, apparatus, device, and readable storage medium for optimizing hard disk parameters. Background Technology
[0002] Any bottleneck in the disk input / output process can delay critical data analysis tasks, thereby rendering the analysis results outdated and without commercial value. Therefore, given relatively fixed hardware infrastructure, how to deeply explore the potential of storage media through fine-tuning at the software and configuration levels—that is, to perform efficient server hard drive performance optimization—has become a core issue in resolving the contradiction between the real-time access needs of massive amounts of data and the inherent performance limitations of physical storage devices.
[0003] Traditional server hard drive performance tuning methods heavily rely on engineers' personal experience and static rules. Engineers manually set and test a series of system parameters based on their professional knowledge, historical experience, and industry "best practice" manuals. While this method may be effective in some simple or familiar scenarios, its limitations are becoming increasingly apparent. First, it heavily relies on individual skills, making standardization, scalability, and replicability difficult, thus hindering the efficient transfer of tuning results across different teams or environments. Second, manual tuning falls short when dealing with complex systems. Modern server storage subsystems involve numerous adjustable parameters, such as I / O scheduler policies, prefetching mechanisms, cache configurations, queue depths, and operating system kernel parameters. These parameters often have non-linear and complex interactions; adjusting one parameter can have unpredictable effects on several others. The human brain struggles to perform global trade-offs and system optimization when processing such a high-dimensional, strongly coupled parameter space, typically resorting to a method of sequentially adjusting a few parameters, inevitably ignoring the synergistic or antagonistic effects between parameters.
[0004] More importantly, experience-based tuning based on manual trial and error is prone to falling into the trap of "local optima." Engineers tend to accept parameter changes that bring immediate performance improvements during the tuning process. Once performance growth plateaus, they may assume they've found the optimal configuration and stop exploring. However, in a complex performance "topography," there may be multiple performance "peaks." Manual tuning often only finds a local high point near the starting point, potentially missing the globally superior peak. Furthermore, when faced with complex scenarios involving dozens or even hundreds of adjustable parameters, manual methods are extremely inefficient, consuming significant time and manpower, and making it difficult to guarantee the quality and consistency of the results. Summary of the Invention
[0005] In view of this, this specification provides a method, apparatus, device, and readable storage medium for hard disk parameter tuning to improve the aforementioned problem of low efficiency in hard disk parameter tuning.
[0006] The specific technical solution is as follows: This specification provides a hard disk parameter tuning method applied to hard disk testing equipment. The method includes: A) Pre-setting several sets of configuration parameter groups to participate in the first round of testing, wherein the configuration parameter groups include several different types of configuration items to be tuned and their corresponding parameters; B) In one round of testing, configuring the test environment according to each configuration parameter group, testing and obtaining the hard disk performance under the configuration of each configuration parameter group, and generating the fitness of each configuration parameter group according to a preset fitness algorithm and the performance of the hard disk; C) According to a preset method and the fitness of each configuration parameter group, selecting a portion of the configuration parameter groups that are better than the filtered configuration parameter groups from all the configuration parameter groups participating in this round of testing; D) Randomly selecting two configuration parameter groups from the selected configuration parameter groups, generating a new configuration parameter group according to the parameters corresponding to each configuration item to be tuned in these two configuration parameter groups using a preset generation algorithm, repeating this step until the number of generated new configuration parameter groups reaches a preset first threshold, and using the new configuration parameter groups to participate in the next round of testing; repeating steps B, C, and D until a preset termination condition is met, then stopping the test and outputting the parameters corresponding to each configuration item to be tuned in the configuration parameter group with the best fitness.
[0007] As a technical solution, the pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters. Among the several configuration parameter groups participating in the first round of testing, multiple preferred configuration parameter groups are configured. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability. The parameters corresponding to the various configuration items to be adjusted in the other configuration parameter groups are randomly generated.
[0008] As a technical solution, the performance of the hard drive includes the performance values of the hard drive under various different loads under the configuration of the configuration parameter group; the generation of the fitness of each configuration parameter group according to the preset fitness algorithm and the performance of the hard drive includes: assigning different or the same weight values to the performance values of different loads according to the scenario to be optimized; calculating the fitness of the configuration parameter group corresponding to the group based on the performance values of different loads and the corresponding weight values obtained by testing under a group of configuration parameter groups; wherein the configuration parameter group with higher fitness is the better configuration parameter group.
[0009] As a technical solution, generating a new set of configuration parameters that reaches a preset first threshold number and using the new set of configuration parameters to participate in the next round of testing includes: generating a new set of configuration parameters that reaches a preset first threshold number, randomly changing the parameters of a random number of the configuration parameter sets, with the total number of changes being within a preset total number of changes, and using the changed new set of configuration parameters to participate in the next round of testing.
[0010] This specification also provides a hard disk parameter tuning device applied to hard disk testing equipment. The method includes: a first module for pre-setting several sets of configuration parameter groups participating in the first round of testing, wherein the configuration parameter groups include several different types of configuration items to be tuned and their corresponding parameters; a second module for configuring the test environment according to each configuration parameter group in one round of testing, testing and obtaining the hard disk performance under the configuration of each configuration parameter group, and generating the fitness of each configuration parameter group according to a preset fitness algorithm and the performance of the hard disk; a third module for optimizing all configuration parameters participating in this round of testing according to a preset method and the fitness of each configuration parameter group. The first module filters out the configuration parameter groups that are better than those that were filtered out. The second module randomly selects two configuration parameter groups from the filtered ones. Based on the parameters of each configuration item to be adjusted in these two configuration parameter groups, a new configuration parameter group is generated using a preset generation algorithm. This module is called repeatedly until the number of new configuration parameter groups generated reaches a preset first threshold. The new configuration parameter group is then used in the next round of testing. The third, fourth, and third modules are also called repeatedly until a preset termination condition is met, at which point the test stops and the parameters of each configuration item to be adjusted in the configuration parameter group with the best fitness are output.
[0011] As a technical solution, the pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters. Among the several configuration parameter groups participating in the first round of testing, multiple preferred configuration parameter groups are configured. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability. The parameters corresponding to the various configuration items to be adjusted in the other configuration parameter groups are randomly generated.
[0012] As a technical solution, the performance of the hard drive includes the performance values of the hard drive under various different loads under the configuration of the configuration parameter group; the generation of the fitness of each configuration parameter group according to the preset fitness algorithm and the performance of the hard drive includes: assigning different or the same weight values to the performance values of different loads according to the scenario to be optimized; calculating the fitness of the configuration parameter group corresponding to the group based on the performance values of different loads and the corresponding weight values obtained by testing under a group of configuration parameter groups; wherein the configuration parameter group with higher fitness is the better configuration parameter group.
[0013] As a technical solution, generating a new set of configuration parameters that reaches a preset first threshold number and using the new set of configuration parameters to participate in the next round of testing includes: generating a new set of configuration parameters that reaches a preset first threshold number, randomly changing the parameters of a random number of the configuration parameter sets, with the total number of changes being within a preset total number of changes, and using the changed new set of configuration parameters to participate in the next round of testing.
[0014] This specification also provides an electronic device, including a processor and a readable storage medium, the readable storage medium storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the aforementioned hard disk parameter tuning method.
[0015] This specification also provides a readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned hard disk parameter tuning method.
[0016] The technical solutions provided in this specification offer at least the following beneficial effects: Through an automated iterative optimization mechanism, it efficiently explores the high-dimensional parameter combination space, significantly improving tuning efficiency and performance ceiling. It effectively avoids the limitations of human experience and the trap of local optima, quickly converging to a globally optimal configuration, greatly shortening the tuning cycle and reducing operation and maintenance costs. This enables hard drives to stably perform near-theoretical read and write performance under diverse business workloads, providing reliable and adaptive performance assurance for the storage system. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings used in the description of the embodiments of this specification or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this specification.
[0018] Figure 1 This is a flowchart of a hard disk parameter optimization method in one embodiment of this specification; Figure 2 This is a structural diagram of a hard disk parameter tuning device according to one embodiment of this specification; Figure 3 This is a hardware structure diagram of an electronic device according to one embodiment of this specification.
[0019] Reference numerals: Module 1 21, Module 22, Module 3 23, Module 4 24. Detailed Implementation
[0020] The terminology used in the embodiments described herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The singular forms “a,” “described,” and “the” as used in this specification and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0021] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0022] This specification provides a method, apparatus, device, and readable storage medium for optimizing hard disk parameters to at least improve one of the aforementioned technical problems.
[0023] The specific technical solution is described below.
[0024] In one embodiment, this specification provides a hard disk parameter tuning method applied to a hard disk testing device. The method includes: A) pre-setting several sets of configuration parameter groups to participate in the first round of testing, wherein the configuration parameter groups include several different types of configuration items to be tuned and their corresponding parameters; B) in one round of testing, configuring the test environment according to each configuration parameter group, testing and obtaining the hard disk performance under the configuration of each configuration parameter group, and generating the fitness of each configuration parameter group according to a preset fitness algorithm and the performance of the hard disk; C) according to a preset method and the fitness of each configuration parameter group, selecting from all participants in this round of testing... From the configuration parameter groups, select the better configuration parameter groups compared to the filtered ones; D, randomly select two configuration parameter groups from each of the selected configuration parameter groups, and generate a new configuration parameter group based on the parameters corresponding to the various configuration items to be adjusted in these two configuration parameter groups using a preset generation algorithm. Repeat this step until the number of generated new configuration parameter groups reaches a preset first threshold, and use the new configuration parameter groups to participate in the next round of testing; repeat steps B, C, and D above until the preset termination condition is met, then stop the test and output the parameters corresponding to the various configuration items to be adjusted in the configuration parameter group with the best fitness.
[0025] When implementing this hard drive parameter tuning method, a standardized testing environment must first be built as the foundation for its operation. The testing equipment typically uses high-performance server hardware, equipped with the target hard drive to be optimized (which can be SATA / SASHDD, NVMe SSD, or a hybrid architecture storage device), running a streamlined and solidified operating system kernel, and pre-installed with an automated testing framework and monitoring agent. During testing, the system achieves precise control of hardware parameters through a dedicated management interface (such as IPMI or BMC), while integrating industrial-grade benchmark tools such as fio and iozone as the core for performance data acquisition. This is supplemented by system monitoring commands such as sar and iostat to capture auxiliary indicators such as CPU utilization, memory usage, and interrupt frequency in real time, ensuring the comprehensiveness and reliability of the test data. To eliminate interference from environmental fluctuations, a standardized preprocessing procedure is performed before each test: clearing the system cache, resetting the RAID controller status, unifying file system mount options (such as ext4's noatime, barrier=0, etc.), and setting a constant test load model (such as simulating a 4KB random read / write mixed load in a database OLTP scenario, or a 1MB sequential read / write load in a video processing scenario) to ensure that the test results of different parameter groups are strictly comparable.
[0026] Specifically, such as Figure 1 This includes the following steps, the order of which can be changed depending on the needs of the actual application scenario: Step S11: Pre-set several sets of configuration parameters to participate in the first round of testing.
[0027] The system dynamically generates multiple configuration schemes required for the first round of testing based on a preset parameter space definition file. This file clearly defines the set of configuration items to be tuned and their legal value ranges, such as: I / O scheduling strategy (optional noop, deadline, cfq, mq-deadline, etc.), read window size (value range 64KB–1024KB, step size 64KB), block device queue depth (value range 16–256, integer), RAID card write cache strategy (WriteBack / WriteThrough), number of NVMe namespace I / O queues (1–64), file system pre-allocated block size (4KB–1MB), and more than ten other key parameters.
[0028] The generation of the first round of parameter sets adopts a hierarchical random sampling strategy: discrete parameters (such as scheduler type) are uniformly and randomly selected from the option pool; continuous parameters (such as prefetch size) are generated into floating-point values by a pseudo-random number generator within the defined range and then rounded; at the same time, a boundary value reinforcement mechanism is introduced to ensure that the initial set of each round contains the minimum value, maximum value and typical empirical value combination of each parameter.
[0029] For example, when generating 20 initial configuration sets in the first round, one set might be "mq-deadline scheduler + 512KB prefetch + queue depth 128 + WriteBack cache", while another set might be "noop scheduler + 128KB prefetch + queue depth 32 + WriteThrough cache". Hash verification ensures that all parameter sets are distinct, avoiding redundant testing. This process is entirely automated by the configuration management module, requiring no manual intervention, thus covering the breadth of the parameter space while preserving a foundation for diversity in subsequent iterations.
[0030] Step S12: Configure the test environment according to each configuration parameter group, test and obtain the hard disk performance under each configuration parameter group, and generate the fitness of each configuration parameter group according to the preset fitness algorithm and the hard disk performance.
[0031] The system sequentially loads each set of configuration parameters into the test environment: kernel parameters are dynamically adjusted via the sysfs interface, RAID card policies are configured using the storcli tool, and NVMe device properties are set by calling nvme-cli. The preset fio test script is started immediately after the parameters take effect. The testing process strictly follows time window control (e.g., 300 seconds of warm-up + 600 seconds of formal sampling for each configuration). During this period, key performance indicators are collected frequently—including random read / write IOPS (operations per second), sequential read / write bandwidth (MB / s), average latency (μs), 99% tail latency (μs), etc.—and system resource consumption data is recorded simultaneously.
[0032] After the test, the raw metrics are processed by the data cleaning module (removing abnormal fluctuations and calculating moving averages) and then input into the preset fitness calculation engine. This engine uses a multi-objective weighted fusion algorithm: first, it normalizes each metric (e.g., mapping IOPS to the 0–1 range, and normalizing latency metrics after inverse transformation), then assigns dynamic weights based on business priority (e.g., database scenarios prioritize IOPS and low latency, with weights set to 0.5 and 0.3 respectively; big data analytics scenarios prioritize bandwidth, with a weight set to 0.6), and finally calculates the comprehensive fitness score. For example, one configuration group measured IOPS=45000 (normalized 0.85), bandwidth=1800MB / s (normalized 0.78), and average latency=0.15ms (normalized 0.82). Under database weights, its fitness score is 0.85×0.5+0.78×0.2+0.82×0.3=0.827. However, another group experienced a sudden increase in latency to 0.5ms, causing its normalized value to drop to 0.3. Even though its IOPS was slightly higher, its overall fitness score was still significantly lower. This quantitative evaluation mechanism transforms subjective performance perception into objective numerical values, providing a precise basis for subsequent selection.
[0033] Step S13: Based on the preset method and the adaptability of each configuration parameter group, select the configuration parameter groups that are better than the configuration parameter groups that were filtered out from all the configuration parameter groups participating in this round of testing.
[0034] In one pre-defined method, based on fitness, all configuration groups in this round are first sorted in descending order of fitness score. The top 15% of elite groups are forcibly retained (e.g., the top 3 out of 20 groups), ensuring that high-value solutions are not accidentally eliminated. The remaining slots are supplemented using a probabilistic selection strategy: the proportion of each group's fitness to the total is calculated as the probability of selection, and a roulette wheel algorithm is used for random selection. This gives groups with higher fitness a greater chance of retention, while retaining a certain degree of randomness to maintain diversity. For example, if the fitness of the 4th-ranked group is 0.79 (8% probability) and the fitness of the 10th-ranked group is 0.65 (5% probability), when 5 supplementary slots are drawn, the statistical expectation of the higher-fitting group being selected is higher, but the lower-fitting group still has a small probability of retention, effectively avoiding premature convergence to a suboptimal solution. The selection process also incorporates a diversity verification module: if the Hamming distance (number of parameter differences) between the retained groups is too small, some highly similar groups are replaced with candidate groups with slightly lower fitness but significant differences, preventing population homogenization. After this screening, the 20 configurations in this round may be reduced to 8 high-quality solutions, which will both focus on advantageous areas and retain rich materials for the generation of new solutions.
[0035] Alternatively, different methods such as tournament selection, random traversal sampling, and elite selection can be used, depending on the needs.
[0036] Step S14: Randomly select two configuration parameter groups from the selected configuration parameter groups, and generate a new configuration parameter group based on the parameters corresponding to the configuration items to be adjusted in the two configuration parameter groups using a preset generation algorithm.
[0037] Two sets of high-quality configurations are randomly selected without replacement from the selected high-quality configuration sets as source schemes. For example, "Scheme A: mq-deadline + prefetch 384KB + queue depth 96" and "Scheme B: deadline + prefetch 640KB + queue depth 160" are selected. For each configuration item to be adjusted, a preset generation algorithm fuses parameters according to preset rules: For discrete parameters (such as the scheduler), the value corresponding to the one with higher fitness among the two source schemes is selected with a 70% probability, and one is randomly selected with a 30% probability; for continuous parameters (such as the prefetch size), a weighted interpolation method is used—the new value is calculated with the fitness of the two source schemes as weights (e.g., (0.82×384 + 0.79×640) / (0.82+0.79)≈502KB), and a random perturbation within ±5% is added (e.g., 502×1.03≈517KB) to introduce micro-innovations; for parameters with logical constraints (e.g., the queue depth must be a power of 2), the generated value is automatically corrected to the most recent valid value (517KB is corrected to 512KB). After all parameters are fused, the new scheme undergoes a validity check (checking whether the parameter combination conflicts, such as disabling large prefetch windows under the WriteThrough strategy), and invalid schemes are immediately discarded and regenerated.
[0038] Step S15: Repeat step S14 until a new set of configuration parameters is generated in a number that reaches the preset first threshold.
[0039] The aforementioned steps for generating new schemes are repeated until a preset number (e.g., 12 groups) of new configuration schemes are generated, forming the complete input set for the next round of testing.
[0040] Step S16: Repeat steps S12 to S15 until the preset termination condition is met, then stop the test and output the parameters corresponding to each configuration item to be adjusted in the configuration parameter group with the best fitness.
[0041] After each iteration, the global optimal fitness and average fitness are recorded in the convergence analysis module. If the improvement of the optimal value is less than 0.5% for five consecutive iterations, or if the preset maximum number of iterations (e.g., 50 iterations) is reached, the termination condition is triggered. Simultaneously, an "early stop" mechanism is set—when more than 80% of the newly generated solutions have fitness values lower than the historical best, the number of new solutions in subsequent iterations is automatically reduced to accelerate convergence. During the iteration process, the parameter exploration strategy also evolves adaptively: initially focusing on breadth-first search (increasing the range of random perturbations and improving the retention probability of low-fitness solutions), and later shifting to depth-first mining (reducing the perturbation amplitude and strengthening the influence of the elite group), achieving an intelligent balance of "exploitation before exploration." For example, after discovering the outstanding performance of the "512KB pre-read + 128 queue depth" combination in the 10th iteration, subsequent generation will intensively sample around this region (e.g., generating fine-tuned variants such as 500KB / 520KB / 120 / 130), precisely locating the peak point.
[0042] In one implementation, it runs on a dedicated hard drive testing device, which typically consists of core components such as high-performance server nodes, multi-type storage media arrays, automated configuration management modules, and benchmark execution engines, and is capable of simulating various workload characteristics in a real data center environment.
[0043] In the initial stage of method execution, it is necessary to first complete the pre-setting of several sets of configuration parameter groups that will participate in the first round of testing.
[0044] The construction of the configuration parameter group involves a systematic review of the adjustable parameters of the hard disk subsystem. These parameters span multiple abstraction levels, including but not limited to RAID controller caching policy settings, hard disk native instruction sorting relax ordering on / off status, I / O scheduler algorithm selection such as noop, deadline or mq-deadline, I / O queue depth configuration, transparent hugepage enabled status, file system readahead window size, block device scheduler parameter nr_requests settings, CPU frequency governor policy binding, NUMA memory allocation policy, and interrupt affinity irqaffinity configuration, among dozens of other key parameters.
[0045] Each set of configuration parameters essentially constitutes a multi-dimensional vector, where each dimension corresponds to a specific type of configuration item to be adjusted. The coordinate position of this vector in the parameter space represents a complete system configuration state.
[0046] In the actual pre-setting process, a completely random generation strategy can be adopted to ensure the diversity of the initial population, or high-performance configurations selected by domain experts based on historical experience can be introduced as prior knowledge into the initial population to accelerate the convergence process.
[0047] For example, for OLTP database scenarios, a set of configuration parameters can be pre-configured, such as setting the I / O scheduler to mq-deadline, the queue depth to 128, enabling transparent big pages, setting the read-ahead window to 256KB, and setting the RAID write policy to Write Back. For big data analytics OLAP scenarios, another set of differentiated configurations may be pre-configured, such as using a noop scheduler, setting the queue depth to 1024, disabling transparent big pages to avoid memory fragmentation, significantly increasing the read-ahead window to 4096KB, and focusing on sequential write optimization in the RAID policy.
[0048] The initial number of configuration parameter groups is typically set between fifty and one hundred. This size strikes a reasonable balance between ensuring population diversity and controlling the time cost of the first round of testing. All preset configuration parameter groups are persistently stored in the database or configuration file of the test equipment in a structured data format, and an associated index is established with metadata such as test rounds and parameter versions for subsequent process calls and traceability.
[0049] After the initial configuration parameter group is pre-set, the method enters the first round of test execution phase, that is, for each set of configuration parameter groups, the test environment is configured, the benchmark test is executed, and the performance data is collected and analyzed in sequence.
[0050] In each round of testing, the test equipment needs to traverse all configuration parameter groups participating in the current round and execute a complete environment configuration and performance evaluation process for each configuration parameter group. The environment configuration phase requires the test equipment to have strong automated deployment capabilities, capable of precisely adjusting the test environment to the target state based on the specific parameter values of each configuration item to be adjusted in the configuration parameter group, through a series of operations such as calling system commands, modifying kernel parameters, adjusting driver configurations, and restarting related services.
[0051] Taking a Linux operating system environment as an example, when the configuration parameter group includes setting the transparent big page policy to always, the test device needs to perform an operation to write the always value to a specific node in the sys file system. When I / O scheduler switching is involved, the scheduling algorithm needs to be changed by modifying the block device scheduler selection file. For parameter adjustments at the RAID controller level, it may be necessary to call vendor-provided tools such as storcli or sas2ircu for low-level configuration. To ensure that the configuration takes effect and the system state is stable, several seconds to several minutes of stabilization time are usually allowed after each environment change, supplemented by a health check mechanism to verify whether the configuration is applied correctly.
[0052] The test design needs to cover multiple typical load modes to comprehensively evaluate the performance of the configuration parameter group under different application scenarios. Specifically, this includes random read tests simulating online transaction processing, random write tests simulating log writing, sequential read tests simulating data warehouse scanning, sequential write tests simulating batch data import, and mixed read / write tests simulating mixed business scenarios. Each test mode must have reasonable runtime, data block size distribution, number of concurrent threads, and test dataset size set to ensure statistical significance of the results.
[0053] For example, the random read test can be configured to use 4KB data blocks, 32 concurrent threads, a runtime of 300 seconds, and a test file size of 80% of the device capacity, focusing on IOPS and 99th percentile latency; the sequential write test can be configured to use 1MB data blocks, 8 concurrent threads, and a runtime of 180 seconds, focusing on bandwidth throughput and I / O latency stability. During the test, multi-dimensional performance metrics including IOPS, bandwidth, average latency, maximum latency, latency standard deviation, and CPU utilization are output. This data is collected in real time by the test device and stored in a structured format.
[0054] Based on the collected raw performance data, a preset fitness algorithm is invoked to calculate the fitness value of each configuration parameter group. This fitness value is a quantitative standard for measuring the quality of the configuration and also serves as the basis for subsequent selection and generation of new configurations. The design of the fitness algorithm is highly dependent on the specific optimization objective. It can be maximizing a single metric, such as pursuing only the highest random read IOPS, or it can be a weighted combination of multiple metrics, such as comprehensively considering read / write performance and latency. Constraints can also be introduced, such as requiring latency not to exceed a specific threshold.
[0055] A typical multi-objective fitness function can be designed as a linear weighted average of various performance metrics. Random read IOPS, random write IOPS, sequential read bandwidth, and sequential write bandwidth are positively weighted in the fitness score, while average latency is negatively weighted and deducted from the fitness score. The weights can be dynamically adjusted based on business priorities. For example, in high-concurrency database scenarios, the weights for random read IOPS, random write IOPS, and average latency can be set to 0.4, while the weights for sequential access metrics can be reduced. In streaming data processing scenarios, the weight allocation can be adjusted in the opposite way.
[0056] After the fitness calculation is completed, all configuration parameter groups participating in this round of testing will receive a numerical fitness score. The higher the score, the better the overall performance of the configuration under the given optimization goal. The score results and configuration parameter groups will be stored in the optimization status record.
[0057] Based on fitness, some superior configurations are selected from all configuration parameter groups participating in this round of testing, while relatively inferior configurations are eliminated, concentrating search resources on regions with potential. The selection strategy needs to balance selection pressure and population diversity. Overly aggressive selection may lead to premature convergence to a local optimum, while overly conservative selection will reduce search efficiency.
[0058] This embodiment supports multiple selection mechanisms. One is a roulette wheel selection, which simulates a probability roulette wheel. The probability of each configuration parameter group being selected is proportional to its fitness value; higher fitness configurations have a greater chance of being selected, but low-fitness configurations still retain a certain survival chance. Another mechanism, tournament selection, randomly selects several configurations for local competition, with the winners advancing to the next generation. The selection pressure of this mechanism can be adjusted by the tournament size. An elite retention strategy ensures that the highest-fitting configuration parameter groups in each generation unconditionally advance to the next round, preventing the loss of excellent local parameters. A ranking selection first sorts by fitness and then allocates selection probabilities based on ranking, mitigating the problem of super-individual monopolies. In practical applications, a combined strategy is often used, such as retaining 10% of elite individuals and generating the remaining 90% through tournament selection. This ensures the continuation of optimal configurations while maintaining the evolutionary momentum of the population. After the selection process, the fifty to one hundred configuration parameter groups participating in this round of testing may be reduced to twenty to forty groups. These retained configuration parameter groups represent high-performance regions discovered in the current search space and will serve as the basic material for generating new configurations in the future.
[0059] By combining and modifying information from existing superior configurations, new sets of configuration parameters with potentially better performance are created, enabling proactive exploration of the parameter space. Specifically, two sets of configuration parameters are randomly selected from the filtered set as information sources. A preset generation algorithm is used to merge and adjust the parameters of each configuration item to be adjusted in these two sets, resulting in a completely new set of configuration parameters.
[0060] By appropriately introducing random perturbations to maintain parameter configuration diversity, the core of the generation algorithm lies in defining and implementing the information exchange rules between two previous rounds of configuration. This embodiment supports multiple implementation methods. The single-point exchange method randomly selects a breakpoint in the parameter sequence of the configuration parameter group. Parameters before the breakpoint are taken from the first group of previous round configurations, and parameters after the breakpoint are taken from the second group of previous round configurations. For example, if the breakpoint is selected at the 3rd parameter, the first 3 parameters of the new configuration are inherited from previous round A, and the remaining parameters are inherited from previous round B. The multi-point exchange method sets multiple breakpoints, alternately inheriting parameter segments from different previous rounds, which can generate more complex parameter combination patterns. The uniform exchange method independently decides whether to inherit from previous round A or previous round B for each configuration item to be adjusted. The decision basis can be a uniform random distribution or adaptive weighting based on the historical optimization effect of the parameter item. To illustrate with a specific example, suppose the parameter sequence of the previous configuration A was mq-deadline scheduler, queue depth 128, transparent huge page enabled, and prefetch 512KB. The parameter sequence of the previous configuration B was noop scheduler, queue depth 256, transparent huge page disabled, and prefetch 1024KB. Using single-point switching and with the breakpoint located after the second parameter, the generated new configuration might be mq-deadline scheduler, queue depth 128, transparent huge page disabled, and prefetch 1024KB. This configuration combines the low-latency scheduling strategy of A with the high throughput characteristics of B's large prefetch, and may exhibit better performance than the previous A and B under certain mixed loads.
[0061] In addition to information exchange, the generation algorithm also includes a perturbation mechanism. This mechanism randomly adjusts the parameter values of some of the configuration items to be adjusted in the newly generated configuration parameter set, introducing new parameter combination possibilities and preventing the search from prematurely falling into a local optimum. The perturbation operation is performed independently for each parameter with a small probability. The probability value is configurable, such as being set between 5% and 20%, and can be dynamically adjusted according to the search progress. A higher probability is used in the early stages to enhance exploration capabilities, and a lower probability is used in the later stages to refine the search. For numerical parameters such as queue depth and prefetch window size, perturbation can involve randomly selecting a new value within its range or shifting it using a Gaussian distribution based on its current value. For enumeration-type parameters such as scheduler type, perturbation manifests as an equal probability switch to other available types. Continuing the previous example, the newly generated configuration might, during the perturbation step, randomly change the queue depth from 128 to 64 or 256, or switch the scheduler from mq-deadline to bfq, thus generating entirely new configuration variants. It is important to emphasize that perturbation operations must consider the constraints between parameters to ensure that the generated configuration is physically feasible and will not cause system instability. For example, when the RAID card caching policy is set to Write Through, some queue depth settings that depend on the cache may need to be adjusted accordingly.
[0062] The new configuration generation step is executed cyclically until the cumulative number of newly generated configuration parameter sets reaches a preset first threshold. This threshold determines the population size for each round of testing and is typically equal to or slightly lower than the initial number of configurations to control computational resource consumption. All newly generated configuration parameter sets, together with the retained elite configurations, constitute the complete configuration set for the next round of testing, entering a new round of fitness evaluation, selection, and generation loop. This iterative optimization process continues until a preset termination condition is met.
[0063] The design of termination conditions needs to take into account both optimization quality and computational efficiency. Common termination triggering mechanisms include reaching the maximum number of iterations, such as a preset 100 rounds of testing; the improvement of the optimal fitness in multiple consecutive rounds being less than a threshold, such as an improvement of less than 1% within 5 rounds; finding a configuration that meets the preset performance target, such as fitness exceeding the set baseline value; or the consumption of computational resources reaching the budget limit, such as the total testing time exceeding 24 hours.
[0064] Once the termination condition is triggered, the method selects the best-fit configuration parameter group from all historically tested configuration parameter groups as the final output. This configuration contains the optimal parameter combination for each configuration item to be adjusted, which can be directly applied to the production environment or used as the basis for further fine-tuning.
[0065] In one implementation, the pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters. This includes configuring multiple preferred configuration parameter groups among the several configuration parameter groups participating in the first round of testing. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability, and the parameters corresponding to the various configuration items to be adjusted in the other configuration parameter groups are randomly generated.
[0066] In one embodiment, the performance of the hard drive includes performance values of the hard drive under various different loads under the configuration of the configuration parameter group; the step of generating the fitness of each configuration parameter group according to the preset fitness algorithm and the performance of the hard drive includes: assigning different or the same weight values to the performance values of different loads according to the scenario to be optimized; calculating the fitness of the configuration parameter group corresponding to the group based on the performance values of different loads and the corresponding weight values obtained by testing under a group of configuration parameter groups; wherein the configuration parameter group with higher fitness is the better configuration parameter group.
[0067] In one implementation, generating a new set of configuration parameters that reaches a preset first threshold number and using the new set of configuration parameters to participate in the next round of testing includes: generating a new set of configuration parameters that reaches a preset first threshold number, randomly changing the parameters of a random number of the configuration parameter sets, with the total number of changes being within a preset total number of changes, and using the changed new set of configuration parameters to participate in the next round of testing.
[0068] In one implementation, such as Figure 2 This specification also provides a hard disk parameter tuning device applied to hard disk testing equipment. The method includes: a first module for pre-setting several sets of configuration parameter groups participating in the first round of testing, wherein the configuration parameter groups include several different types of configuration items to be tuned and their corresponding parameters; a second module for configuring the test environment according to each configuration parameter group in one round of testing, testing and obtaining the hard disk performance under the configuration of each configuration parameter group, and generating the fitness of each configuration parameter group according to a preset fitness algorithm and the performance of the hard disk; a third module for selecting from all configuration parameters participating in this round of testing according to a preset method and the fitness of each configuration parameter group. The first module filters out the configuration parameter groups that are better than those that were filtered out. The second module randomly selects two configuration parameter groups from the filtered ones. Based on the parameters of each configuration item to be adjusted in these two configuration parameter groups, a new configuration parameter group is generated using a preset generation algorithm. This module is called repeatedly until the number of new configuration parameter groups generated reaches a preset first threshold. The new configuration parameter group is then used in the next round of testing. The third, fourth, and third modules are also called repeatedly until a preset termination condition is met, at which point the test stops and the parameters of each configuration item to be adjusted in the configuration parameter group with the best fitness are output.
[0069] In one implementation, the pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters. This includes configuring multiple preferred configuration parameter groups among the several configuration parameter groups participating in the first round of testing. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability, and the parameters corresponding to the various configuration items to be adjusted in the other configuration parameter groups are randomly generated.
[0070] In one embodiment, the performance of the hard drive includes performance values of the hard drive under various different loads under the configuration of the configuration parameter group; the step of generating the fitness of each configuration parameter group according to the preset fitness algorithm and the performance of the hard drive includes: assigning different or the same weight values to the performance values of different loads according to the scenario to be optimized; calculating the fitness of the configuration parameter group corresponding to the group based on the performance values of different loads and the corresponding weight values obtained by testing under a group of configuration parameter groups; wherein the configuration parameter group with higher fitness is the better configuration parameter group.
[0071] In one implementation, generating a new set of configuration parameters that reaches a preset first threshold number and using the new set of configuration parameters to participate in the next round of testing includes: generating a new set of configuration parameters that reaches a preset first threshold number, randomly changing the parameters of a random number of the configuration parameter sets, with the total number of changes being within a preset total number of changes, and using the changed new set of configuration parameters to participate in the next round of testing.
[0072] The implementation methods of the apparatus are the same as or similar to the corresponding implementation methods, and will not be described again here.
[0073] In one embodiment, this specification provides an electronic device including a processor and a readable storage medium storing machine-executable instructions executable by the processor. The processor executes the machine-executable instructions to implement the aforementioned hard disk parameter tuning method. From a hardware perspective, a hardware architecture diagram can be found... Figure 3 As shown.
[0074] In one embodiment, this specification provides a readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned hard disk parameter tuning method.
[0075] Here, a 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 example, a readable storage medium 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.
[0076] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0077] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0078] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification can take the form of a completely hardware implementation, a completely software implementation, or an implementation combining software and hardware aspects. Furthermore, embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0079] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments thereof. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0080] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0082] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification can take the form of a completely hardware implementation, a completely software implementation, or an implementation combining software and hardware aspects. Furthermore, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (which may include, but are not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0083] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for optimizing hard disk parameters, characterized in that, The method, applied to hard disk testing equipment, includes: A. Several sets of configuration parameter groups are pre-set to participate in the first round of testing. The configuration parameter groups include several different types of configuration items to be adjusted and their corresponding parameters. B. In one round of testing, the test environment is configured according to each configuration parameter group, the performance of the hard drive is tested and obtained under the configuration parameter group, and the fitness of each configuration parameter group is generated according to the preset fitness algorithm and the performance of the hard drive. C. Based on the preset method and the adaptability of each configuration parameter group, select the configuration parameter groups that are better than the configuration parameter groups that were filtered out from all the configuration parameter groups participating in this round of testing. D. Randomly select two configuration parameter groups from the selected configuration parameter groups. Based on the parameters corresponding to the various configuration items to be adjusted in these two configuration parameter groups, use the preset generation algorithm to generate a new configuration parameter group. Repeat this step until the number of generated new configuration parameter groups reaches the preset first threshold. Use the new configuration parameter group to participate in the next round of testing. Repeat steps B, C, and D until the preset termination condition is met, then stop the test and output the parameters corresponding to each of the configuration items to be adjusted in the configuration parameter group with the best fitness.
2. The method according to claim 1, characterized in that, The pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters, including: Among the several sets of configuration parameter groups participating in the first round of testing, multiple sets of preferred configuration parameter groups are configured. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability, while the parameters corresponding to each configuration item to be adjusted in the other configuration parameter groups are randomly generated.
3. The method according to claim 1, characterized in that, The performance of the hard drive includes the performance values of the hard drive under various different loads under the configuration parameter group. The process of generating fitness for each configuration parameter group based on a preset fitness algorithm and hard drive performance includes: Assign different or the same weight values to the performance values of different loads based on the scenario to be optimized. Calculate the fitness of the configuration parameter group based on the performance values of different loads and the corresponding weight values obtained from testing under a set of configuration parameter groups. The configuration parameter group with higher fitness is the better configuration parameter group.
4. The method according to claim 1, characterized in that, The generation of new configuration parameter groups that reaches a preset first threshold number will be used in the next round of testing, including: Generate a new set of configuration parameters that reaches a preset first threshold number, randomly change the parameters of a random number of these sets, and if the total number of changes is within a preset range, use the modified new set of configuration parameters to participate in the next round of testing.
5. A method for optimizing hard disk parameters, characterized in that, The method, applied to hard disk testing equipment, includes: The first module is used to pre-set several sets of configuration parameter groups to participate in the first round of testing. The configuration parameter groups include several different types of configuration items to be adjusted and their corresponding parameters. The second module is used to configure the test environment according to each configuration parameter group in a round of testing, test and obtain the hard drive performance under each configuration parameter group, and generate the fitness of each configuration parameter group based on the preset fitness algorithm and the hard drive performance. The third module is used to select, based on preset methods and the adaptability of each set of configuration parameter groups, a subset of configuration parameter groups that are better than those that were filtered out from all the configuration parameter groups participating in this round of testing. The fourth module is used to randomly select two configuration parameter groups from the filtered configuration parameter groups. Based on the parameters corresponding to the configuration items to be adjusted in these two configuration parameter groups, a new configuration parameter group is generated using a preset generation algorithm. This module is called repeatedly until the number of generated new configuration parameter groups reaches a preset first threshold. The new configuration parameter group is then used to participate in the next round of testing. The second, third, and fourth modules are also used to be called repeatedly until the preset termination condition is met, at which point the test stops and the parameters corresponding to each of the configuration items to be adjusted in the configuration parameter group with the best fitness are output.
6. The apparatus according to claim 5, characterized in that, The pre-set configuration parameter groups for the first round of testing include several different types of configuration items to be adjusted and their corresponding parameters, including: Among the several sets of configuration parameter groups participating in the first round of testing, multiple sets of preferred configuration parameter groups are configured. The preferred configuration parameter groups are pre-recorded configuration parameter groups with better adaptability, while the parameters corresponding to each configuration item to be adjusted in the other configuration parameter groups are randomly generated.
7. The apparatus according to claim 5, characterized in that, The performance of the hard drive includes the performance values of the hard drive under various different loads under the configuration parameter group. The process of generating fitness for each configuration parameter group based on a preset fitness algorithm and hard drive performance includes: Assign different or the same weight values to the performance values of different loads based on the scenario to be optimized. Calculate the fitness of the configuration parameter group based on the performance values of different loads and the corresponding weight values obtained from testing under a set of configuration parameter groups. The configuration parameter group with higher fitness is the better configuration parameter group.
8. The apparatus according to claim 5, characterized in that, The generation of new configuration parameter groups that reaches a preset first threshold number will be used in the next round of testing, including: Generate a new set of configuration parameters that reaches a preset first threshold number, randomly change the parameters of a random number of these sets, and if the total number of changes is within a preset range, use the modified new set of configuration parameters to participate in the next round of testing.
9. An electronic device, characterized in that, include: A processor and a readable storage medium storing machine-executable instructions that can be executed by the processor to implement the method of any one of claims 1-4.
10. A readable storage medium, characterized in that, The readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method described in any one of claims 1-4.