Storage queue adjustment method and device, equipment and storage medium

By monitoring and dynamically adjusting the NVMe queue, the performance bottleneck and resource waste caused by static NVMe queue configuration are resolved, and the performance and resource utilization of the storage system are optimized.

CN120848809APending Publication Date: 2025-10-28JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511223535.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

The static configuration of NVMe queues in existing technologies results in suboptimal storage system performance when facing dynamically changing I/O loads, potentially leading to performance bottlenecks or resource waste.

Method used

By monitoring the NVMe queue, the current resource storage load status is determined based on the preset queue occupancy analysis method, and a target queue adjustment method is generated to dynamically adjust the queue depth and number to optimize resource utilization.

Benefits of technology

It achieves performance optimization and resource utilization improvement of the storage system, avoiding performance bottlenecks and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120848809A_ABST
    Figure CN120848809A_ABST
Patent Text Reader

Abstract

The invention discloses a storage queue adjustment method and device, equipment and a storage medium, and relates to the technical field of data storage, and the method comprises the steps: monitoring an NVMe queue, and analyzing the current queue use condition of the NVMe queue based on a preset queue occupancy rate analysis method to determine the current resource storage load state; generating a target queue adjustment method corresponding to the NVMe queue based on a preset queue adjustment method and the current resource storage load state; and adjusting the real-time queue depth and the real-time queue number in the NVMe queue based on the target queue adjustment method so as to carry out resource storage based on the adjusted real-time queue depth and the real-time queue number. Therefore, the corresponding queue adjustment method is determined according to the current resource storage load, and the queue is adjusted by using the determined queue adjustment method, so that the flexibility of the system storage space can be improved, and the performance bottleneck or resource waste can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a storage queue adjustment method, apparatus, device, and storage medium. Background Technology

[0002] like Figure 1 As shown, with the widespread adoption of the NVMe (Non-Volatile Memory Express, a storage protocol designed for flash-based devices) protocol in high-performance storage systems, the performance and efficiency of storage devices have been significantly improved. However, the configuration of NVMe queues in existing technologies is typically static, which means that the performance of the storage system cannot reach its optimal level when facing dynamically changing I / O (Input / Output) loads. For example, when the I / O request volume suddenly increases, a fixed number of queues may not be able to effectively handle high-concurrency requests, leading to a performance bottleneck; while when the I / O request volume is low, too many queues will result in wasted resources.

[0003] Therefore, adjusting the queue to improve the performance of the storage system is a problem that needs to be addressed. Summary of the Invention

[0004] The purpose of this invention is to provide a storage queue adjustment method, apparatus, device, and storage medium that can dynamically adjust the queue to avoid system performance bottlenecks or resource waste. The specific solution is as follows:

[0005] In a first aspect, this application discloses a storage queue adjustment method, including:

[0006] Monitor the NVMe queue and analyze the current queue usage based on the preset queue occupancy analysis method to determine the current resource storage load status;

[0007] Generate the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status;

[0008] The target queue adjustment method is used to adjust the real-time queue depth and number of real-time queues in the NVMe queue, so that resource storage can be performed based on the adjusted real-time queue depth and number of real-time queues.

[0009] Optionally, the current queue usage of NVMe queues can be analyzed based on a preset queue occupancy analysis method, including:

[0010] Get the real-time queue depth and current packet count of each queue in the NVMe queue; the current packet count is the number of unprocessed commands in each queue.

[0011] The current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queue are determined based on the real-time queue depth and the current number of packets.

[0012] Optionally, the current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queues are determined based on the real-time queue depth and the current number of packets, including:

[0013] The current queue occupancy rate of each queue is determined based on the percentage values ​​of real-time queue depth and current message count;

[0014] The total queue depth and total number of packets in the NVMe queue are determined based on the real-time queue depth and the current number of packets, respectively; and the total queue occupancy rate of the NVMe queue is determined based on the percentage values ​​of the total queue depth and the total number of packets.

