SSD NameSpace QoS refining method and device, computer equipment and storage medium

By initializing the token bucket and allocating tokens in the NameSpace of SSD, the problem of being difficult to achieve accurate QoS current limit in the prior art is solved, and precise regulation of IO requests and efficient utilization of storage resources are achieved.

CN120010786APending Publication Date: 2025-05-16成都芯忆联信息技术有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510110141.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate QoS current limiting, resulting in the inability to effectively regulate the storage IO performance.

Method used

By initializing the token bucket in the NameSpace of the SSD, the initial capacity is calculated based on the current limit configuration information, and allocating tokens to IO requests per unit time, accurate QoS traffic limit is achieved.

Benefits of technology

It realizes accurate current limiting of IO requests, improves the utilization rate and user experience of storage resources, and reduces the overhead of the virtualization layer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010786A_ABST
    Figure CN120010786A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for refining QoS (Quality of Service) of SSD NameSpace, computer equipment and a storage medium, and relates to the technical field of solid state disks, and the method comprises the following steps: initializing the initial capacity of a token bucket based on current limiting configuration information, the token bucket comprising tokens; distributing the tokens in the token bucket to the IO requests in unit time, and if the number of the tokens required by the IO requests in unit time is smaller than or equal to the number of the tokens in the token bucket, distributing the tokens to all the IO requests in unit time; if the number of the tokens needed by the IO requests in the unit time is larger than the number of the tokens in the token bucket, the tokens are distributed to part of the IO requests in the unit time until all the tokens in the token bucket are distributed, and the part of the IO requests can obtain all the tokens in the token bucket at present; according to the method, the IO requests distributed with the tokens will be processed, the IO requests not distributed with the tokens will not be processed temporarily, the tokens are distributed and processed after the next round of token supplementation, and therefore accurate QoS flow limitation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solid state drives, and in particular to a method, device, computer equipment and storage medium for fine-grained QoS of an SSD NameSpace. Background Art

[0002] SSD, which means solid state drive in Chinese, is a commonly used storage device.

[0003] In enterprise-level SSDs, many manufacturers have implemented the SR-IOV function, and a few manufacturers allow administrators to configure the maximum IOPS and bandwidth of each SR-IOV VF based on the estimated business performance. However, the application layer needs to use the QoS function and deploy the application on a virtualization platform. In this mode, the application layer can obtain storage IO performance comparable to that of the hardware, but cannot directly use the computing and network performance under physical conditions. NVMe SSD uses NameSpace for fine-grained division and management, achieving efficient allocation and scheduling of storage. According to the different requirements of different businesses for storage performance and quality, specific QoS requirements are defined for each NameSpace, which improves the utilization of storage resources and user experience. At the same time, multiple different applications can directly use physical hardware resources to reduce the overhead of the virtualization layer. However, it is difficult for existing technical solutions to achieve accurate QoS flow control, and an improvement solution is urgently needed. Summary of the invention

[0004] The embodiments of the present invention provide a method, apparatus, computer device and storage medium for fine-grained QoS of SSD NameSpace, aiming to solve the problem that it is difficult to achieve accurate QoS flow limiting in the solutions of the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a method for fine-grained QoS of an SSDNameSpace, which includes:

[0006] Initializing an initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens;

[0007] Allocate tokens in the token bucket to IO requests within a unit time, wherein, if the number of tokens required by IO requests within a unit time is less than or equal to the number of tokens in the token bucket, then allocate tokens to all IO requests within the unit time; if the number of tokens required by IO requests within a unit time is greater than the number of tokens in the token bucket, then allocate tokens to some IO requests within the unit time until all tokens in the token bucket are allocated, and the said some IO requests will obtain all the tokens currently in the token bucket;

[0008] IO requests that have been allocated tokens will be processed, and IO requests that have not been allocated tokens will not be processed for the time being. After the next round of token replenishment, tokens will be allocated and processed.

