A VF dynamic scheduling method and device based on a solid state disk and a medium
Patent Information
- Application Number
- CN202310637670.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-05-31
AI Technical Summary
当两个以上虚拟机的VF盘在运行业务时,占用的带宽会互相抢占,如当前时刻只有单个VF运行业务,则该VF占用的是总带宽,但是当其他VF也在运行时会抢占当前单个VF的带宽,导致业务的带宽利用出现较大的波动;另外,多个VF运行不同的业务,其中某一个VF盘在切换业务时,如果由随机写业务切换至随机读业务,其随机读业务对应填充的命令还是沿用前一个随机写业务的速度获取命令,导致该VF盘的命令处理延时较长,命令释放延时也随之变长,导致长时间占用资源,从而随机读业务的带宽无法跟上原有的随机读业务的带宽,影响随机读业务
[0068]本发明提供的一种基于固态硬盘的VF动态调度方法,该方法基于硬件资源和软件资源两部分保证命令和物理资源保持动态平衡,在硬件资源方面将总带宽、队列深度、IOPS、RAB和命名空间的总容量进行绑定。在将VF的带宽和IOPS与容量绑定时,以确保每个VF运行业务时拥有自己的带宽和IOPS;将VF的队列深度和容量绑定,使得虚拟机下发的命令个数进行了限制,不影响其他虚拟机;根据命名空间总容量确定每个VF的RAB,避免业务压力大时及时调整RAB导致的带宽或者IOPS不足,达到运行业务时各VF之间互不影响。在软件方面分别根据调度信用值和NS个数完成调度过程中的NS调度和下刷过程中的下刷快慢,调度信用值由带宽和IOPS决定,保证带宽资源充裕,使得虚拟机上运行的服务质量得到保障。
Smart Images