[0015] Alternatively, queues with a current queue occupancy rate greater than a first preset data threshold can be identified as the first target queues, and the total queue occupancy rate of the NVMe queues can be determined based on the percentage between the number of target queues in the first target queues and the real-time number of queues in the NVMe queues.

[0016] Optionally, a target queue adjustment method is generated based on a preset queue adjustment method and the current resource storage load status; the real-time queue depth and number of real-time queues in the NVMe queue are adjusted based on the target queue adjustment method, including:

[0017] The queues in the NVMe queue whose current queue occupancy rate is within the queue depth adjustment threshold range are identified as the second target queues; the queue depth adjustment threshold range is less than the first preset minimum occupancy rate threshold or greater than the first preset maximum occupancy rate threshold.

[0018] The queue depth adjustment operation is determined based on the preset queue depth adjustment function, and the current queue depth of the second target queue is adjusted based on the queue depth adjustment operation; the preset queue depth adjustment function is an adjustment function constructed based on the preset queue depth adjustment factor;

[0019] Determine whether the total queue occupancy rate is within the queue number adjustment threshold range; the queue depth adjustment threshold range is less than the second preset minimum occupancy rate threshold or greater than the second preset maximum occupancy rate threshold.

[0020] If the current queue occupancy rate is within the queue number adjustment threshold range, the queue number adjustment operation is determined based on the preset queue number adjustment function, and the adjustment is performed based on the real-time queue number in the NVMe queue. The preset queue number adjustment function is an adjustment function constructed based on the preset queue number adjustment factor.

[0021] Optionally, a queue depth adjustment operation is determined based on a preset queue depth adjustment function, and the current queue depth of the second target queue is adjusted based on the queue depth adjustment operation, including:

[0022] If the current queue occupancy rate corresponding to the second target queue is greater than the first preset maximum occupancy rate threshold, then the queue depth is increased based on the preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth.

[0023] Determine whether the sum of the increased queue depth and the real-time queue depth is greater than the first preset queue depth;

[0024] If the sum of depths is greater than or equal to the first preset queue depth, then the current queue depth corresponding to the second target queue is increased to the first preset queue depth.

[0025] If the sum of the depths is less than the first preset queue depth, then the current queue depth corresponding to the second target queue is increased based on the queue depth increase operation;

[0026] If the current queue occupancy rate corresponding to the second target queue is less than the first preset minimum occupancy rate threshold, then the queue reduction depth is determined based on the preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth.

[0027] Determine whether the difference between the real-time queue depth and the queue reduction depth is less than the second preset queue depth;

[0028] If the depth difference is less than or equal to the second preset queue depth, then the current queue depth corresponding to the second target queue will be reduced to the second preset queue depth.

[0029] If the sum of the depths is greater than the second preset queue depth, then the current queue depth corresponding to the second target queue is reduced based on the increased queue depth.

[0030] Optionally, the queue number adjustment operation is determined based on a preset queue number adjustment function, and the adjustment is performed based on the real-time queue number in the NVMe queue during the queue number adjustment operation, including:

[0031] If the total queue occupancy rate of the NVMe queue is greater than the second preset maximum occupancy rate threshold, the number of queues to be added is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number.

[0032] Determine whether the sum of the number of queue additions and the real-time queue count is greater than the first preset queue count;

[0033] If the sum of the quantities is greater than or equal to the first preset queue quantity, then the current queue quantity of the NVMe queue will be increased to the first preset queue quantity.

[0034] If the sum of the quantities is less than the first preset queue quantity, then the current queue quantity of the NVMe queue will be increased based on the queue increase quantity.

[0035] If the total queue occupancy rate of the NVMe queue is less than the second preset minimum occupancy rate threshold, the number of queues to be reduced is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number.

[0036] Determine whether the difference between the real-time queue count and the number of queue reductions is less than the second preset queue count;

[0037] If the difference in quantity is less than or equal to the first preset queue quantity, then the current queue quantity of the NVMe queue will be reduced to the second preset queue quantity;

[0038] If the difference in quantity is greater than the second preset queue quantity, then the current queue quantity of the NVMe queue will be reduced based on the queue reduction quantity.