[0009] A further technical solution is that the method further comprises:

[0010] The token bucket is replenished with tokens at each unit time interval.

[0011] A further technical solution is that after the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity.

[0012] A further technical solution is that the initial capacity of the token bucket is initialized based on the current limiting configuration information, including:

[0013] Get the time required to complete a single IO request;

[0014] The initial capacity is calculated by the formula initial capacity = IOPS current limiting threshold * time required to complete a single IO request.

[0015] A further technical solution is that the time required for obtaining a single IO request includes:

[0016] Calculates the time required for a single IO request based on the preset IOPS limit rate.

[0017] A further technical solution is that the initial capacity of the token bucket is initialized based on the current limiting configuration information, including:

[0018] Obtain the time to complete the unit bandwidth according to the preset bandwidth limiting rate;

[0019] The initial capacity is calculated by the formula initial capacity = bandwidth limiting threshold * time to complete unit bandwidth.

[0020] A further technical solution is that the method further comprises:

[0021] Determining whether the current limiting configuration information is adjusted;

[0022] If the current limiting configuration information is adjusted, jump to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information.

[0023] In a second aspect, an embodiment of the present invention further provides a device for fine-grained QoS of SSD NameSpace, which includes a unit for executing the above method.

[0024] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0025] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0026] The embodiment of the present invention provides a method, device, computer equipment and storage medium for fine-grained QoS of SSD NameSpace. The method includes: initializing the initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens; allocating tokens in the token bucket to IO requests within a unit time, wherein if the number of tokens required for IO requests within a unit time is less than or equal to the number of tokens in the token bucket, allocating tokens to all IO requests within a unit time; if the number of tokens required for IO requests within a unit time is greater than the number of tokens in the token bucket, allocating tokens to some IO requests within a unit time until all tokens in the token bucket are allocated, and the some IO requests will obtain all the current tokens in the token bucket; IO requests to which tokens are allocated will be processed, and IO requests to which tokens are not allocated will not be processed temporarily, and tokens will be allocated and processed after the next round of token replenishment. It can be seen that by setting a token bucket, it is possible to allocate tokens of at most the bucket capacity to IO requests within a unit time, and at the same time, only IO requests to which tokens are allocated are processed, so that accurate QoS traffic limitation can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0028] Figure 1 A flowchart of a method for fine-grained QoS of an SSD NameSpace provided by an embodiment of the present invention;

[0029] Figure 2 A schematic diagram of the principle of a method for fine-grained QoS of SSD NameSpace provided in an embodiment of the present invention;

[0030] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0032] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0033] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0034] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0035] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0036] See also Figure 1 and Figure 2 The embodiment of the present invention provides a method for fine-grained QoS of SSD NameSpace, which can realize reliable and accurate QoS flow control. Figure 1 As shown, the method comprises the following steps:

[0037] S1, initializing the initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens.

[0038] In a specific implementation, the current limiting configuration information may be set by a person skilled in the art, which is not specifically limited in the present invention. The current limiting configuration information may be an IOPS current limiting threshold or a bandwidth current limiting threshold, etc.

[0039] In the embodiment of the present invention, there are two ways to calculate the initial capacity of the token bucket, namely, using the IOPS current limiting threshold and the bandwidth current limiting threshold. Among them, the calculation method 1 of the initial capacity of the token bucket is as follows:

[0040] The initial capacity of the token bucket is calculated based on the IOPS current limiting threshold, which specifically includes the following steps: obtaining the time required to complete a single IO request; and calculating the initial capacity through the formula initial capacity = IOPS current limiting threshold * time required to complete a single IO request.

[0041] In a specific implementation, specifically, the IOPS current limiting threshold can be set by those skilled in the art according to requirements, and is not specifically limited in the embodiment of the present invention.

[0042] Get the time required for a single IO request, specifically, calculate the time required for a single IO request based on the preset IOPS current limit rate.