Figure CN116627339B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer virtualization technology, and in particular to a VF dynamic scheduling method, apparatus and medium based on solid-state drives. Background Technology
[0002] To improve the utilization of single-disk storage capacity and reduce operating costs, supporting multiple directly connected virtual machines on a single disk has become a common usage pattern, but it also poses challenges to the development of storage technology and service quality. With the technological development and iteration of storage interfaces, solid-state drives (SSDs) provide Single Root I / O Virtualization (SR-IOV) features, supporting the virtualization of a single SSD's physical function (PF) disk into multiple virtual function (VF) disks.
[0003] Within a virtual machine, a Virtual Functions (VF) disk can be considered an independent SSD. However, the use of VF disk resources among multiple virtual machines is competitive. When two or more VF disks are running services, they compete for bandwidth. If only a single VF is running a service at any given time, it uses the total bandwidth. However, when other VFs are also running, they will compete for the bandwidth of the current single VF, causing significant fluctuations in bandwidth utilization. Furthermore, when multiple VFs are running different services, if one VF switches services from random write to random read, the random read command still uses the speed of the previous random write command, resulting in longer command processing and release delays. This leads to prolonged resource occupation, causing the random read bandwidth to lag behind, impacting the random read service. In summary, the performance of multiple VFs running services in both of these scenarios interferes with each other, resulting in a lack of guaranteed service quality.
[0004] Therefore, how to avoid interference between multiple operating services in order to ensure service quality is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a VF dynamic scheduling method, device and medium based on solid-state drives to ensure that commands and physical resources maintain a dynamic balance.
[0006] To address the aforementioned technical problems, this invention provides a VF dynamic scheduling method based on a solid-state drive, comprising:
[0007] The total bandwidth, total namespace capacity, and number of VF disks of the solid-state drive are obtained in advance, wherein the number of VF disks and the number of namespaces are the same, and the VF disks and namespaces are bound one-to-one.
[0008] The hardware scheduling parameters corresponding to the hardware resources are determined based on the combination relationship between the total bandwidth, the total namespace capacity, and the number of VF disks. The hardware parameters include at least the namespace bandwidth threshold, the IOPS threshold, the NVME queue depth threshold, and the RAB value.
[0009] Obtain the number of namespaces of the currently running services of the solid-state drive and the current commands in the linked list, and determine the corresponding scheduling credit value based on the current commands, wherein the scheduling credit value is determined by the bandwidth threshold and the IOPS threshold;
[0010] The corresponding scheduling strategies are determined based on the scheduling credit value and the number of namespaces of the currently running services to complete the scheduling of software resources.
[0011] Preferably, determining the namespace bandwidth threshold based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks includes:
[0012] Obtain the current namespace capacity value of the solid-state drive;
[0013] The bandwidth value of each namespace is obtained by binding the total bandwidth and the total capacity of the namespace.
[0014] The namespace bandwidth threshold is determined based on the relationship between the current namespace capacity value and the bandwidth value.
[0015] Correspondingly, the IOPS threshold is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including:
[0016] Get the bandwidth value for each I / O;
[0017] The IOPS threshold is determined based on the relationship between the bandwidth value of each IO and the namespace bandwidth threshold.
[0018] Preferably, determining the critical value of the NVME queue depth based on the relationship between the total capacity of the namespace and the number of VF disks includes:
[0019] The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks;
[0020] The critical value for the number of commands in the IO queue to which each VF belongs is determined based on the relationship between the capacity ratio of each VF and the preset critical range. The preset critical range specifies the range of the capacity ratio of the VF and has a mapping relationship with the critical value for the number of commands in the IO queue.
[0021] The threshold value for the number of commands in the IO queue is used as the threshold value for the depth of the NVME queue.
[0022] Preferably, the RAB value is related to the physical disk state of the current command. When the physical disk state is FOB, the RAB value is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including:
[0023] The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks;
[0024] The RAB critical value of each VF is determined based on the relationship between the capacity ratio of each VF and the critical threshold range, wherein the critical threshold range defines the range of the VF capacity ratio and has a mapping relationship with the RAB critical value.
[0025] Preferably, the RAB value is related to the physical disk state of the current command. When the physical disk state is SS state, the RAB value is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including:
[0026] Obtain the target service currently running in the VF, the service parameters corresponding to the target service, and the current RAB value. The service parameters include at least one or more of the service type and / or the current IOPS value. The service type is determined by the current IOPS value. The current IOPS value is less than the IOPS threshold and is determined by the current namespace bandwidth value. The IOPS threshold is determined by the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks.
[0027] The RAB value adjustment strategy for the target service is determined based on the service parameters corresponding to the target service.
[0028] The RAB value is obtained by adjusting the current RAB value of the target service according to the RAB value adjustment strategy.
[0029] Preferably, when the service parameter of the target service is the service type, the RAB value adjustment strategy of the target service is determined according to the service type, including:
[0030] Obtain the service type of the target service and the current RAB value under each VF, wherein the service type includes at least one of random read service and random write service, and the random read service is determined by the number of random read commands per unit time;
[0031] When the service type is the random read service, a preset RAB value is added to the current RAB value as the RAB value adjustment strategy corresponding to the target service.
[0032] The preset RAB value is reduced based on the current RAB value of other services as a strategy for adjusting the RAB value of those other services.
[0033] Preferably, when the service parameter of the target service is the current IOPS value, determining the RAB value adjustment strategy for the target service based on the service type includes:
[0034] Obtain the current IOPS value;
[0035] Determine whether the current IOPS value of the target service is greater than a preset IOPS value;
[0036] If so, then obtain the current RAB value corresponding to the target service;
[0037] A preset RAB value is added to the current RAB value to serve as the RAB value adjustment strategy for the target service.
[0038] The preset RAB value is reduced based on the current RAB value of other services as a strategy for adjusting the RAB value of those other services.
[0039] Preferably, when the target service changes, after adjusting the current RAB value of the current VF according to the RAB value adjustment strategy, the method further includes:
[0040] Restore the adjusted RAB value to the current RAB value.
[0041] Preferably, determining the corresponding scheduling credit value based on the current command includes:
[0042] Obtain the current physical disk state of the current command, wherein the current physical disk state is either FOB state or SS state;
[0043] The scheduling credit value is determined based on the current command and the current physical disk status, wherein the scheduling credit value is determined by the bandwidth value corresponding to the FOB state or by the IOPS value corresponding to the SS state.
[0044] Preferably, determining the corresponding scheduling strategy based on the scheduling credit value includes:
[0045] Obtain the scheduling credit value of the current command and the preset scheduling credit value within a preset time period, wherein the current command is stored in a singly linked list;
[0046] Within the preset time period, determine whether the scheduling credit value is not greater than the preset scheduling credit value;
[0047] If so, then execute the current command;
[0048] If not, the remaining scheduling credit value of the current command is determined based on the relationship between the scheduling credit value and the preset scheduling credit value.
[0049] The current command corresponding to the remaining scheduling credit value is stored in the linked list to complete the scheduling so that it can be executed at the next preset time.
[0050] Preferably, the corresponding scheduling strategy is determined based on the number of namespaces of the currently running services, including:
[0051] Get the number of namespaces of the currently running service;
[0052] Determine whether the number of namespaces of the currently running service exceeds a first threshold;
[0053] If so, obtain the current data refresh rate of the currently running service, and increase the preset rate on the basis of the current rate to speed up the data refresh rate of the currently running service in order to complete the scheduling strategy.
[0054] Preferably, the corresponding scheduling strategy is determined based on the number of namespaces of the currently running services, including:
[0055] Obtain the number of commands corresponding to the number of namespaces of the currently running service;
[0056] Determine whether the number of commands exceeds the standard value for data volume;
[0057] If the number of commands exceeds the data volume standard value, then it is determined whether the number of namespaces of the currently running service containing the number of commands exceeds the second threshold.
[0058] If the number of namespaces of the currently running service containing the number of commands exceeds the second threshold, then the number of names in the namespace is reduced by a preset number based on the standard data volume value to lower the standard data volume and complete the scheduling strategy. The standard data volume value is inversely proportional to the number of commands.
[0059] To address the aforementioned technical problems, the present invention also provides a VF dynamic scheduling device based on a solid-state drive, comprising:
[0060] The first acquisition module is used to pre-acquire the total bandwidth, total namespace capacity and number of VF disks of the solid-state drive, wherein the number of VF disks and the number of namespaces are the same, and the VF disks and namespaces are bound one-to-one.
[0061] The hardware scheduling module is used to determine the hardware scheduling parameters corresponding to the hardware resources based on the combination relationship between the total bandwidth, the total capacity of the namespace, and the number of VF disks. The hardware parameters include at least the namespace bandwidth threshold, the IOPS threshold, the NVME queue depth threshold, and the RAB value.
[0062] The first determining module is used to obtain the number of namespaces of the currently running services of the solid-state drive and the current commands in the linked list, and to determine the corresponding scheduling credit value based on the current commands, wherein the scheduling credit value is determined by the bandwidth threshold and the IOPS threshold;
[0063] The software scheduling module is used to determine the corresponding scheduling strategy based on the scheduling credit value and the number of namespaces of the currently running service to complete the scheduling of software resources.
[0064] To address the aforementioned technical problems, the present invention also provides a VF dynamic scheduling device based on a solid-state drive, comprising:
[0065] Memory, used to store computer programs;
[0066] A processor, used to implement the steps of the VF dynamic scheduling method based on a solid-state drive as described above when executing the computer program.
[0067] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the VF dynamic scheduling method based on a solid-state drive as described above.
[0068] This invention provides a VF dynamic scheduling method based on solid-state drives (SSDs). This method ensures a dynamic balance between commands and physical resources by combining hardware and software resources. On the hardware side, it binds total bandwidth, queue depth, IOPS, RAB (Random Access Buffer), and the total capacity of the namespace. Binding VF bandwidth and IOPS to capacity ensures that each VF has its own bandwidth and IOPS when running services. Binding VF queue depth and capacity limits the number of commands issued by virtual machines, preventing impact on other virtual machines. The RAB for each VF is determined based on the total namespace capacity, avoiding bandwidth or IOPS shortages caused by timely RAB adjustments during periods of high service load, ensuring that VFs do not interfere with each other when running services. On the software side, NS scheduling during the scheduling process and the speed of flushing during the flushing process are handled based on the scheduling credit value and the number of NSs. The scheduling credit value is determined by bandwidth and IOPS, ensuring sufficient bandwidth resources and guaranteeing the quality of service running on virtual machines.
[0069] In addition, the present invention also provides a VF dynamic scheduling device and medium based on a solid-state drive, which has the same beneficial effects as the VF dynamic scheduling method based on a solid-state drive described above. Attached Figure Description
[0070] 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.
[0071] Figure 1 A flowchart illustrating a VF dynamic scheduling method based on a solid-state drive provided in an embodiment of the present invention;
[0072] Figure 2 This is a schematic diagram of a VF usage scenario provided by an embodiment of the present invention;
[0073] Figure 3 This is a schematic diagram of the structure of a command acquisition module provided in an embodiment of the present invention;
[0074] Figure 4 A flowchart of NS data scheduling is provided for an embodiment of the present invention;
[0075] Figure 5 A flowchart of another VF dynamic scheduling method based on solid-state drive provided in an embodiment of the present invention;
[0076] Figure 6 This is a schematic diagram of a VF dynamic scheduling structure based on a solid-state drive provided in an embodiment of the present invention;
[0077] Figure 7 This is a structural diagram of a VF dynamic scheduling device based on a solid-state drive provided in an embodiment of the present invention;
[0078] Figure 8 This is a structural diagram of another VF dynamic scheduling device based on a solid-state drive provided in an embodiment of the present invention. Detailed Implementation
[0079] 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.
[0080] The core of this invention is to provide a VF dynamic scheduling method, device and medium based on solid-state drives to ensure that commands and physical resources maintain a dynamic balance.
[0081] 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.
[0082] It's important to note that current storage devices primarily consist of hard disk drives (HDDs) and solid-state drives (SSDs). Compared to HDDs, SSDs offer higher read / write bandwidth and lower read / write latency. Furthermore, with the development and iteration of storage interface technologies, SSDs using the Peripheral Component Interconnect-Express (PCIe) interface offer the SR-IOV feature. This feature allows a single SSD's PF (Power Factor) disk to be virtualized into multiple VF (Virtual Function) disks, each with its own independent PCIe lane and direct host connection. The Non-Volatile Memory Express (NVME) interface protocol supports multiple weighted queues and namespaces, providing each virtual machine with an independent queue and logical command space, thus better supporting virtual machines. The implementation of VF disks directly relies on the SR-IOV and multi-namespace features, and the support for these features depends entirely on the physical implementation of the SSD controller. When a host machine supporting SR-IOV powers on, it can only recognize the PF disk. The PF disk's role is to support control over VF disks, such as creating and deleting namespaces (NS) and VFs, as well as binding VFs and NSs. The lifecycle of a Virtual Function (VF) disk begins with the creation of a Namespace and a Virtual Function (NS). After binding the VF and NS, the Virtual Function (PF) allocates the maximum available queue to the VF, then binds the virtual machine to the VF disk, and finally ends with the destruction of the virtual machine and the deletion of the NS. Within the virtual machine, the user perceives the VF as an independent SSD. Because multiple virtual machines compete for PF disk resources, performance interference can occur when two or more virtual machines are running services. Since SSD resources are limited, the demand on SSD resources from different business loads is unpredictable, leading to unpredictability in service and compromised service quality. This invention provides a dynamic VF scheduling method based on solid-state drives. It pre-binds the bandwidth and total namespace capacity of each VF to obtain its respective bandwidth. Input / Output Operations Per Second (IOPS), also known as throughput, is measured by the number of IO commands executed per unit time, and the Recommended Arbitration Burst commands (RAB) value ensures non-interference. The method dynamically adjusts the number of executed commands and the refresh rate within the software resources.
[0083] Figure 1 A flowchart of a VF dynamic scheduling method based on a solid-state drive provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes:
[0084] S11: Pre-obtain the total bandwidth, total namespace capacity, and number of VF disks for the solid-state drive;
[0085] The number of VF disks is the same as the number of NS disks, and the VF disks and NS disks are bound one-to-one.
[0086] Specifically, Figure 2 This is a schematic diagram of a VF usage scenario provided by an embodiment of the present invention, such as... Figure 2 As shown, the host machine creates NS spaces and VFs through the SSD, and the host that starts the virtual machine binds to the VF. The NS spaces bound to each VF can be seen in the virtual machine, and read and write operations on the NS or other management commands can be used to directly access the SSD controller.
[0087] Figure 3 This is a schematic diagram of the structure of a command acquisition module provided in an embodiment of the present invention, such as... Figure 3 As shown, the command fetching module, Fetcher, exists within the SSD controller. This module is specifically designed to retrieve commands from the command submission queue (SQ). Based on the RAB value set for each VF, it retrieves commands from the corresponding SQ for each VF. Typically, the SSD controller executes the commands retrieved directly. The final result is N VFs, with each VF occupying bandwidth equal to the total bandwidth divided by N. For the RAB value, the recommended maximum value for arbitration is the number of commands the NVMe controller retrieves from the SQ. Different NVMe controllers support different capabilities; some support a maximum of 4 (16 commands retrieved at once), while others support 3 (8 commands retrieved at once). The Fetcher module traverses the IO queues within all VFs, retrieving a certain number of commands and placing them in a resource pool for firmware to retrieve and execute. On the host side, if the service load on each VF is similar or not significantly different, each VF can be adjusted promptly, thus ensuring performance and quality. If the service pressure on the host corresponding to a VF suddenly increases, resulting in a large number of commands being sent to the SQ queue per unit time, but the current command retrieval module Fetcher still retrieves commands according to the previous ratio, this will cause command backlog, increase command processing latency, and consequently, the bandwidth will not be able to meet the increased service pressure, meaning the bandwidth will not be sufficient and the service quality will be affected.
[0088] An NVMe SSD system mainly consists of three parts: the SSD Controller, flash memory, and the PCIe interface. If the flash memory is divided into several independent logical spaces, each with a Logical Block Address (LBA) ranging from 0 to N-1 (where N is the size of the logical space), each logical space is called an NS. Each VF (Virtual File System) has its own dedicated NS; therefore, the number of VFs and the number of NSs are the same and have a one-to-one binding relationship. This invention binds the total capacity and total bandwidth of the NS to the number of VFs, dividing the system according to the total capacity. Therefore, it is necessary to pre-obtain the total bandwidth of the SSD, the total capacity of the NS, and the number of VFs.
[0089] S12: Determine the hardware scheduling parameters corresponding to the hardware resources based on the combination relationship between total bandwidth, total namespace capacity and number of VF disks;
[0090] The hardware parameters include at least the NS bandwidth threshold, IOPS threshold, NVME queue depth threshold, and RAB value.
[0091] The hardware scheduling parameters corresponding to the hardware resources are determined based on the combination relationships between the three types of data obtained in advance. These hardware scheduling parameters are mainly based on the current configuration parameters of the hardware resources, allocating the maximum NS bandwidth threshold, IOPS threshold, NVME queue depth threshold, and RAB value. The RAB value is the maximum number of commands that can be issued in a single transaction, and this value is related to the controller's capacity. This capacity parameter indicates the maximum number of commands the controller can retrieve from the SQ queue in a single transaction.
[0092] It should be noted that the hardware scheduling parameters are determined based on the combination of three types of data. The determination process for each hardware scheduling parameter is different. In this embodiment, the combination relationship means that different hardware scheduling parameters can be determined using any combination of two or three of these three types of data. For example, determining the NS bandwidth threshold requires three types of data, while determining the RAB value only requires a combination of two types of data. In this embodiment, NS bandwidth, IOPS, and total capacity are bound together, ensuring the bandwidth and IOPS values for the entire lifecycle before the user purchases the virtual machine. The queue depth and capacity of the VF are bound together, and the number of executable commands for each VF is fed back to the virtual machine NVME driver. This limits the number of commands issued by the virtual machine and does not affect other virtual machines, because the number of commands that can be processed per unit time for the PF physical disk is fixed. The binding relationship is not limited here and can be set according to the actual business operation.
[0093] The determination of the RAB value ensures that the number of commands the PF physical disk obtains from each VF matches the bandwidth and capacity settings, preventing a sudden influx of commands into one VF that could overwhelm the command space of other VFs and cause insufficient bandwidth or IOPS. There are no restrictions on the dynamic adjustment strategy for the RAB value, as long as the bandwidth requirements for different running services are met.
[0094] S13: Obtain the number of namespaces of the currently running services on the solid-state drive and the current command in the linked list, and determine the corresponding scheduling credit value based on the current command;
[0095] The scheduling credit value is determined by the bandwidth threshold and the IOPS threshold.
[0096] After the hardware scheduling parameters for hardware resources are configured, and considering that software resources are limited but also shared, resources need to be released promptly. Limits are also needed for NS data scheduling, including setting limits on download speeds and speeds during flash-to-NAND flash memory to maintain dynamic balance. During NS data scheduling, the Fetcher module collects and distinguishes all commands within the NS space. These commands are then uniformly scheduled within a linked list. Therefore, the current command in the linked list is retrieved and then scheduled. During command scheduling, the corresponding scheduling credit value needs to be obtained. The scheduling credit value is determined based on the current NS space capacity. The firmware (FW) sets a base capacity credit value, and the credit values for other capacities are adjusted according to the proportion of the base value occupied. Credit value scheduling means that each NS has a different credit value within a certain period, which determines the VF bandwidth and IOPS value under that NS.
[0097] It's important to note that the physical disk's state includes FOB (Free On Board) and SS (Single Instance) states. FOB state indicates the physical disk has been formatted once but no data has been written to it, or the data being written consists of large sequential I / O blocks. SS state indicates the physical disk has undergone a long period of small random I / O writes, and the random write IOPS has reached a stable state. The FOB state primarily controls the bandwidth of the VF (Virtual Front End) disk, while the SS state controls the disk's IOPS. Therefore, the scheduling credit value is determined in both states (FOB and SS).
[0098] S14: Determine the corresponding scheduling strategy based on the scheduling credit value and the number of namespaces of the currently running services to complete the scheduling of software resources.
[0099] Since software resource scheduling is divided into two parts—NS data scheduling and the NAND flashing adjustment strategy—the scheduling strategy for NS data scheduling is determined based on the scheduling credit value, while the NAND flashing scheduling strategy is determined based on the number of NS instances currently running, ensuring a dynamic balance between commands and physical resources. The adjustment methods can include limiting the number of commands under the NS instance or limiting the flashing speed, etc., but are not limited here; they can be set according to the actual operating conditions.
[0100] This invention provides a VF dynamic scheduling method based on solid-state drives (SSDs). This method ensures a dynamic balance between commands and physical resources based on both hardware and software resources. In terms of hardware resources, it binds total bandwidth, queue depth, IOPS, RAB (Random Access Buffer), and the total capacity of namespaces. Binding VF bandwidth and IOPS to capacity ensures that each VF has its own bandwidth and IOPS when running services. Binding VF queue depth to capacity limits the number of commands issued by virtual machines, preventing impact on other virtual machines. The RAB for each VF is determined based on the total capacity to avoid insufficient bandwidth or IOPS due to timely adjustments to RAB under high service pressure, ensuring that VFs do not interfere with each other when running services. In terms of software, it handles NS scheduling during the scheduling process and the speed of flushing during the flushing process based on the scheduling credit value and the number of NSs. The scheduling credit value is determined by bandwidth and IOPS, ensuring sufficient bandwidth resources and guaranteeing the quality of service running on virtual machines.
[0101] Based on the above embodiments, step S12, which determines the NS bandwidth threshold according to the relationship between total bandwidth, total namespace capacity, and the number of VF disks, includes:
[0102] Get the current namespace capacity of the solid-state drive;
[0103] The bandwidth value for each namespace is obtained by binding it based on the total bandwidth and the total capacity of the namespace;
[0104] The NS bandwidth threshold is determined based on the relationship between the current namespace capacity and bandwidth.
[0105] Correspondingly, the IOPS threshold is determined based on the relationship between total bandwidth, total namespace capacity, and the number of VF disks, including:
[0106] Get the bandwidth value for each I / O;
[0107] The IOPS threshold is determined based on the relationship between the bandwidth value of each IO and the NS bandwidth threshold.
[0108] Specifically, when determining the NS bandwidth threshold, the total bandwidth of the SSD is divided according to the total capacity of the namespace. First, the capacity value of the current namespace (NS space) is obtained: total bandwidth / total namespace capacity = bandwidth value of each namespace. Then, the NS bandwidth threshold can be obtained by multiplying the current NS space capacity value by the bandwidth value of each namespace. That is, assuming the total bandwidth of the SSD is P and the total namespace capacity is C (G), the bandwidth of each G is P / C. For example, if a virtual host HOST1 creates an NS space with a capacity of A, then the bandwidth threshold (maximum value) of this NS space is A*P / C, which determines the bandwidth of the service corresponding to the current NS before running the service.
[0109] Correspondingly, the IOPS threshold under this NS space is obtained by dividing the bandwidth value of each IO by the NS bandwidth threshold.
[0110] In some embodiments, determining the critical value of the NVME queue depth based on the relationship between the total namespace capacity and the number of VF disks includes:
[0111] The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks;
[0112] The critical value for the number of commands in the IO queue to which each VF belongs is determined based on the relationship between the capacity ratio of each VF and the preset critical range. The preset critical range specifies the range of the capacity ratio of the VF and has a mapping relationship with the critical value for the number of commands in the IO queue.
[0113] The threshold value for the number of IO queue commands is used as the threshold value for the NVME queue depth.
[0114] Specifically, the capacity ratio of each VF can be determined first based on the total capacity of the namespace and the number of VF disks. Then, the critical value of the number of IO queue commands to each VF is determined based on the relationship between the capacity ratio of each VF and the preset critical range. The preset critical range is in the form of a ladder, and the range of the VF capacity ratio is specified in each ladder. At the same time, the critical value of the number of IO queue commands is also limited for different ladder ranges.
[0115] The NVMe specification defines a register called Controller Capabilities, which contains a parameter called Maximum Queue Entries Supported (MQES). This parameter is retrieved by the host when enumerating NVMe devices to determine the maximum number of IO queue commands supported by that NVMe device. As described above, the Fetcher's resources are limited, so different NS capacities require different MQES values, which are directly proportional to the capacity. Larger capacities require larger MQES, and vice versa. The MQES is set as follows: if the SSD supports N VFs, then the average capacity of each VF is C / N. First, find an MQES M that satisfies the average capacity. Then, calculate the MQES as M*X based on the ratio X of the current NS's capacity to the average capacity.
[0116] For example, let's define the current NS capacity as A. The capacity ratio obtained by dividing A by the total namespace capacity has the following parameters: If this ratio is below the first-tier threshold of 1 / 32, then the number of IO queue commands (MQES) corresponding to the first-tier threshold range (0, 1 / 32) needs to be configured as 8. If the ratio is between the first and second-tier thresholds, then the number of IO queue commands (MQES) corresponding to the second-tier threshold range (1 / 32, 1 / 16) needs to be configured as 16. If the ratio is between the second and third-tier thresholds, then the number of IO queue commands (MQES) corresponding to the third-tier threshold range (1 / 16, 1 / 8) needs to be configured as 32. This process continues until the maximum MQES of 512 is reached. The number of IO commands (MQES) within each threshold range is determined based on measured values. In this embodiment, the measured values are based on the premise that a given value will not cause interference between the running services under each VF. Therefore, the critical value for the number of IO queue commands is used as the critical value for the NVME queue depth.
[0117] The process of determining the critical values for NS bandwidth, IOPS, and NVME queue depth provided in this invention binds the bandwidth, IOPS, and capacity of the Virtual Machine (VF), ensuring bandwidth and IOPS throughout the entire lifecycle before the user purchases the virtual machine. Binding the VF queue depth and capacity feeds back the number of executable commands for each VF to the virtual machine NVME driver, thus limiting the number of commands issued by the virtual machine and preventing impact on other virtual machines, because the number of commands that can be processed per unit time for the Physical Disk (PF) is fixed.
[0118] Based on the above embodiments, determining the RAB value requires differentiation and adjustment according to different physical disk states. As one embodiment, the RAB value is related to the physical disk state of the current command. When the physical disk state is FOB, the RAB value is determined based on the relationship between total bandwidth, total namespace capacity, and the number of VF disks, including:
[0119] The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks;
[0120] The RAB critical value of each VF is determined based on the relationship between the capacity ratio of each VF and the critical threshold range. The critical threshold range specifies the range of the VF capacity ratio and has a mapping relationship with the RAB critical value.
[0121] Specifically, when the physical disk is in FOB state, the process for determining the corresponding RAB value is the same as the process for determining the critical value of the NVME queue depth in the above embodiment. The capacity ratio for each VF is determined based on the relationship between the total namespace capacity and the number of VF disks. The RAB critical value for each VF is then determined based on the relationship between the capacity ratio of each VF and the critical threshold range. The critical threshold range exhibits a stepped threshold range, which defines the range of VF capacity ratios corresponding to different stepped threshold ranges. Within each stepped threshold range, a specific RAB critical value needs to be allocated.
[0122] Based on the current VF capacity ratio, the critical threshold range can be determined to obtain the corresponding RAB critical value.
[0123] In some embodiments, the RAB value is related to the physical disk state of the current command. When the physical disk state is SS, the RAB value is determined based on the relationship between total bandwidth, total namespace capacity, and the number of VF disks, including:
[0124] Obtain the target service currently running in VF, the service parameters corresponding to the target service, and the current RAB value. The service parameters include at least one or more of the service type and / or the current IOPS value. The service type is determined by the current IOPS value. The current IOPS value is less than the IOPS threshold and is determined by the current NS bandwidth value. The IOPS threshold is determined by the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks.
[0125] Determine the RAB value adjustment strategy for the target business based on the business parameters corresponding to the target business;
[0126] The current RAB value of the target business is adjusted according to the RAB value adjustment strategy to obtain the adjusted RAB value.
[0127] Specifically, when the physical type is SS, it is necessary to identify the service parameters under each VF and dynamically adjust the RAB value. Based on the service parameters, the RAB value adjustment strategy for the target service can be determined. Service parameters are based on all specific data related to the current target service, including at least the service type and the current IOPS value. It should be noted that service parameters can be a single parameter or a combination of multiple parameters; this is not limited here and can be set according to the actual situation. The service type can be random read service, random write service, etc., and its type is mainly determined based on the current IOPS value. Currently, the current IOPS value is less than the IOPS threshold. The limitation on the current IOPS value is determined based on the current NS bandwidth value. The determination process for the IOPS threshold can refer to the above embodiment.
[0128] After determining the RAB value adjustment strategy for the target service, the current RAB value is adjusted to obtain the adjusted RAB value. There are no restrictions on which service parameters are used to determine the adjustment strategy; it can be based on satisfying corresponding preset conditions or by specifying specific service parameters. There are also no restrictions on how the adjustment is performed.
[0129] As one example, when the service parameter of the target service is the service type, a RAB value adjustment strategy for the target service is determined based on the service type, including:
[0130] Obtain the service type of the target service and the current RAB value under each VF. The service type includes at least one of random read service and random write service. The random read service is determined by the number of random read commands per unit time.
[0131] When the service type is random read service, add a preset RAB value to the current RAB value as the RAB value adjustment strategy corresponding to the target service;
[0132] Reduce the preset RAB value based on the current RAB value of other services as a strategy for adjusting the RAB value of other services.
[0133] It should be noted that the current RAB value can be an average RAB value obtained in the prior art, or it can be the RAB value used in the above embodiments; no limitation is made here. The service type includes at least random read services and random write services, where random read services are determined by the number of random read commands per unit time. If the service type is random read service, it indicates that the current service pressure is high, the Fetcher module is not acquiring enough commands per unit time, and the command processing latency when other VFs are running other services is greater than that of random reads, resulting in delayed release of command pool resources and prolonged command occupation, causing latency in random read service processing and affecting service quality. Therefore, a preset RAB value needs to be added to the current RAB value.
[0134] The controller fetcher module has a set of registers for each VF to configure the RAB, which affects the number of commands fetched by each VF per unit time. Due to the characteristics of NAND and the limitations of DRAM buffer resources, the bandwidth and IOPS of the host can vary greatly when running different services. For example, under high-pressure random read and write operations, the physical disk read performance can reach 1400+K, while the write performance is only 270+K. If one VF is running read services while other VFs are running write services, it will greatly affect the read service. This is because the fetcher command resource pool is limited. When the RAB is the same for each VF, the VF running write services, due to its low IOPS, experiences longer command release delays, thus occupying command resources for a longer period. This causes the read service to be greatly affected by insufficient command resources. Based on this, the firmware added an IO PATTERN identification module. When it is identified that a VF needs to run high-pressure, high-IOPS random read services while other VFs are running low-IOPS random write services, the RAB of the VF is set to a lower value (e.g., the number of commands fetched by the fetcher per unit time is half that of the VFs running read services).
[0135] Since the total RAB value is fixed, the RAB value of the VF corresponding to the random read service is increased, while the current RAB value of other services needs to be decreased by the preset RAB value. It should be noted that the specific increases and decreases in the preset RAB value can be the same or different. For the RAB values of each VF corresponding to other services, one can decrease the RAB value slightly in each VF, with the final total decrease being the same as the increase in the preset RAB value for the random read service. Alternatively, one can decrease the preset RAB value in the RAB value of one VF corresponding to other services, while keeping the RAB values of the other VFs unchanged. No limitation is imposed here.
[0136] The above embodiments only address the adjustment strategy determined when the service parameter is a service type. As one embodiment, when the service parameter of the target service is the current IOPS value, the RAB value adjustment strategy for the target service is determined based on the service type, including:
[0137] Get the current IOPS value;
[0138] Determine whether the current IOPS value of the target service is greater than the preset IOPS value;
[0139] If so, obtain the current RAB value corresponding to the target business;
[0140] Add a preset RAB value to the current RAB value as a RAB value adjustment strategy for the target business;
[0141] Reduce the preset RAB value based on the current RAB value of other services as a strategy for adjusting the RAB value of other services.
[0142] It is understandable that it is only necessary to check whether the current IOPS value is greater than the preset IOPS value. If the current IOPS value is greater than the preset IOPS value, it indicates that the current business pressure is increasing. The current RAB value corresponding to the target business is obtained; the preset RAB value is added to the current RAB value, and the preset RAB value is reduced to the current RAB value of other businesses. The corresponding adjustment strategies for increasing and decreasing the preset RAB value can refer to the adjustment process in the above embodiment, and will not be described in detail here.
[0143] Based on the above embodiments, as one embodiment, when the target service changes, after adjusting the current RAB value of the current VF according to the RAB value adjustment strategy, the method further includes:
[0144] Restore the adjusted RAB value to the current RAB value.
[0145] In other words, when the VF exits random write service or switches to random read service, it will revert to the previous RAB to facilitate subsequent dynamic adjustments.
[0146] The RAB value provided in this embodiment of the invention is determined according to the physical type, the service model of each VF is identified, and the RAB value is dynamically adjusted so that the number of commands obtained by the PF physical disk from each VF meets the bandwidth and capacity settings, and a large number of commands will not suddenly flood into a VF and occupy the command space of other VFs, resulting in insufficient bandwidth or IOPS as expected.
[0147] Based on the above embodiments, step S13, determining the corresponding scheduling credit value according to the current command, includes:
[0148] Get the current physical disk status of the current command, where the current physical disk status is either FOB or SS.
[0149] The corresponding scheduling credit value is determined based on the current command and the current physical disk status. The scheduling credit value is determined by the bandwidth value corresponding to the FOB state or the IOPS value corresponding to the SS state.
[0150] Specifically, the FW first collects all namespace commands (bound to a VF) and distinguishes between read and write commands, then links the commands of each NS together in a singly linked list for unified scheduling. The command scheduler traverses all namespaces, first obtaining a command by namespace ID, then determining whether the command is a read or write command, and obtaining the corresponding scheduling credit value based on the command type and the current physical disk status.
[0151] Based on the above embodiments, step S14, which involves determining the corresponding scheduling strategy according to the scheduling credit value, includes:
[0152] Get the scheduling credit value of the current command and the preset scheduling credit value within a preset time period. The current command is stored in a singly linked list.
[0153] Within a preset time period, determine whether the scheduling credit value is not greater than the preset scheduling credit value;
[0154] If so, execute the current command;
[0155] If not, the remaining scheduling credit value of the current command is determined based on the relationship between the scheduling credit value and the preset scheduling credit value.
[0156] Store the current command corresponding to the remaining scheduling credit value into a singly linked list to complete the scheduling so that it can be scheduled and executed at the next preset time.
[0157] Understandably, there are two types of data scheduling for physical disks. NS (Namespace Default) data scheduling is used to limit download speeds. For example, a 500GB cloud drive with a speed limit of 2MB / s can actually achieve speeds of 100MB / s. There are two technical solutions for data scheduling. One physical state is FOB (Forward-Only) mode, which schedules based on bandwidth credits, determining the bandwidth speed. For example, if the bandwidth is 8K and a command is 4K, all commands are identical. Within a preset time, only 2 commands can be processed per second. If a service includes 4 commands, the 3rd and 4th commands will be suspended and require 1 second to proceed. The second physical state is SS (Side-Only) mode, which uses IOPS. IOPS is determined based on the total namespace capacity and bandwidth, and is directly related only to IOPS. It's not about bandwidth; it's about knowing the number of IO commands, i.e., throughput. For example, if only 2 commands can be processed per second within a preset time, and a service includes 4 commands, the 3rd and 4th commands will be suspended and require 1 second to proceed.
[0158] Figure 4 A flowchart of an NS data scheduling method provided in an embodiment of the present invention is shown below. Figure 4 As shown, it includes:
[0159] S21: Obtain command;
[0160] S22: Determine whether the command is a read command or a write command. If it is a read command, proceed to step S23; if it is a write command, proceed to step S24.
[0161] S23: Insert into the read command list;
[0162] S24: Insert write command list;
[0163] S25: Obtain the scheduling credit value corresponding to the current maximum read / write bandwidth and IOPS based on the NS ID;
[0164] S26: Get the currently used scheduling credits;
[0165] S27: Determine the credit limit value based on the relationship between the scheduling credit value and the currently used scheduling credit value;
[0166] S28: Determine if the credit limit is 0. If yes, proceed to step S29; otherwise, proceed to step S30.
[0167] S29: Push the credit limit value back into the linked list;
[0168] S31: Determine if the timer has timed out. If so, proceed to step S32.
[0169] S32: Reset credit score;
[0170] S30: Execute the command directly.
[0171] When a VF runs out of credit within a certain period of time and its credit limit is 0, the VF's commands are suspended until the next scheduling cycle. The scheduler maintains a timer, and resets the credit value of each VF every time the timer expires.
[0172] In the above embodiments, the number of commands is limited based on NS data scheduling. After NS data scheduling is completed, during the flashing process, there are two technical solutions: one is based on the number of NS, and the other is based on the number of NS, plus the number of commands within each NS. Ultimately, both technical solutions are determined based on the number of NS. Step S14, which determines the corresponding scheduling strategy based on the number of NS of the currently running service, includes:
[0173] Get the number of NS instances currently running;
[0174] Determine whether the number of NS in the currently running service exceeds the first threshold;
[0175] If so, obtain the current data refresh rate of the currently running service, and increase the preset rate on the basis of the current rate to speed up the data refresh rate of the currently running service in order to complete the scheduling strategy.
[0176] Specifically, the scheduler adjusts the scheduling based on the number of currently running NS. When the number of running NS reaches a certain threshold, that is, when it exceeds the first threshold, it obtains the current rate of the currently flushed data and accelerates it (increases the preset rate) as the scheduling strategy.
[0177] In another embodiment, the corresponding scheduling strategy is determined based on the number of NS currently running services, including:
[0178] Get the number of commands corresponding to the number of NS in the currently running business;
[0179] Determine if the number of commands exceeds the standard value for data volume;
[0180] If the number of commands exceeds the standard value for data volume, then determine whether the number of NS in the currently running business containing the command exceeds the second threshold.
[0181] If the number of NS in the currently running service where the number of commands exceeds the second threshold, the number of commands will be reduced by a preset number based on the standard data volume value to lower the data volume standard in order to complete the scheduling strategy. The standard data volume value is inversely proportional to the number of commands.
[0182] Specifically, the scheduler doesn't immediately flush commands to NAND upon receipt. Instead, it considers NAND characteristics: each programming operation requires a sufficient amount of data, and command conflicts can impact bandwidth. Therefore, it retrieves the number of commands within each NS (Nearest Neighbor Controller) and determines if this number exceeds a data volume threshold. If it does, it indicates that the currently collected commands have reached a certain data volume. Then, it checks if the number of corresponding NSs exceeds a second threshold. If it does, to ensure scheduler balance and resource reclamation speed, the data volume threshold for flushing needs to be appropriately reduced to accelerate the flushing frequency. The data volume threshold is inversely proportional to the number of commands.
[0183] First, the flush rate is accelerated when the number of NS (Nearest Neighbors) reaches a certain threshold. Commands need to be written to NS, and the data volume of these commands is also flushed to NAND when it reaches a certain threshold. If the number of NS is large, the data flush threshold is lowered; that is, it's not necessary to accumulate a certain amount of data before writing to NAND. For example, if 64K of data (the flush threshold) is accumulated before writing, to speed up the process, it's not necessary to accumulate 64K; the flush threshold is lowered, for example, 32K of data is accumulated before writing.
[0184] The scheduling strategy in software resources provided in this embodiment of the invention dynamically adjusts the data flushing speed strategy based on the number of VF disks with concurrent services through flexible command scheduling, so that commands and physical resources are kept in dynamic balance, thus ensuring service quality.
[0185] Figure 5 A flowchart of another VF dynamic scheduling method based on solid-state drives provided in this embodiment of the invention is shown below. Figure 5 As shown, it includes:
[0186] S41: HOST creates NS space;
[0187] S42: Bind the created NS space to the corresponding VF;
[0188] S43: The FW firmware allocates VF resources based on the capacity of the NS space and persists them.
[0189] S44: Pass VF through to the virtual machine to run services;
[0190] S45: The FW firmware identifies the current service model. When the service pressure is high, it increases the RAB value. When the service pressure decreases, it restores the maximum RAB value of the current NS.
[0191] S46: FW firmware caches HOST write data to the cache;
[0192] S47: The FW firmware adjusts the speed at which the cache is sent to the NAND based on the number of VFs currently running, so as to release more cache for subsequent write operations as soon as possible;
[0193] S48: The FW firmware slices the cached data from multiple VFs and packages it into a single NAND write request to achieve distributed writing and provide concurrency for subsequent simultaneous readings from multiple VFs.
[0194] The resource allocation in step S43 includes three allocation methods:
[0195] 1. Allocate maximum read / write bandwidth and IOPS;
[0196] 2. Allocate the maximum NVME queue depth;
[0197] 3. Allocate the largest RAB
[0198] Figure 6 This is a schematic diagram of a VF dynamic scheduling structure based on a solid-state drive provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the host accesses the PF disk and VF through the PCIe port. The PF disk supports control over the VF disk, such as creating and deleting NS and VF, as well as binding VF and NS. The PF disk does not have NS space, but only queue pairs, which include an admin queue. Each VF is bound to each NS, and the queue pairs of each VF include an admin queue and an IO queue. Read and write operations are performed in each IO queue through the NS schedule.
[0199] The foregoing has described in detail various embodiments of the VF dynamic scheduling method based on solid-state drives. Based on this, the present invention also discloses a VF dynamic scheduling device based on solid-state drives corresponding to the above method. Figure 7This is a structural diagram of a VF dynamic scheduling device based on a solid-state drive, provided as an embodiment of the present invention. Figure 7 As shown, the VF dynamic scheduling device based on solid-state drives includes:
[0200] The first acquisition module 11 is used to pre-acquire the total bandwidth of the solid-state drive, the total capacity of the NS and the number of VF disks, wherein the number of VF disks is the same as the number of NS, and the VF disks and NS are bound one-to-one.
[0201] The hardware scheduling module 12 is used to determine the hardware scheduling parameters corresponding to the hardware resources based on the combination relationship between the total bandwidth, the total capacity of the NS and the number of VF disks. The hardware parameters include at least the NS bandwidth threshold, the IOPS threshold, the NVME queue depth threshold and the RAB value.
[0202] The first determining module 13 is used to obtain the number of NS of the currently running services of the solid-state drive and the current command in the linked list, and to determine the corresponding scheduling credit value according to the current command. The scheduling credit value is determined by the bandwidth threshold and the IOPS threshold.
[0203] The software scheduling module 14 is used to determine the corresponding scheduling strategy based on the scheduling credit value and the number of NS of the currently running service to complete the scheduling of the software resources.
[0204] Since the embodiments of the device part correspond to the embodiments described above, please refer to the embodiments described in the method part for the embodiments of the device part, and will not be repeated here.
[0205] For an introduction to the VF dynamic scheduling device based on solid-state drive provided by the present invention, please refer to the above method embodiments. The present invention will not be described in detail here, but it has the same beneficial effects as the above VF dynamic scheduling method based on solid-state drive.
[0206] Figure 8 A structural diagram of another VF dynamic scheduling device based on a solid-state drive provided in an embodiment of the present invention is shown below. Figure 8 As shown, the device includes:
[0207] Memory 21 is used to store computer programs;
[0208] Processor 22 is used to implement the steps of the VF dynamic scheduling method based on solid-state drive when executing computer programs.
[0209] The VF dynamic scheduling device based on solid-state drives provided in this embodiment can include, but is not limited to, tablet computers, laptop computers, or desktop computers.
[0210] The processor 22 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 22 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 22 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 22 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0211] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 21 is used to store at least the following computer program 211, which, after being loaded and executed by the processor 22, is capable of implementing the relevant steps of the VF dynamic scheduling method based on solid-state drives disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. The operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include, but is not limited to, the data involved in the VF dynamic scheduling method based on solid-state drives, etc.
[0212] In some embodiments, the VF dynamic scheduling device based on solid-state drive may further include a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.
[0213] Those skilled in the field can understand, Figure 8 The structure shown does not constitute a limitation on solid-state drive-based VF dynamic scheduling devices and may include more or fewer components than shown.
[0214] The processor 22 implements the VF dynamic scheduling method based on solid-state drive provided in any of the above embodiments by calling the instructions stored in the memory 21.
[0215] For an introduction to the VF dynamic scheduling device based on solid-state drive provided by the present invention, please refer to the above method embodiments. The present invention will not be described in detail here, but it has the same beneficial effects as the above VF dynamic scheduling method based on solid-state drive.
[0216] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by processor 22, implements the steps of the VF dynamic scheduling method based on solid-state drive described above.
[0217] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0218] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiments. The present invention will not be described in detail here, but it has the same beneficial effects as the above-described VF dynamic scheduling method based on solid-state drives.
[0219] The present invention has provided a detailed description of a VF dynamic scheduling method, a VF dynamic scheduling device, and a medium based on a solid-state drive. The various embodiments in the 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 devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0220] It should also be noted that, in this specification, 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.
Claims
1. A VF dynamic scheduling method based on solid-state drives, characterized in that, include: The total bandwidth, total namespace capacity, and number of VF disks of the solid-state drive are obtained in advance, wherein the number of VF disks and the number of namespaces are the same, and the VF disks and namespaces are bound one-to-one. The hardware scheduling parameters corresponding to the hardware resources are determined based on the combination relationship between the total bandwidth, the total namespace capacity, and the number of VF disks. The hardware scheduling parameters include at least the namespace bandwidth threshold, the IOPS threshold, the NVME queue depth threshold, and the RAB value. Obtain the number of namespaces of the currently running services of the solid-state drive and the current commands in the linked list, and determine the corresponding scheduling credit value based on the current commands, wherein the scheduling credit value is determined by the bandwidth threshold and the IOPS threshold; The corresponding scheduling strategies are determined based on the scheduling credit value and the number of namespaces of the currently running services to complete the scheduling of software resources. Correspondingly, determining the corresponding scheduling credit value based on the current command includes: Obtain the current physical disk state of the current command, wherein the current physical disk state is either FOB state or SS state; The scheduling credit value is determined based on the current command and the current physical disk status, wherein the scheduling credit value is determined by the bandwidth value corresponding to the FOB state or by the IOPS value corresponding to the SS state; Correspondingly, determining the corresponding scheduling strategy based on the scheduling credit value includes: Obtain the scheduling credit value of the current command and the preset scheduling credit value within a preset time period, wherein the current command is stored in a singly linked list; Within the preset time period, determine whether the scheduling credit value is not greater than the preset scheduling credit value; If so, then execute the current command; If not, the remaining scheduling credit value of the current command is determined based on the relationship between the scheduling credit value and the preset scheduling credit value. The current command corresponding to the remaining scheduling credit value is stored in the linked list to complete the scheduling so that it can be executed at the next preset time.
2. The VF dynamic scheduling method based on solid-state drives according to claim 1, characterized in that, The namespace bandwidth threshold is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including: Obtain the current namespace capacity value of the solid-state drive; The bandwidth value of each namespace is obtained by binding the total bandwidth and the total capacity of the namespace. The namespace bandwidth threshold is determined based on the relationship between the current namespace capacity value and the bandwidth value. Correspondingly, the IOPS threshold is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including: Get the bandwidth value for each I / O; The IOPS threshold is determined based on the relationship between the bandwidth value of each IO and the namespace bandwidth threshold.
3. The VF dynamic scheduling method based on solid-state drives according to claim 1, characterized in that, The critical value for the NVME queue depth is determined based on the relationship between the total capacity of the namespace and the number of VF disks, including: The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks; The critical value for the number of commands in the IO queue to which each VF belongs is determined based on the relationship between the capacity ratio of each VF and the preset critical range. The preset critical range specifies the range of the capacity ratio of the VF and has a mapping relationship with the critical value for the number of commands in the IO queue. The threshold value for the number of commands in the IO queue is used as the threshold value for the depth of the NVME queue.
4. The VF dynamic scheduling method based on solid-state drive according to any one of claims 1 to 3, characterized in that, The RAB value is related to the physical disk state of the current command. When the physical disk state is FOB, the RAB value is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including: The capacity ratio of each VF is determined based on the relationship between the total capacity of the namespace and the number of VF disks; The RAB critical value of each VF is determined based on the relationship between the capacity ratio of each VF and the critical threshold range, wherein the critical threshold range defines the range of the VF capacity ratio and has a mapping relationship with the RAB critical value.
5. The VF dynamic scheduling method based on solid-state drive according to any one of claims 1 to 3, characterized in that, The RAB value is related to the physical disk state of the current command. When the physical disk state is SS state, the RAB value is determined based on the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks, including: Obtain the target service currently running in the VF, the service parameters corresponding to the target service, and the current RAB value. The service parameters include at least one or more of the service type and / or the current IOPS value. The service type is determined by the current IOPS value. The current IOPS value is less than the IOPS threshold and is determined by the current namespace bandwidth value. The IOPS threshold is determined by the relationship between the total bandwidth, the total namespace capacity, and the number of VF disks. The RAB value adjustment strategy for the target service is determined based on the service parameters corresponding to the target service. The current RAB value of the target service is adjusted according to the RAB value adjustment strategy to obtain the adjusted RAB value.
6. The VF dynamic scheduling method based on solid-state drives according to claim 5, characterized in that, When the service parameter of the target service is the service type, a RAB value adjustment strategy for the target service is determined based on the service type, including: Obtain the service type of the target service and the current RAB value under each VF, wherein the service type includes at least one of random read service and random write service, and the random read service is determined by the number of random read commands per unit time; When the service type is the random read service, a preset RAB value is added to the current RAB value as the RAB value adjustment strategy corresponding to the target service. The preset RAB value is reduced based on the current RAB value of other services as a strategy for adjusting the RAB value of those other services.
7. The VF dynamic scheduling method based on solid-state drive according to claim 5, characterized in that, Given that the service parameter of the target service is the current IOPS value, a RAB value adjustment strategy for the target service is determined based on the service type, including: Obtain the current IOPS value; Determine whether the current IOPS value of the target service is greater than a preset IOPS value; If so, then obtain the current RAB value corresponding to the target service; A preset RAB value is added to the current RAB value to serve as the RAB value adjustment strategy for the target service. The preset RAB value is reduced based on the current RAB value of other services as a strategy for adjusting the RAB value of those other services.
8. The VF dynamic scheduling method based on solid-state drive according to claim 5, characterized in that, When the target service changes, after adjusting the current RAB value of the current VF according to the RAB value adjustment strategy, the method further includes: Restore the adjusted RAB value to the current RAB value.
9. The VF dynamic scheduling method based on solid-state drive according to claim 1, characterized in that, The corresponding scheduling strategy is determined based on the number of namespaces of the currently running services, including: Get the number of namespaces of the currently running service; Determine whether the number of namespaces of the currently running service exceeds a first threshold; If so, obtain the current data refresh rate of the currently running service, and increase the preset rate on the basis of the current rate to speed up the data refresh rate of the currently running service in order to complete the scheduling strategy.
10. The VF dynamic scheduling method based on solid-state drives according to claim 1, characterized in that, The corresponding scheduling strategy is determined based on the number of namespaces of the currently running services, including: Obtain the number of commands corresponding to the number of namespaces of the currently running service; Determine whether the number of commands exceeds the standard value for data volume; If the number of commands exceeds the data volume standard value, then it is determined whether the number of namespaces of the currently running service containing the number of commands exceeds the second threshold. If the number of namespaces of the currently running service containing the number of commands exceeds the second threshold, then the number of names in the namespace is reduced by a preset number based on the standard data volume value to lower the standard data volume and complete the scheduling strategy. The standard data volume value is inversely proportional to the number of commands.
11. A VF dynamic scheduling device based on a solid-state drive, characterized in that, include: The first acquisition module is used to pre-acquire the total bandwidth, total namespace capacity and number of VF disks of the solid-state drive, wherein the number of VF disks and the number of namespaces are the same, and the VF disks and namespaces are bound one-to-one. The hardware scheduling module is used to determine the hardware scheduling parameters corresponding to the hardware resources based on the combination relationship between the total bandwidth, the total namespace capacity and the number of VF disks. The hardware scheduling parameters include at least the namespace bandwidth threshold, the IOPS threshold, the NVME queue depth threshold and the RAB value. The first determining module is used to obtain the number of namespaces of the currently running services of the solid-state drive and the current commands in the linked list, and to determine the corresponding scheduling credit value based on the current commands, wherein the scheduling credit value is determined by the bandwidth threshold and the IOPS threshold; The software scheduling module is used to determine the corresponding scheduling strategy based on the scheduling credit value and the number of namespaces of the currently running service to complete the scheduling of the software resources. Correspondingly, determining the corresponding scheduling credit value based on the current command includes: Obtain the current physical disk state of the current command, wherein the current physical disk state is either FOB state or SS state; The scheduling credit value is determined based on the current command and the current physical disk status, wherein the scheduling credit value is determined by the bandwidth value corresponding to the FOB state or by the IOPS value corresponding to the SS state; Correspondingly, determining the corresponding scheduling strategy based on the scheduling credit value includes: Obtain the scheduling credit value of the current command and the preset scheduling credit value within a preset time period, wherein the current command is stored in a singly linked list; Within the preset time period, determine whether the scheduling credit value is not greater than the preset scheduling credit value; If so, then execute the current command; If not, the remaining scheduling credit value of the current command is determined based on the relationship between the scheduling credit value and the preset scheduling credit value. The current command corresponding to the remaining scheduling credit value is stored in the linked list to complete the scheduling so that it can be executed at the next preset time.
12. A VF dynamic scheduling device based on a solid-state drive, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the VF dynamic scheduling method based on a solid-state drive as described in any one of claims 1 to 10 when executing the computer program.
13. 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 VF dynamic scheduling method based on a solid-state drive as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Disk read-write resource allocation method and device, equipment and storage medium
CN111880750A
NVMe storage virtualization method and system with predictable time delay
CN112667356A