[0039] Optionally, after adjusting the real-time queue depth and number of real-time queues in the NVMe queue based on the target queue adjustment method, the method further includes:

[0040] Resources are reallocated to unprocessed commands in each queue based on the adjusted real-time queue depth and number of real-time queues.

[0041] Secondly, this application discloses a storage queue adjustment device, comprising:

[0042] The system status determination module is used to monitor the NVMe queue and analyze the current queue usage of the NVMe queue based on a preset queue occupancy analysis method to determine the current resource storage load status.

[0043] The target determination module is used to generate the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status.

[0044] The queue adjustment module is used to adjust the real-time queue depth and number of real-time queues in the NVMe queue based on the target queue adjustment method, so as to perform resource storage based on the adjusted real-time queue depth and number of real-time queues.

[0045] Thirdly, this application discloses an electronic device, comprising:

[0046] Memory, used to store computer programs;

[0047] A processor is used to execute computer programs to implement the aforementioned storage queue adjustment method.

[0048] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned storage queue adjustment method.

[0049] As can be seen, in this application, the NVMe queue is monitored, and the current queue usage of the NVMe queue is analyzed based on a preset queue occupancy analysis method to determine the current resource storage load status; a target queue adjustment method is generated for the NVMe queue based on a preset queue adjustment method and the current resource storage load status; and the real-time queue depth and real-time queue number in the NVMe queue are adjusted based on the target queue adjustment method so that resource storage can be performed based on the adjusted real-time queue depth and real-time queue number.

[0050] In this way, by monitoring the NVMe queues and obtaining the current resource storage load status of the system, the depth and number of queues in the NVMe queues can be dynamically adjusted according to the current resource storage load status. This allows for changes in the storage location and storage capacity of the current system, thereby enabling control over the data traffic of the storage system, optimizing the system's storage performance, and ultimately improving the system's resource utilization. Attached Figure Description

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

[0052] Figure 1 This is a schematic diagram of a storage system;

[0053] Figure 2 This is a schematic diagram of another storage system;

[0054] Figure 3 This is a flowchart of a storage queue adjustment method disclosed in this invention;

[0055] Figure 4 This is a schematic diagram of a storage queue adjustment device disclosed in this invention;

[0056] Figure 5 This is a structural diagram of an electronic device disclosed in this invention. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0058] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.

[0059] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] like Figure 2 As shown, in traditional NVMe systems, queue depth and number are set during initialization and cannot be dynamically adjusted, failing to adapt to load changes. Under high load, a fixed number of queues can lead to I / O request backlog and increased latency. Under low load, excessive queues consume system resources, resulting in low resource utilization. In modern storage systems, RAID (Redundant Arrays of Independent Disks) controllers are widely used to improve data storage performance and reliability. RAID controllers manage read and write operations across multiple disks, achieving data redundancy and performance optimization. However, traditional RAID controllers typically statically allocate a fixed number and depth of I / O queues to each NVMe disk connected to the controller, failing to adapt to load changes. For example, when RAID group #0 (3 disks) receives excessive host I / O load, while RAID group #1 (2 disks) receives no host I / O, the fixed number and depth of I / O queues in each group of RAID group #0 have limited processing capacity, while the idle I / O queues in each group of RAID group #0 occupy a large amount of resources, leading to performance bottlenecks or resource waste. Therefore, this application will specifically introduce a storage queue adjustment method, which can avoid performance bottlenecks or resource waste by adjusting the queue.

[0061] See Figure 3 As shown in the figure, this application discloses a storage queue adjustment method, including:

[0062] Step S11: Monitor the NVMe queue and analyze the current queue usage of the NVMe queue based on the preset queue occupancy analysis method to determine the current resource storage load status.