[0043] The specific calculation formula is: The time required for a single IO request (nanoseconds) = (1 / IOPS current limit rate) * 1 * 10 9 .

[0044] The initial capacity of the token bucket is calculated as follows:

[0045] The initial capacity of the token bucket is calculated based on the bandwidth limiting threshold, which specifically includes the following steps: obtaining the time to complete the unit bandwidth according to the preset bandwidth limiting rate; and calculating the initial capacity through the formula initial capacity = bandwidth limiting threshold * time to complete the unit bandwidth.

[0046] Specifically, the bandwidth current limiting threshold may be set by those skilled in the art according to requirements, and is not specifically limited in the embodiments of the present invention.

[0047] The time to complete the unit bandwidth is obtained according to the preset bandwidth limiting rate, specifically, the time required for a single IO request is calculated according to the preset bandwidth limiting rate.

[0048] The specific calculation formula is: The time required for a single IO request (nanoseconds) = (1*io_size / bandwidth limit rate)*1*10 9 io_Size refers to the size of the input / output operation, usually in KB or MB.

[0049] It should be noted that, in the embodiment of the present invention, the initial capacity of the token bucket may be calculated by the above-mentioned calculation method 1 and / or calculation method 2.

[0050] In some embodiments, when the current limiting configuration information is adjusted, the initial capacity of the token bucket is adjusted accordingly. Specifically, the method also includes the following steps: determining whether the current limiting configuration information is adjusted; if the current limiting configuration information is adjusted, jumping to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information.

[0051] In a specific implementation, the current limiting configuration information may be adjusted by those skilled in the art according to requirements. After the current limiting configuration information is adjusted, the initial capacity of the token bucket needs to be reinitialized.

[0052] It should be noted that the calculation of the capacity of the initialization token bucket requires the time to complete a single IO or the time to complete a unit bandwidth. Therefore, if the current limiting configuration information is adjusted, the time to complete a single IO and / or the time to complete a unit bandwidth should also be recalculated.

[0053] S2, allocates tokens in the token bucket to IO requests within a unit time, wherein, if the number of tokens required by the IO requests within a unit time is less than or equal to the number of tokens in the token bucket, tokens are allocated to all IO requests within the unit time; if the number of tokens required by the IO requests within a unit time is greater than the number of tokens in the token bucket, tokens are allocated to some IO requests within the unit time until all tokens in the token bucket are allocated, and the said some IO requests will obtain all the current tokens in the token bucket.

[0054] In a specific implementation, the unit time can be set by a person skilled in the art, for example, 1s, which is not specifically limited in the embodiment of the present invention. Each IO request requires a token. In the embodiment of the present invention, tokens are allocated to IO requests within a unit time, and the specific rules are as follows: if the number of tokens required for IO requests within a unit time is less than or equal to the number of tokens in the token bucket, tokens are allocated to all IO requests within the unit time; if the number of tokens required for IO requests within a unit time is greater than the number of tokens in the token bucket, tokens are allocated to some IO requests within the unit time until all tokens in the token bucket are allocated, and some IO requests will obtain all the current tokens in the token bucket; for example, tokens can be allocated to IO requests in sequence based on the initiation time of the IO requests until all tokens in the token bucket are allocated, and some IO requests will obtain all the current tokens in the token bucket.

[0055] It can be seen that within a unit time, after the tokens in the token bucket are allocated, there are no more tokens, and tokens cannot be allocated for IO requests. IO requests that are not allocated tokens will be limited and can only wait for the next unit time to allocate tokens.

[0056] In some embodiments, the method further comprises the following step: replenishing tokens for the token bucket at each unit time interval, wherein after replenishing tokens, the number of tokens contained in the token bucket is less than or equal to the initial capacity, thereby achieving good traffic control.