[0063] In this embodiment, the NVMe queue is monitored in real time, and its usage is analyzed to obtain the current resource storage load status. Specifically, the current queue usage of the NVMe queue is analyzed based on a preset queue occupancy analysis method, including: obtaining the real-time queue depth and current packet count of each queue in the NVMe queue; the current packet count is the number of unprocessed commands in each queue; and determining the current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queue based on the real-time queue depth and the current packet count. Here, the current queue occupancy rate represents the individual queue usage of each queue within the NVMe queue, while the total queue occupancy rate represents the queue usage of the entire NVMe queue. Specifically, for the individual queue usage of each queue, the current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queue are determined based on the real-time queue depth and the current packet count, including: determining the current queue occupancy rate of each queue based on the percentage values ​​of the real-time queue depth and the current packet count. The formula is as follows: Queue Occupancy Rate It can be calculated using the following formula:

[0064] ;

[0065] That is, the current queue occupancy rate is determined based on the percentage of the number of unprocessed commands in the current queue and the queue depth. For example, if the number of unprocessed commands in the current queue is 80 and the queue depth is 100, then the queue occupancy rate is 80%.

[0066] There are two methods for determining the queue usage of the entire NVMe queue. In one specific embodiment, the total queue depth and total number of packets in the NVMe queue are determined based on the real-time queue depth and the current number of packets, respectively; and the total queue occupancy rate of the NVMe queue is determined based on the percentage values ​​of the total queue depth and the total number of packets. That is, the overall load is calculated by accumulating the real-time status of all queues in the NVMe queue. Specifically, the controller periodically samples two key metrics for each I / O queue: real-time queue depth and the current number of packets (the number of unprocessed commands in the queue). Then, the system adds up the real-time queue depth values ​​of all queues to obtain the total queue depth; similarly, it adds up the current number of packets of all queues to obtain the total number of packets. Finally, the total queue occupancy rate of the NVMe queue is calculated by the formula (total number of packets / total queue depth) × 100%. Assume that an NVMe SSD controller manages 4 I / O queues. At a certain sampling moment, the states of each queue are as follows: Queue 1: Message count = 8, queue depth = 32; Queue 2: Message count = 12, queue depth = 32; Queue 3: Message count = 4, queue depth = 32; Queue 4: Message count = 16, queue depth = 32. At this time, the total number of messages = 8 + 12 + 4 + 16 = 40, and the total queue depth = 32 × 4 = 128. Therefore, the total queue occupancy rate = (40 / 128) × 100% = 31.25%. The method provided in this embodiment achieves overall load assessment at a macro level. Due to its simple calculation and minimal overhead, it can quickly yield a value reflecting the global average utilization rate, making it suitable for scenarios involving rough monitoring and trend judgment of system load.

[0067] In another specific embodiment, queues with a current queue occupancy rate greater than a first preset data threshold are identified as first target queues. The total queue occupancy rate of the NVMe queues is determined based on the percentage between the number of target queues in the first target queues and the real-time number of NVMe queues. That is, the overall load status is assessed by identifying the proportion of busy queues, focusing more on the "quality" rather than the "quantity" of load distribution. The specific process is as follows: obtain the current queue occupancy rate. Then, set a first preset data threshold (e.g., 70%), and mark all queues with a current queue occupancy rate exceeding this threshold as first target queues (i.e., busy queues). Finally, the total queue occupancy rate of the NVMe queues is determined by the formula (number of first target queues / total number of real-time NVMe queues) × 100%. Based on the above example, and assuming the first preset data threshold is 70%, the occupancy rates of each queue are as follows: Queue 1: 8 / 32 = 25%; Queue 2: 12 / 32 = 37.5%; Queue 3: 4 / 32 = 12.5%; Queue 4: 16 / 32 = 50%. Although queue 4 has the highest load (50%), the occupancy rate of all queues has not exceeded the 70% threshold. Therefore, the number of the first target queue is 0. The total queue occupancy rate = (0 / 4) × 100% = 0%. This result indicates that no queue is currently at risk of overload. Assuming another scenario, if the number of packets in queue 4 surges to 24, its occupancy rate will be 24 / 32 = 75%, exceeding the 70% threshold. In this case, the number of the first target queue is 1 (i.e., queue 4). The total queue occupancy rate = (1 / 4) × 100% = 25%. This 25% means that 25% of the queues are already busy. The method provided in this embodiment can effectively provide insight into potential system bottlenecks and load balancing. Its technical advantage lies in its ability to sensitively detect local hotspots and uneven load distribution. Even if the overall average load is not high, it can promptly alert if any queue is overloaded. This is highly beneficial for preventing performance bottlenecks in advance and for intelligent queue resource scheduling and reallocation (e.g., prioritizing new requests to idle queues during subsequent resource allocation).

[0068] Step S12: Generate the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status.

[0069] In this embodiment, after obtaining the current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queues, the queues can be adjusted based on the obtained occupancy rate results. Specifically, when the total queue occupancy rate exceeds a preset upper threshold, the system automatically increases the number of queues to distribute the load and improve processing capacity. When the total queue occupancy rate is lower than a preset lower threshold, the system reduces the number of queues to release excess resources and improve resource utilization. When the current queue occupancy rate exceeds a preset upper threshold, the system automatically increases the queue depth of that queue to improve processing capacity. When the current queue occupancy rate is lower than a preset lower threshold, the system automatically reduces the queue depth of that queue to improve resource utilization.

[0070] Step S13: Adjust the real-time queue depth and number of real-time queues in the NVMe queue based on the target queue adjustment method, so as to store resources based on the adjusted real-time queue depth and number of real-time queues.

[0071] In this embodiment, a target queue adjustment method is generated based on a preset queue adjustment method and the current resource storage load status. The real-time queue depth and number of real-time queues in the NVMe queue are adjusted based on the target queue adjustment method, including: determining queues in the NVMe queue whose current queue occupancy rate is within the queue depth adjustment threshold range as second target queues; the queue depth adjustment threshold range is less than a first preset minimum occupancy rate threshold or greater than a first preset maximum occupancy rate threshold; determining a queue depth adjustment operation based on a preset queue depth adjustment function, and adjusting the current queue depth of the second target queue based on the queue depth adjustment operation; the preset queue depth adjustment function is an adjustment function constructed based on a preset queue depth adjustment factor; determining whether the total queue occupancy rate is within the queue number adjustment threshold range; the queue depth adjustment threshold range is less than a second preset minimum occupancy rate threshold or greater than a second preset maximum occupancy rate threshold; if the current queue occupancy rate is within the queue number adjustment threshold range, determining a queue number adjustment operation based on a preset queue number adjustment function, and adjusting the number of real-time queues in the NVMe queue based on the queue number adjustment operation; the preset queue number adjustment function is an adjustment function constructed based on a preset queue number adjustment factor.

[0072] Specifically, when adjusting the queue depth of a single queue, the queue depth adjustment operation is determined based on a preset queue depth adjustment function, and the current queue depth of the second target queue is adjusted based on the queue depth adjustment operation. This includes: if the current queue occupancy rate corresponding to the second target queue is greater than a first preset maximum occupancy rate threshold, then the queue depth is increased based on a preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth; it is determined whether the sum of the increased queue depth and the real-time queue depth is greater than a first preset queue depth; if the sum of the sums ... If the current queue depth is increased based on the queue depth increase function, then the current queue depth corresponding to the second target queue is increased. If the current queue occupancy rate corresponding to the second target queue is less than the first preset minimum occupancy rate threshold, then the queue depth is reduced based on the preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth. It is then determined whether the difference between the real-time queue depth and the queue reduction depth is less than the second preset queue depth. If the difference is less than or equal to the second preset queue depth, then the current queue depth corresponding to the second target queue is reduced to the second preset queue depth. If the difference is greater than the second preset queue depth, then the current queue depth corresponding to the second target queue is reduced based on the queue depth increase function. The preset queue depth adjustment function is as follows:

[0073] ;