[0057] Specifically, tokens are replenished according to time. For example, if 10 IO requests are received within 1 second, 10 tokens are required, and the initial capacity of the token bucket is 20 tokens, then all these 10 IO requests are processed; if 20 IO requests are received within the second unit time, 20 tokens are required, and there are 10 tokens left in the bucket at this time, and 10 tokens are replenished within the second second, then these 20 IO requests are processed.

[0058] When replenishing tokens, you can think of tokens as nanoseconds of time, calculate the distance between the current time and the last time a token was taken, and thus calculate the number of newly generated tokens. The total number of tokens = max (token bucket capacity, current tokens in the token bucket + newly generated tokens), that is, when the total number of tokens exceeds the token bucket capacity, the tokens overflow. For example, when processing the first batch of IO requests and initializing the token bucket, the number of tokens is equal to the token bucket capacity. The initial number of tokens in the token bucket plus the newly generated tokens exceeds the token bucket capacity. At this time, the number of tokens is equal to the bucket capacity.

[0059] In the embodiment of the present invention, it is necessary to ensure that after the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity to achieve traffic control.

[0060] S3: IO requests that have been allocated tokens will be processed, and IO requests that have not been allocated tokens will not be processed for the time being. After the next round of token replenishment, tokens will be allocated and processed.

[0061] In the specific implementation, only the IO requests that are allocated with tokens are processed, and the IO requests that are not allocated with tokens are processed after they are allocated with tokens, so as to achieve accurate QoS traffic limitation.

[0062] The embodiment of the present invention proposes a method for fine-grained QoS of SSD NameSpace, including: initializing the initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens; allocating tokens in the token bucket to IO requests within a unit time, wherein if the number of tokens required for IO requests within a unit time is less than or equal to the number of tokens in the token bucket, allocating tokens to all IO requests within the unit time; if the number of tokens required for IO requests within a unit time is greater than the number of tokens in the token bucket, allocating tokens to some IO requests within the unit time, until all tokens in the token bucket are allocated, and the some IO requests will obtain all current tokens in the token bucket; IO requests to which tokens are allocated will be processed, and IO requests to which tokens are not allocated will not be processed temporarily, and tokens will be allocated and processed after the next round of token replenishment. It can be seen that by setting a token bucket, it is possible to allocate tokens of at most the bucket capacity to IO requests within a unit time, and at the same time, only IO requests to which tokens are allocated are processed, thereby achieving precise QoS traffic limitation.

[0063] Corresponding to the above SSD NameSpace fine-grained QoS method, the present invention also provides an SSD NameSpace fine-grained QoS device. The SSD NameSpace fine-grained QoS device includes a unit for executing the above SSD NameSpace fine-grained QoS method, and the SSD NameSpace fine-grained QoS device can be configured in a desktop computer, a tablet computer, a laptop computer, and other terminals. Specifically, the SSD NameSpace fine-grained QoS device includes:

[0064] An initialization unit, configured to initialize an initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens;

[0065] An allocation unit is used to allocate tokens in a token bucket to IO requests within a unit time, wherein if the number of tokens required by an IO request within a unit time is less than or equal to the number of tokens in the token bucket, tokens are allocated to all IO requests within the unit time; if the number of tokens required by an IO request within a unit time is greater than the number of tokens in the token bucket, tokens are allocated to some IO requests within the unit time until all tokens in the token bucket are allocated, and the some IO requests will obtain all the tokens currently in the token bucket;

[0066] The processing unit is used to process IO requests that have been allocated tokens. IO requests that have not been allocated tokens will not be processed temporarily. After the next round of token replenishment, tokens will be allocated and processed.

[0067] In some embodiments, the SSD NameSpace fine-grained QoS device further includes:

[0068] The replenishing unit is used to replenish tokens for the token bucket at each interval unit time.

[0069] In some embodiments, after the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity.

[0070] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0071] Get the time required to complete a single IO request;

[0072] The initial capacity is calculated by the formula initial capacity = IOPS current limiting threshold * time required to complete a single IO request.