[0074] in, Let Qooc be the current queue occupancy rate, D be the real-time queue depth, Qmax be the first preset maximum occupancy rate threshold, Qmin be the first preset minimum occupancy rate threshold, and Dnew be the adjusted real-time queue depth. For example, if the current queue occupancy rate is 80%, the first preset maximum occupancy rate threshold is 90%, the first preset minimum occupancy rate threshold is 30%, and the real-time queue depth is 128, then the current queue occupancy rate is less than the first preset maximum occupancy rate threshold but greater than the first preset minimum occupancy rate threshold, so no queue adjustment is needed. When the real-time queue depth changes to 95%, the current queue occupancy rate is greater than the first preset maximum occupancy rate threshold, requiring a change in queue depth. Using the preset queue depth adjustment function, the changed real-time queue depth is: 128 + 0.1 × 128 = 128 + 12.8 = 40.8 ≈ 141. Further judgment is then required. The updated real-time queue depth is compared with the first preset queue depth. If the first preset queue depth is 130, and the updated real-time queue depth is greater than the first preset queue depth, then the updated real-time queue depth is set to 130. If the first preset queue depth is 160, and the updated real-time queue depth is less than the first preset queue depth, then the updated real-time queue depth is set to 141.

[0075] Specifically, when adjusting the queue length of the entire NVMe queue, the queue number adjustment operation is determined based on a preset queue number adjustment function, and the adjustment is performed based on the real-time queue number in the NVMe queue. This includes: if the total queue occupancy rate of the NVMe queue is greater than a second preset maximum occupancy rate threshold, then the number of queues to be increased is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number; it is then determined whether the sum of the increased queue number and the real-time queue number is greater than a first preset queue number; if the sum is greater than or equal to the first preset queue number, then the current queue number of the NVMe queue is increased to the first preset queue number; if the sum is less than... If the first preset queue number is used, the current queue number of the NVMe queue is increased based on the queue increase amount. If the total queue occupancy rate of the NVMe queue is less than the second preset minimum occupancy rate threshold, the queue reduction amount is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number. It is then checked whether the difference between the real-time queue number and the queue reduction amount is less than the second preset queue number. If the difference is less than or equal to the first preset queue number, the current queue number of the NVMe queue is reduced to the second preset queue number. If the difference is greater than the second preset queue number, the current queue number of the NVMe queue is reduced based on the queue reduction amount. The preset queue number adjustment function is as follows:

[0076] ;

[0077] in, The preset queue depth adjustment factor (used to control the magnitude of depth adjustment, for example, 0.1 means 10% adjustment each time), Pooc is the total queue occupancy rate; P is the current queue number; Nmax is the second preset maximum occupancy rate threshold; Nmin is the second preset minimum occupancy rate threshold; and Pnew is the adjusted current queue number.

[0078] In summary, by dynamically adjusting the depth and number of NVMe queues, traffic control of the storage system is achieved, optimizing system performance and resource utilization. It should be noted that in actual operation, queue adjustments can be selectively made based on the actual situation. For example, the number of queues can be fixed first, and queue depth adjustments can be prioritized. In this embodiment, after adjusting the real-time queue depth and number of NVMe queues based on the target queue adjustment method, the method further includes: reallocating resources for unprocessed commands in each queue based on the adjusted real-time queue depth and number. Specifically, load balancing metrics can be calculated by collecting the depth and number of unprocessed commands for each queue and combining them with currently available resources. Subsequently, the proportion of computing resources allocated to each queue is determined according to a preset priority strategy and queue weight. Then, the resource pool allocation is dynamically adjusted. During the adjustment process, the queue status needs to be continuously monitored, and the queue status is dynamically adjusted according to the queue status. Finally, the resource adjustment parameters and effects are recorded to provide data for subsequent strategy optimization. In this way, not only is the queue status adjusted, but resources are also redistributed accordingly, further improving the performance and resource utilization of the NVMe storage system.

[0079] As can be seen, in this embodiment, the NVMe queue is monitored, and the current queue usage is analyzed based on a preset queue occupancy analysis method to determine the current resource storage load status. A target queue adjustment method is generated for the NVMe queue based on a preset queue adjustment method and the current resource storage load status. The real-time queue depth and number of queues in the NVMe queue are adjusted based on the target queue adjustment method to optimize resource storage based on the adjusted real-time queue depth and number. In this way, by monitoring the NVMe queue and obtaining the current resource storage load status of the system, and dynamically adjusting the queue depth and number of queues in the NVMe queue according to the current resource storage load status, the storage location and storage capacity of the current system can be changed, thereby controlling the data traffic of the storage system, optimizing the system's storage performance, and ultimately improving the system's resource utilization.

[0080] refer to Figure 4This application also discloses a storage queue adjustment device, comprising:

[0081] The system status determination module 11 is used to monitor the NVMe queue and analyze the current queue usage of the NVMe queue based on a preset queue occupancy analysis method to determine the current resource storage load status.

[0082] The target determination module 12 is used to generate the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status.

[0083] The queue adjustment module 13 is used to adjust the real-time queue depth and the number of real-time queues in the NVMe queue based on the target queue adjustment method, so as to perform resource storage based on the adjusted real-time queue depth and the number of real-time queues.

[0084] As can be seen, in this embodiment, by monitoring the NVMe queue, the current resource storage load status of the system can be obtained, and the queue depth and number in the NVMe queue can be dynamically adjusted according to the current resource storage load status. This can change the storage location and storage capacity of the current system, thereby controlling the data traffic of the storage system, optimizing the storage performance of the system, and improving the resource utilization of the system.

[0085] Furthermore, embodiments of this application also disclose an electronic device, Figure 5 This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the storage queue adjustment method disclosed in any of the foregoing embodiments. Furthermore, the electronic device in this embodiment may specifically be an electronic computer.

[0086] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0087] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0088] The operating system 221 is used to manage and control the various hardware devices on the electronic device and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the storage queue adjustment method executed by the electronic device as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0089] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned storage queue adjustment method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0090] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, they implement the aforementioned disclosed alarm aggregation method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0091] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0092] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0093] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0094] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0095] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for adjusting a storage queue, characterized in that, include: The NVMe queue is monitored, and the current queue usage of the NVMe queue is analyzed based on a preset queue occupancy analysis method to determine the current resource storage load status. Generate the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status; The target queue adjustment method is used to adjust the real-time queue depth and the number of real-time queues in the NVMe queue, so that resource storage can be performed based on the adjusted real-time queue depth and the number of real-time queues.

2. The storage queue adjustment method according to claim 1, characterized in that, The analysis of the current queue usage of the NVMe queue based on the preset queue occupancy analysis method includes: Obtain the real-time queue depth and current packet count of each queue in the NVMe queue; the current packet count is the number of unprocessed commands in each queue. The current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queues are determined based on the real-time queue depth and the current number of packets.

3. The storage queue adjustment method according to claim 2, characterized in that, The process of determining the current queue occupancy rate of each queue and the total queue occupancy rate of the NVMe queues based on the real-time queue depth and the current packet count includes: The current queue occupancy rate of each queue is determined based on the percentage value of the real-time queue depth and the current number of packets; The total queue depth and total number of packets in the NVMe queue are determined based on the real-time queue depth and the current number of packets, respectively; and the total queue occupancy rate of the NVMe queue is determined based on the percentage values ​​of the total queue depth and the total number of packets. Alternatively, the queues whose current queue occupancy rate is greater than a first preset data threshold are identified as the first target queues, and the total queue occupancy rate of the NVMe queues is determined based on the percentage between the number of target queues in the first target queues and the real-time queue count of the NVMe queues.

4. The storage queue adjustment method according to claim 2, characterized in that, The method for generating the target queue adjustment method corresponding to the NVMe queue based on the preset queue adjustment method and the current resource storage load status; The target queue adjustment method is used to adjust the real-time queue depth and the number of real-time queues in the NVMe queue, including: The queues in the NVMe queue whose current queue occupancy rate is within the queue depth adjustment threshold range are identified as the second target queues; the queue depth adjustment threshold range is less than the first preset minimum occupancy rate threshold or greater than the first preset maximum occupancy rate threshold. The queue depth adjustment operation is determined based on a preset queue depth adjustment function, and the current queue depth of the second target queue is adjusted based on the queue depth adjustment operation; the preset queue depth adjustment function is an adjustment function constructed based on a preset queue depth adjustment factor; Determine whether the total queue occupancy rate is within the queue number adjustment threshold range; the queue depth adjustment threshold range is less than the second preset minimum occupancy rate threshold or greater than the second preset maximum occupancy rate threshold. If the current queue occupancy rate is within the queue number adjustment threshold range, then the queue number adjustment operation is determined based on the preset queue number adjustment function, and the adjustment is performed based on the real-time queue number in the NVMe queue when the queue number adjustment operation is performed; the preset queue number adjustment function is an adjustment function constructed based on the preset queue number adjustment factor.