[0073] In some embodiments, the time required to obtain a single IO request includes:

[0074] Calculates the time required for a single IO request based on the preset IOPS limit rate.

[0075] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0076] Obtain the time to complete the unit bandwidth according to the preset bandwidth limiting rate;

[0077] The initial capacity is calculated by the formula initial capacity = bandwidth limiting threshold * time to complete unit bandwidth.

[0078] In some embodiments, the SSD NameSpace fine-grained QoS device further includes:

[0079] A judging unit, used to judge whether the current limiting configuration information is adjusted;

[0080] The jump unit is used to jump to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information if the current limiting configuration information is adjusted.

[0081] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned SSD NameSpace fine-grained QoS device and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and conciseness of the description, it will not be repeated here.

[0082] The above-mentioned SSD NameSpace refined QoS device can be implemented in the form of a computer program, and the computer program can be used in the following manner: Figure 3 Runs on the computer device shown.

[0083] See also Figure 3 , Figure 3 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0084] The computer device 500 includes a processor 502 , a memory, and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0085] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a method for fine-tuning QoS of an SSD NameSpace.

[0086] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0087] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for fine-tuning QoS of SSD NameSpace.

[0088] The network interface 505 is used to communicate with other devices over a network. Those skilled in the art will appreciate that the above structure is only a block diagram of a portion of the structure related to the present application solution, and does not constitute a limitation on the computer device 500 to which the present application solution is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0089] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0090] Initializing an initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens;

[0091] Allocate tokens in the token bucket to IO requests within a unit time, wherein, if the number of tokens required by IO requests within a unit time is less than or equal to the number of tokens in the token bucket, then allocate tokens to all IO requests within the unit time; if the number of tokens required by IO requests within a unit time is greater than the number of tokens in the token bucket, then allocate tokens to some IO requests within the unit time until all tokens in the token bucket are allocated, and the said some IO requests will obtain all the tokens currently in the token bucket;

[0092] IO requests that have been allocated tokens will be processed, and IO requests that have not been allocated tokens will not be processed for the time being. After the next round of token replenishment, tokens will be allocated and processed.

[0093] In some embodiments, the method further comprises:

[0094] The token bucket is replenished with tokens at each unit time interval.

[0095] In some embodiments, after the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity.

[0096] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0097] Get the time required to complete a single IO request;

[0098] The initial capacity is calculated by the formula initial capacity = IOPS current limiting threshold * time required to complete a single IO request.

[0099] In some embodiments, the time required to obtain a single IO request includes:

[0100] Calculates the time required for a single IO request based on the preset IOPS limit rate.

[0101] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0102] Obtain the time to complete the unit bandwidth according to the preset bandwidth limiting rate;

[0103] The initial capacity is calculated by the formula initial capacity = bandwidth limiting threshold * time to complete unit bandwidth.

[0104] In some embodiments, the method further comprises:

[0105] Determining whether the current limiting configuration information is adjusted;

[0106] If the current limiting configuration information is adjusted, jump to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information.

[0107] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0108] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0109] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the following steps:

[0110] Initializing an initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens;

[0111] Allocate tokens in the token bucket to IO requests within a unit time, wherein, if the number of tokens required by IO requests within a unit time is less than or equal to the number of tokens in the token bucket, then allocate tokens to all IO requests within the unit time; if the number of tokens required by IO requests within a unit time is greater than the number of tokens in the token bucket, then allocate tokens to some IO requests within the unit time until all tokens in the token bucket are allocated, and the said some IO requests will obtain all the tokens currently in the token bucket;

[0112] IO requests that have been allocated tokens will be processed, and IO requests that have not been allocated tokens will not be processed for the time being. After the next round of token replenishment, tokens will be allocated and processed.

[0113] In some embodiments, the method further comprises:

[0114] The token bucket is replenished with tokens at each unit time interval.

[0115] In some embodiments, after the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity.