5. The storage queue adjustment method according to claim 4, characterized in that, The step of determining the queue depth adjustment operation based on a preset queue depth adjustment function, and adjusting the current queue depth of the second target queue based on the queue depth adjustment operation, includes: If the current queue occupancy rate corresponding to the second target queue is greater than the first preset maximum occupancy rate threshold, then the queue depth is increased based on the preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth. Determine whether the sum of the increased queue depth and the real-time queue depth is greater than a first preset queue depth; If the sum of the depths is greater than or equal to the first preset queue depth, then the current queue depth corresponding to the second target queue is increased to the first preset queue depth; If the sum of the depths is less than the first preset queue depth, then the current queue depth corresponding to the second target queue is increased based on the queue depth increase operation; If the current queue occupancy rate corresponding to the second target queue is less than the first preset minimum occupancy rate threshold, then the queue reduction depth is determined based on the preset queue depth adjustment factor in the preset queue depth adjustment function and the real-time queue depth. Determine whether the depth difference between the real-time queue depth and the queue reduction depth is less than the second preset queue depth; If the depth difference is less than or equal to the second preset queue depth, then the current queue depth corresponding to the second target queue is reduced to the second preset queue depth; If the sum of the depths is greater than the second preset queue depth, then the current queue depth corresponding to the second target queue is reduced based on the increased queue depth.

6. The storage queue adjustment method according to claim 4, characterized in that, The step of determining the queue number adjustment operation based on a preset queue number adjustment function, and adjusting the real-time queue number in the NVMe queue based on the queue number adjustment operation, includes: If the total queue occupancy rate of the NVMe queue is greater than the second preset maximum occupancy rate threshold, then the number of queues to be added is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number; Determine whether the sum of the number of queue increases and the number of real-time queues is greater than the first preset queue number; If the sum of the quantities is greater than or equal to the first preset queue quantity, then the current queue quantity of the NVMe queue is increased to the first preset queue quantity; If the sum of the quantities is less than the first preset queue quantity, then the current queue quantity of the NVMe queue is increased based on the queue increase quantity. If the total queue occupancy rate of the NVMe queue is less than the second preset minimum occupancy rate threshold, then the number of queues to be reduced is determined based on the preset queue number adjustment factor in the preset queue number adjustment function and the current queue number. Determine whether the difference between the real-time queue count and the number of queues reduced is less than the second preset queue count; If the difference in quantity is less than or equal to the first preset queue number, then the current queue number of the NVMe queue is reduced to the second preset queue number; If the difference in quantity is greater than the second preset queue quantity, then the current queue quantity of the NVMe queue is reduced based on the queue reduction quantity.

7. The storage queue adjustment method according to any one of claims 2 to 6, characterized in that, After adjusting the real-time queue depth and number of real-time queues in the NVMe queue based on the target queue adjustment method, the method further includes: Based on the adjusted real-time queue depth and the number of real-time queues, resources are reallocated for unprocessed commands in each queue.

8. A storage queue adjustment device, characterized in that, include: The system status determination module is used to monitor the NVMe queue and analyze the current queue usage of the NVMe queue based on a preset queue occupancy analysis method to determine the current resource storage load status. The target determination module is used to generate a target queue adjustment method corresponding to the NVMe queue based on a preset queue adjustment method and the current resource storage load status. The queue adjustment module is used to adjust the real-time queue depth and the number of real-time queues in the NVMe queue based on the target queue adjustment method, so as to perform resource storage based on the adjusted real-time queue depth and the number of real-time queues.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the storage queue adjustment method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the storage queue adjustment method as described in any one of claims 1 to 7.