[0116] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0117] Get the time required to complete a single IO request;

[0118] The initial capacity is calculated by the formula initial capacity = IOPS current limiting threshold * time required to complete a single IO request.

[0119] In some embodiments, the time required to obtain a single IO request includes:

[0120] Calculates the time required for a single IO request based on the preset IOPS limit rate.

[0121] In some embodiments, initializing the initial capacity of the token bucket based on the current limiting configuration information includes:

[0122] Obtain the time to complete the unit bandwidth according to the preset bandwidth limiting rate;

[0123] The initial capacity is calculated by the formula initial capacity = bandwidth limiting threshold * time to complete unit bandwidth.

[0124] In some embodiments, the method further comprises:

[0125] Determining whether the current limiting configuration information is adjusted;

[0126] If the current limiting configuration information is adjusted, jump to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information.

[0127] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which can store program codes. The computer-readable storage medium can be non-volatile or volatile.

[0128] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0129] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0130] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially 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. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0132] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

[0134] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for fine-grained QoS of SSD NameSpace, characterized in that: include: Initializing an initial capacity of a token bucket based on current limiting configuration information, wherein the token bucket contains tokens; Allocate tokens in the token bucket to IO requests within a unit time, wherein, if the number of tokens required by IO requests within a unit time is less than or equal to the number of tokens in the token bucket, then allocate tokens to all IO requests within the unit time; if the number of tokens required by IO requests within a unit time is greater than the number of tokens in the token bucket, then allocate tokens to some IO requests within the unit time until all tokens in the token bucket are allocated, and the said some IO requests will obtain all the tokens currently in the token bucket; IO requests that have been allocated tokens will be processed, and IO requests that have not been allocated tokens will not be processed for the time being. After the next round of token replenishment, tokens will be allocated and processed.

2. The method for fine-grained QoS of SSD NameSpace according to claim 1, characterized in that: The method further comprises: The token bucket is replenished with tokens at each unit time interval.

3. The method for fine-grained QoS of SSD NameSpace according to claim 2, characterized in that: After the tokens are replenished, the number of tokens contained in the token bucket is less than or equal to the initial capacity.

4. The method for fine-grained QoS of SSD NameSpace according to claim 1, characterized in that: Initializing the initial capacity of the token bucket based on the current limiting configuration information includes: Get the time required to complete a single IO request; The initial capacity is calculated by the formula initial capacity=IOPS current limiting threshold*time required to complete a single IO request.

5. The method for fine-grained QoS of SSD NameSpace according to claim 4, characterized in that: The time required to obtain a single IO request includes: Calculates the time required for a single IO request based on the preset IOPS limit rate.

6. The method for fine-grained QoS of SSD NameSpace according to claim 1, characterized in that: Initializing the initial capacity of the token bucket based on the current limiting configuration information includes: Obtain the time to complete the unit bandwidth according to the preset bandwidth limiting rate; The initial capacity is calculated by the formula initial capacity = bandwidth limiting threshold * time to complete unit bandwidth.

7. The method for fine-grained QoS of SSD NameSpace according to claim 1, characterized in that: The method further comprises: Determining whether the current limiting configuration information is adjusted; If the current limiting configuration information is adjusted, jump to the step of initializing the initial capacity of the token bucket based on the current limiting configuration information.

8. A device for fine-grained QoS of SSD NameSpace, characterized in that: The method comprises a unit for executing the method according to any one of claims 1 to 7.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 can be implemented.

Citation Information

Patent Citations

  • Token bucket-based current limiting method and device, computing equipment and medium

    CN113765820A

  • Data processing method and device, computer equipment and computer readable storage medium

    CN115277577A

  • Service flow control method and device, electronic equipment and readable storage medium

    CN115604191A

  • Fault injection method and device for solid state disk, computer equipment and storage medium

    CN115934395A

  • Rate Control By Token Buckets

    US20150036503A1