Logical volume service quality control method, device, equipment and medium

By combining the sliding window and the token bucket, the current limiting and stable flow of the distributed storage system is realized, the tolerance of burst traffic is improved, the problems of poor current limiting effect and business request failure in the existing technology are solved, and the efficiency is improved Service quality and stability of distributed storage systems.

CN114785739BActive Publication Date: 2024-10-18DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210430473.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2024-10-18
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

When existing distributed storage systems face sudden traffic, the token bucket method has poor current limiting effect, while the leaky bucket method causes business request processing failure due to constant business processing speed, making it difficult to improve service quality.

Method used

By combining the sliding window and the token bucket, the number of processed business requests within the sliding window is obtained, and it is judged whether the preset conditions are met. If the preset conditions are met, a token acquisition request is sent, and the business request is executed after the token is successfully obtained. If the preset conditions are not met, the business request is executed. Add the request to the business request cache queue and wait for processing to ensure current limiting and stable flow, and improve the ability to tolerate burst traffic.

Benefits of technology

It effectively avoids business request failures, improves the service quality and stability of the distributed storage system, reduces the pressure of sudden traffic on the system, and improves the probability of successful processing of business requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114785739B_ABST
    Figure CN114785739B_ABST
Patent Text Reader

Abstract

The present invention discloses a control method, device, equipment and medium for the service quality of a logical volume, the method comprising: when receiving a current service request for a target logical volume, if it is determined that there is no unprocessed historical service request for the target logical volume, then obtaining the number of service requests processed by the sliding window corresponding to the target logical volume within the current sliding cycle; then, when it is determined that the number of processed service requests meets a preset service request number detection condition, sending a token acquisition request to a token bucket corresponding to the target logical volume; when it is detected that the token is successfully acquired, executing the current service request based on multiple storage nodes corresponding to the target logical volume. The technical solution of this embodiment, by combining a sliding window and a token bucket, can improve the tolerance to burst service traffic while achieving current limiting and steady flow, thereby improving the service quality of the distributed storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, equipment and medium for controlling the quality of service of a logical volume. Background Art

[0002] QoS (Quality of Service) refers to a network's ability to use various basic technologies to provide better service capabilities for specified network communications. In the storage field, QoS refers to the ability to allocate input and output data flows according to weights based on storage system configuration, thereby improving the storage system's service quality to meet application needs.

[0003] At present, QoS control of distributed storage is usually based on logical volumes. Different QoS policies are set for different logical volumes to achieve service quality management of storage resources. Among them, the existing QoS control methods mainly include token bucket method and leaky bucket method; however, for the token bucket method, its flow limiting effect for burst traffic is poor, and for the leaky bucket method, due to its constant service processing speed, there will be a large number of service request processing failures when facing burst traffic. Therefore, it is difficult to improve the service quality of distributed storage systems based on existing technologies. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and medium for controlling the service quality of a logical volume, which can improve the tolerance to sudden business traffic while achieving flow limiting and flow stabilization, thereby improving the service quality of a distributed storage system.

[0005] In a first aspect, an embodiment of the present invention provides a method for controlling the quality of service of a logical volume, comprising:

[0006] When a current service request for a target logical volume is received, if it is determined that the target logical volume does not have any unprocessed historical service requests, then obtaining the number of service requests processed by the sliding window corresponding to the target logical volume within the current sliding period;

[0007] Determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume;

[0008] When it is detected that the token is successfully acquired, the current service request is executed based on at least one storage node corresponding to the target logical volume.

[0009] Optionally, before executing the current service request based on at least one storage node corresponding to the target logical volume, the method further includes:

[0010] The current service request is added to the service request cache queue corresponding to the preset leaky bucket, and each service request in the service request cache queue corresponding to the preset leaky bucket is processed according to the preset service request processing speed.

[0011] The above technical solution can avoid the business requests corresponding to each logical volume being sent directly to the storage pool, causing the business processing pressure to exceed the storage pool's tolerance range, thereby reducing the probability of business request processing failure and improving the service quality of the distributed storage system.

[0012] Optionally, before processing each service request in the service request cache queue corresponding to the preset leaky bucket according to the preset service request processing speed, the method further includes:

[0013] Obtaining the service request processing performance matched by the storage pool corresponding to the preset leaky bucket, and setting the preset service request processing speed corresponding to the preset leaky bucket according to the service request processing performance;

[0014] The preset leaky bucket corresponds to the storage pool one by one, and the storage pool includes at least one storage node.

[0015] By adopting the above technical solution, the setting accuracy of the preset business request processing speed can be improved, the probability of business request processing failure can be further reduced, and the stability of the distributed storage system can be improved.

[0016] Optionally, the technical solution of the embodiment of the present invention further includes:

[0017] At preset time intervals, determining whether the number of tokens in the token bucket corresponding to the target logical volume is greater than or equal to a preset token number threshold;

[0018] If not, a preset number of tokens are added to the token bucket corresponding to the target logical volume.

[0019] By adopting the above technical solution, real-time replenishment of tokens in the token bucket can be achieved, thereby ensuring the processing efficiency of business requests, avoiding the failure of business request processing due to lack of tokens, and improving the probability of successful processing of business requests.

[0020] Optionally, obtaining the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period includes:

[0021] Acquire at least one sub-window of the sliding window corresponding to the target logical volume within a current sliding period according to a preset sub-window length;

[0022] Obtaining the number of processed service requests corresponding to each of the sub-windows through a preset request counter corresponding to each of the sub-windows;

[0023] According to the number of processed business requests corresponding to each of the sub-windows, the number of processed business requests of the sliding window corresponding to the target logical volume in the current sliding period is obtained.

[0024] By adopting the above technical solution, the number of processed business requests corresponding to each sub-window in the sliding window can be accurately obtained, the tolerance for fluctuations in the number of business requests can be improved, and the control accuracy of business request processing can be improved.

[0025] Optionally, after receiving the current service request for the target logical volume, the method further includes:

[0026] If it is determined that the target logical volume has unprocessed historical service requests, the current service request is added to the service request cache queue corresponding to the target logical volume, and waits until all historical service requests in the service request cache queue corresponding to the target logical volume are processed.

[0027] By adopting the above solution, the probability of business request processing failure can be further reduced, the tolerance for a large number of sudden business requests can be improved, the stability of the distributed storage system can be further improved, and thus the service quality of the distributed storage system can be further improved.

[0028] Optionally, after sending the token acquisition request to the token bucket corresponding to the target logical volume, the method further includes:

[0029] If it is detected that the token has not been successfully acquired, when it is detected that the sliding window corresponding to the target logical volume starts to slide in a preset direction, a token acquisition request is resent to the token bucket corresponding to the target logical volume until the token issued by the token bucket corresponding to the target logical volume is successfully acquired; wherein the sliding window corresponding to the target logical volume slides in a preset direction by a preset step size at every preset time interval.

[0030] By adopting the above solution, the number of times invalid token acquisition requests are sent can be reduced, and the probability of successfully acquiring a token can be increased.

[0031] In a second aspect, an embodiment of the present invention further provides a control device for logical volume service quality, including:

[0032] A module for obtaining the number of processed business requests, for obtaining the number of processed business requests of the sliding window corresponding to the target logical volume within the current sliding period when receiving a current business request for the target logical volume and determining that the target logical volume does not have any unprocessed historical business requests;

[0033] A token acquisition request sending module is used to determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume;

[0034] The request execution module is used to execute the current service request based on at least one storage node corresponding to the target logical volume when it is detected that the token is successfully acquired.

[0035] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0036] one or more processors;

[0037] a memory for storing one or more programs,

[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for controlling the quality of service of a logical volume as described in any embodiment of the present invention.

[0039] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for controlling the quality of service of a logical volume as described in any embodiment of the present invention.

[0040] The technical solution provided by the embodiment of the present invention, when receiving a current business request for a target logical volume, if it is determined that there are no unprocessed historical business requests for the target logical volume, then the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period is obtained; then, when it is determined that the number of processed business requests meets the preset business request number detection condition, a token acquisition request is sent to the token bucket corresponding to the target logical volume; when it is detected that the token is successfully acquired, the current business request is executed based on multiple storage nodes corresponding to the target logical volume; by combining the sliding window and the token bucket, the tolerance for sudden business traffic can be improved while achieving current limiting and stabilization, thereby improving the service quality of the distributed storage system. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1A It is a flow chart of a method for controlling the quality of service of a logical volume provided by the first embodiment of the present invention;

[0042] Figure 1B is a schematic diagram of sliding of a sliding window provided in the first embodiment of the present invention;

[0043] Figure 1C It is a schematic diagram of the process of issuing tokens of a token bucket provided in the first embodiment of the present invention;

[0044] Figure 2AIt is a flow chart of a method for controlling the quality of service of a logical volume provided by the second embodiment of the present invention;

[0045] Figure 2B This is a schematic diagram of the process of business processing of a preset leaky bucket provided in the second embodiment of the present invention;

[0046] Figure 3A is a flow chart of a method for controlling the quality of service of a logical volume provided by Embodiment 3 of the present invention;

[0047] Figure 3B It is a schematic diagram of the process of sliding the sliding window and consuming and replenishing the token provided in the third embodiment of the present invention;

[0048] Figure 3C It is a flow chart of a method for controlling the quality of service of a logical volume provided by Embodiment 3 of the present invention;

[0049] Figure 4 It is a structural block diagram of a control device for logical volume service quality provided by a fourth embodiment of the present invention;

[0050] Figure 5 This is a structural block diagram of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0051] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0052] Embodiment 1

[0053] Figure 1A This is a flow chart of a method for controlling the quality of service of a logical volume provided in the first embodiment of the present invention. The embodiment of the present invention is applicable to the case where the quality of service of a logical volume is controlled. The method can be executed by a device for controlling the quality of service of a logical volume in the embodiment of the present invention. The device can be implemented by software and / or hardware and integrated in an electronic device, typically a computer device or a server. The method specifically includes the following steps:

[0054] S110. When a current service request for a target logical volume is received, if it is determined that the target logical volume has no unprocessed historical service requests, the number of processed service requests of the sliding window corresponding to the target logical volume in the current sliding period is obtained.

[0055] The target logical volume (Logical Unit Number, LUN) is the logical volume that needs to be accessed currently; the logical volume can be a virtual disk formed by a logical disk, for example, in a computer device, the logical volume can be a partitioned disk. In this embodiment, the logical volume can be a virtual disk formed by re-partitioning the storage resources of multiple storage nodes. Since the logical volume is a storage service unit of the application layer, the logical volume needs to provide corresponding storage services according to the user's application requirements and ensure a certain storage service quality.

[0056] The current service request for the target logical volume may be an I / O (Input / Output) request of the application layer; typically, it may be a read / write operation request for the target logical volume, for example, a request to add, delete, modify or search for an operation in the target logical volume. In this embodiment, when a current service request for the target logical volume is detected, it may be first determined whether there are any unprocessed historical service requests for the target logical volume. If it is determined that there are no unprocessed historical service requests, it means that all service requests before the current service request have successfully obtained tokens or have been processed; at this time, the number of service requests processed in the sliding window corresponding to the target logical volume within the current sliding period may be obtained.

[0057] In this embodiment, a corresponding sliding window is pre-set for each logical volume; the parameters of the sliding window may include information such as the length of the sliding window, the length of the sub-window, the sliding interval, and the sliding step. In addition, each sliding window is pre-set with a corresponding service processing quantity counter to count the number of processed service requests in each sliding cycle. Therefore, when the current service request is obtained, the current sliding cycle of the sliding window corresponding to the target logical volume can be determined according to the current local system time; and then the number of processed service requests in the current sliding cycle can be obtained through the pre-set service processing quantity counter.

[0058] The sliding window can be shown as follows: Figure 1B As shown. Specifically, a sliding window is composed of several equal small windows, each of which corresponds to a different time point and has an independent business processing quantity counter. When the time point of the business request is greater than the maximum time point of the current sliding cycle of the sliding window, the sliding window is shifted forward by one small window, and the business request now corresponds to the last small window.

[0059] It should be noted that in each sliding cycle, the number of all processed service requests needs to be less than the preset number, thereby ensuring the smooth processing of service requests and achieving effective flow control for a large number of burst service requests. The more sub-windows are divided, the better the flow control effect on service requests and the smoother the processing of service requests.

[0060] S120, determining whether the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period meets a preset business request number detection condition; if so, sending a token acquisition request to the token bucket corresponding to the target logical volume.

[0061] Among them, the preset business request quantity detection condition can be a pre-set condition for determining whether the number of processed business requests within the sliding period exceeds the tolerable range of the target logical volume; for example, the number of processed business requests within the sliding period can be less than the preset business request quantity threshold, that is, the number of business requests that can be processed within a period of time remains constant.

[0062] In a specific example, if it is determined that the number of processed business requests in the current sliding period is less than the preset business request number threshold, it means that the number of business requests that can be processed in the current sliding period has not been exceeded, that is, the current business request can be processed. The advantage of the above setting is that by setting the preset business request number detection condition, the number of business requests processed within a certain period of time can be ensured to remain constant, thereby achieving effective flow control of business request traffic.

[0063] It should be noted that before processing the current business request, the current business request also needs to obtain the corresponding token (Token), and only business requests that successfully obtain the corresponding token will be processed. Therefore, after determining that the number of processed business requests in the current sliding cycle meets the preset business request number detection condition, it is also necessary to send a token acquisition request to the token bucket corresponding to the target logical volume to request to obtain the token corresponding to the current business request.

[0064] In this embodiment, a corresponding token bucket is pre-set for each logical volume, and the token bucket can issue corresponding tokens to each service request. The maximum number of tokens that can be stored in the token bucket is fixed, and the tokens in the token bucket can be replenished according to a preset token replenishment speed.

[0065] In a specific example, the token issuance process of the token bucket can be as follows: Figure 1CAs shown. Specifically, the system adds tokens to the token bucket according to a specified strategy (for example, uniform speed). In addition, after receiving a business request, it first requests the token bucket to obtain a token. Only business requests that successfully obtain a token will be processed later. For business requests that fail to successfully obtain a token, they can be suspended (added to a preset cache queue) or discarded. By controlling the token generation rate, the processing rate of business requests can be effectively controlled.

[0066] S130: When it is detected that the token is successfully acquired, the current service request is executed based on at least one storage node corresponding to the target logical volume.

[0067] In a distributed storage system, the target logical volume may correspond to one or more storage nodes in a storage pool. In this embodiment, after successfully acquiring the token, the current service request may be executed based on the multiple storage nodes corresponding to the target logical volume to modify the storage content of each storage node accordingly.

[0068] The technical solution provided by the embodiment of the present invention, when receiving a current business request for a target logical volume, if it is determined that there are no unprocessed historical business requests for the target logical volume, then the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period is obtained; then, when it is determined that the number of processed business requests meets the preset business request number detection condition, a token acquisition request is sent to the token bucket corresponding to the target logical volume; when it is detected that the token is successfully acquired, the current business request is executed based on multiple storage nodes corresponding to the target logical volume; by combining the sliding window and the token bucket, the tolerance for sudden business traffic can be improved while achieving current limiting and stabilization, thereby improving the service quality of the distributed storage system.

[0069] In an optional implementation of the present embodiment, the technical solution of the present embodiment may also include: at each preset time interval, determining whether the number of tokens in the token bucket corresponding to the target logical volume is greater than or equal to a preset token number threshold; if not, adding a preset number of tokens to the token bucket corresponding to the target logical volume.

[0070] The preset time may be a preset interval for adding tokens to the token bucket, which may be equal to the sliding interval of the sliding window. The preset token quantity threshold may be a value obtained by subtracting the preset quantity from the maximum token quantity of the token bucket. The preset quantity is a preset quantity of tokens added to the token bucket each time.

[0071] In this embodiment, when the number of tokens in the token bucket corresponding to the target logical volume is less than the preset token number threshold, a preset number of tokens is added to the token bucket, and the maximum token number of the token bucket will not be exceeded. Therefore, at each preset time interval, when it is determined that the number of tokens in each token bucket is less than the preset token number threshold, a preset number of tokens is added to each token bucket.

[0072] The advantage of the above setting is that it can achieve real-time replenishment of tokens in the token bucket, thereby ensuring the processing efficiency of each business request, avoiding the failure of business request processing due to lack of tokens, and improving the probability of successful processing of business requests.

[0073] In another optional implementation of the present embodiment, after receiving the current business request for the target logical volume, it may also include: if it is determined that there are unprocessed historical business requests for the target logical volume, the current business request is added to the business request cache queue corresponding to the target logical volume, and waits for all historical business requests in the business request cache queue corresponding to the target logical volume to be processed.

[0074] It should be noted that, limited by the maximum number of business processing within the sliding window or the number of tokens in the token bucket, the business request for the target logical volume may not be processed in real time, that is, there is a delay in the processing of the business request. In this embodiment, for business requests that cannot be processed in real time, they can be stored as historical business requests in the business request cache queue corresponding to the target logical volume. Furthermore, each business request in the business request cache queue can be processed in turn based on the first-in-first-out rule.

[0075] In this embodiment, if it is determined that there are currently unprocessed historical service requests for the target logical volume, the current service request cannot be processed in real time, and it can be added to the service request cache queue corresponding to the target logical volume to wait in line for processing. When all historical service requests before the current service request in the service request cache queue are processed, the current service request will be processed.

[0076] In addition, when the number of processed business requests within the current sliding period is greater than or equal to the preset business request number threshold, or the token is not successfully acquired, the current business request can also be suspended, that is, added to the business request cache queue corresponding to the target logical volume to wait for processing.

[0077] In this embodiment, by combining the sliding window and the token bucket, requests within a period of time can be smoothly dispersed to each moment, the service quality of the logical volume can be kept stable, and the stability of the service quality of the logical volume can be improved.

[0078] Embodiment 2

[0079] Figure 2A A flowchart of a method for controlling the quality of service of a logical volume provided in the second embodiment of the present invention is concretized on the basis of the above embodiment. In this embodiment, before executing the current service request based on multiple storage nodes corresponding to the target logical volume, the current service request is added to the service request cache queue corresponding to the preset leaky bucket, and each service request in the service request cache queue corresponding to the preset leaky bucket is processed according to the preset service request processing speed. The method specifically includes:

[0080] S210. When a current service request for a target logical volume is received, if it is determined that the target logical volume has no unprocessed historical service requests, the number of processed service requests of the sliding window corresponding to the target logical volume in the current sliding period is obtained.

[0081] In an optional implementation of the present embodiment, obtaining the number of processed business requests of the sliding window corresponding to the target logical volume within the current sliding period may include: obtaining at least one sub-window of the sliding window corresponding to the target logical volume within the current sliding period according to a preset sub-window length; obtaining the number of processed business requests corresponding to each sub-window through a preset request counter corresponding to each sub-window; and obtaining the number of processed business requests of the sliding window corresponding to the target logical volume within the current sliding period according to the number of processed business requests corresponding to each sub-window.

[0082] In this embodiment, the sliding window in a sliding cycle can be divided into a number of equally divided sub-windows based on the preset sub-window length, and an independent request counter can be configured for each sub-window. For example, if the length of the sliding window is 60 seconds and the preset sub-window length is 10 seconds, the sliding window can be divided into 6 sub-windows. Thus, the number of processed service requests in each sub-window can be counted by the preset request counter corresponding to each sub-window, and then the number of processed service requests in each sub-window can be added to obtain the total number of processed service requests of the sliding window in the current sliding cycle.

[0083] It is worth noting that fluctuations in the number of business requests are allowed within the sliding window, that is, the number of processed business requests in certain sub-windows is allowed to be greater than or less than the average number, or even zero, as long as the total number of processed business requests within a sliding cycle meets the preset business request number detection conditions.

[0084] S220, determining whether the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period meets a preset business request number detection condition; if so, sending a token acquisition request to the token bucket corresponding to the target logical volume.

[0085] S230. When it is detected that the token is successfully acquired, the current business request is added to the business request cache queue corresponding to the preset leaky bucket, and each business request in the business request cache queue corresponding to the preset leaky bucket is processed according to a preset business request processing speed.

[0086] The preset service request processing speed is the number of service requests processed per unit time. In this embodiment, since the storage quality of the storage pool is fixed, a preset leaky bucket is added before the storage pool, and service requests of different logical volumes are first added to the service request cache queue of the preset leaky bucket, and then each service request is processed according to the preset service request processing speed.

[0087] In a specific example, the business process flow of the preset leaky bucket can be as follows Figure 2B Specifically, the I / O service queue corresponding to the logical volume LUN 1 and the I / O service queue corresponding to the logical volume LUN 2 are both added to the service request cache queue of the preset leaky bucket. Then, the preset leaky bucket processes each service request in the service request cache queue in turn according to a constant service request processing speed and a first-in-first-out rule.

[0088] It is worth noting that if no business request is added to the preset leaky bucket, the processing will be by-passed; in addition, even if more business requests are accumulated in the preset leaky bucket, the processing speed of business requests cannot be increased to avoid the processing speed of business requests exceeding the tolerance of the storage node. In this embodiment, by setting a preset leaky bucket corresponding to the storage pool, it is possible to avoid the business requests corresponding to each logical volume being directly sent to the storage pool, resulting in the business processing pressure exceeding the tolerance of the storage pool, thereby reducing the probability of failed processing of business requests and improving the service quality of the distributed storage system.

[0089] In another optional implementation of the present embodiment, before processing each business request in the business request cache queue corresponding to the preset leaky bucket according to the preset business request processing speed, it may also include: obtaining the business request processing performance matched by the storage pool corresponding to the preset leaky bucket, and setting the preset business request processing speed corresponding to the preset leaky bucket according to the business request processing performance; wherein the preset leaky bucket corresponds one-to-one to the storage pool, and the storage pool includes at least one storage node.

[0090] The storage pool may be composed of multiple storage nodes, and each storage node may be a storage device, such as a hard disk, memory, etc. It is understandable that the hardware resources of each storage node in the storage pool are fixed, that is, the number of business requests that the storage pool can bear per unit time is fixed, that is, the storage service quality that the storage pool can provide is fixed.

[0091] Therefore, the service request processing performance matched by the storage pool can be obtained, that is, the number of service requests that can be tolerated per unit time, and the preset service request processing speed can be set according to the service request processing performance. Through the above settings, the setting accuracy of the preset service request processing speed can be improved, the probability of failed processing of service requests can be further reduced, and the stability of the distributed storage system can be further improved.

[0092] S240. Execute the current service request based on at least one storage node corresponding to the target logical volume.

[0093] The technical solution provided by the embodiment of the present invention can avoid the situation where the business processing pressure exceeds the tolerable range of the storage pool by adding the current business request to the business request cache queue corresponding to the preset leaky bucket before executing the current business request based on multiple storage nodes corresponding to the target logical volume, and processing each business request in the business request cache queue corresponding to the preset leaky bucket according to the preset business request processing speed. This can reduce the probability of failed processing of business requests and improve the service quality of the distributed storage system.

[0094] In another optional implementation of the present embodiment, after sending a token acquisition request to the token bucket corresponding to the target logical volume, it may also include: if it is detected that the token is not successfully acquired, then when it is detected that the sliding window corresponding to the target logical volume starts to slide in a preset direction, the token acquisition request is re-sent to the token bucket corresponding to the target logical volume until the token issued by the token bucket corresponding to the target logical volume is successfully acquired.

[0095] The sliding window corresponding to the target logical volume slides in a preset direction by a preset step length at every preset time interval. The preset time may be a preset sliding interval of the sliding window. The preset direction is a preset sliding direction of the sliding window. In this embodiment, the preset direction may be a direction in which time increases on the time axis. The preset step length may be the length of time for each movement of the sliding window.

[0096] Optionally, the preset step size may be equal to the preset sub-window length; for example, if the window length of the sliding window is 60 seconds and the preset sub-window length is 10 seconds, the preset step size may also be 10 seconds, that is, the sliding window slides forward one sub-window at every preset time interval.

[0097] In this embodiment, if the token is not successfully acquired, it means that the tokens in the token bucket corresponding to the target logical volume have been exhausted. At this time, the current service request can be added to the service request cache queue corresponding to the target logical volume to wait for the token to be replenished before processing it. Since the token bucket replenishes tokens once every preset time, that is, the token bucket replenishes tokens once every time the sliding window moves. Therefore, when it is detected that the sliding window starts to slide, a token acquisition request can be resent to the token bucket corresponding to the target logical volume to ensure that the token can be successfully acquired.

[0098] In this embodiment, by re-requesting a token from the token bucket corresponding to the target logical volume when it is detected that the sliding window starts to slide, the number of times that invalid token acquisition requests are sent can be reduced, and the probability of successfully acquiring a token can be increased.

[0099] Embodiment 3

[0100] Figure 3A A flowchart of a method for controlling the quality of service of a logical volume provided in the third embodiment of the present invention is concretized on the basis of the above-mentioned embodiments. In this embodiment, if it is detected that the token is successfully acquired, the current service request is added to the service request cache queue corresponding to the preset leaky bucket, and each service request in the service request cache queue corresponding to the preset leaky bucket is processed according to the preset service request processing speed; if it is detected that the token is not successfully acquired, when it is detected that the sliding window corresponding to the target logical volume starts to slide in the preset direction, the token acquisition request is resent to the token bucket corresponding to the target logical volume until the token issued by the token bucket corresponding to the target logical volume is successfully acquired. The method specifically includes:

[0101] S310, start, and execute S320.

[0102] S320, receiving a current service request for the target logical volume, and executing S330.

[0103] S330: Determine whether there are any unprocessed historical business requests for the target logical volume.

[0104] If not, execute S340; if yes, execute S360. Specifically, when there are unprocessed historical business requests for the target logical volume, the current business request cannot be processed directly. At this time, the current business request needs to be added to the business request cache queue corresponding to the target logical volume. When there are no unprocessed historical business requests for the target logical volume, you can try to obtain a token, and process the current business request when the token is successfully obtained.

[0105] S340. Obtain the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period, and execute S350.

[0106] S350. When it is determined that the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period meets a preset business request number detection condition, a token acquisition request is sent to the token bucket corresponding to the target logical volume, and S370 is executed.

[0107] In addition, if it is detected that the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding cycle does not meet the preset service request number detection condition, it means that the number of service requests processed in the current sliding cycle has exceeded the service processing pressure that the target logical volume can bear. At this time, it is impossible to request to obtain a token in real time, and the current service request can be processed in the next sliding cycle when it is detected that the sliding window starts to slide.

[0108] In a specific example, the sliding of the sliding window and the consumption and replenishment of tokens can be as follows: Figure 3B As shown. Among them, a sliding window includes 6 sliding sub-windows, and the sliding window moves forward one sliding sub-window each time, and the initial number of tokens in the token bucket is 6. In the first sliding cycle, 3 business requests are received and 3 tokens are consumed. When the sliding window slides to the second sliding cycle, 1 token is automatically added to the token bucket. No business request is received in the current sliding cycle, so no token is consumed. At this time, 4 tokens remain in the token bucket. When the sliding window continues to slide to the third sliding cycle, 1 token is added to the token bucket. A total of 5 business requests are received in the current sliding cycle, so 5 tokens are consumed. At this time, 0 tokens remain in the token bucket. Further, the above process is repeated, and 1 token is added to the token bucket each time the sliding window starts to slide.

[0109] Among them, when the number of business requests within a sliding cycle is greater than the number of existing tokens in the token bucket, the business requests obtained later will be added to the business request cache queue of the target logical volume to wait for the sliding window to slide to the next sliding cycle when tokens are replenished, and then request to obtain the corresponding token.

[0110] S360: Add the current service request to the service request cache queue corresponding to the target logical volume, wait until all historical service requests in the service request cache queue corresponding to the target logical volume are processed, and return to execute S330.

[0111] S370: Determine whether the token is successfully acquired.

[0112] If the token is not successfully obtained, execute S380; if the token is successfully obtained, execute S390.

[0113] S380. When it is detected that the sliding window corresponding to the target logical volume starts to slide in a preset direction, return to execute S350.

[0114] S390, adding the current business request to the business request cache queue corresponding to the preset leaky bucket, and processing each business request in the business request cache queue corresponding to the preset leaky bucket according to the preset business request processing speed, and executing S3100.

[0115] S3100. When it is detected that the current service request starts to be processed, the current service request is executed based on at least one storage node corresponding to the target logical volume, and S3110 is executed.

[0116] S3110, end.

[0117] The technical solution provided by the embodiment of the present invention receives a current business request for a target logical volume, and when it is determined that there is no unprocessed historical business request for the target logical volume, obtains the number of business requests processed by the sliding window corresponding to the target logical volume within the current sliding period; then, when it is determined that the number of business requests processed by the sliding window corresponding to the target logical volume within the current sliding period meets a preset business request number detection condition, sends a token acquisition request to the token bucket corresponding to the target logical volume; then, after successfully acquiring the token, adds the current business request to the business request cache queue corresponding to the preset leaky bucket, and processes the business request corresponding to the preset leaky bucket according to the preset business request processing speed. Each business request in the business request cache queue is processed; finally, when it is detected that the current business request starts to be processed, the current business request is executed based on multiple storage nodes corresponding to the target logical volume; by setting the preset business request quantity detection conditions and token buckets, the stability of the logical volume service quality within the sliding window time can be guaranteed, and a large number of sudden business requests can be successfully responded to; in addition, by setting a preset leaky bucket, the service quality of each logical volume can be controlled within the capacity of the storage node; through the above settings, the logical volume service quality can be effectively controlled, and each logical volume can provide stable and reliable service quality within the capacity of distributed storage.

[0118] In a specific implementation of this embodiment, the process of the method for controlling the quality of service of a logical volume can be as follows: Figure 3CAs shown. Specifically, first, the service requests of different logical volumes are accessed through multiple pre-set Hosts and mapped to different logical volumes. It is worth noting that before the service request is sent to the corresponding logical volume, the LUNQos (logical volume service quality) control method is used to process each service request. Specifically, first determine whether there are unprocessed historical service requests for the target logical volume. If it is determined that there are no unprocessed historical service requests, then when the number of processed service requests within the current sliding period meets the preset service request number detection condition, obtain a token from the token bucket corresponding to the target logical volume.

[0119] Then, before executing the current service request based on multiple storage nodes corresponding to the target logical volume, the NodeQos (storage node service quality) control method is used to process the service requests of each logical volume that successfully obtains the token. Specifically, each service request is added to the service request cache queue corresponding to the preset leaky bucket, and each service request in the service request cache queue corresponding to the preset leaky bucket is processed according to the preset service request processing speed.

[0120] In this embodiment, by combining the LUN Qos control method and the Node Qos control method, the effective regulation of the logical volume service quality can be achieved. While effectively reducing business fluctuations (the business fluctuation range is 1%-2%), it can avoid the situation where the business processing pressure exceeds the storage pool's tolerance when there are a large number of sudden business requests for multiple logical volumes, thereby improving the stability of the distributed storage system's service quality.

[0121] Embodiment 4

[0122] Figure 4 The structure block diagram of a control device for the quality of service of a logical volume provided in the fourth embodiment of the present invention, the device specifically comprises: a module 410 for obtaining the number of service requests processed, a module 420 for sending a token acquisition request, and a module 430 for executing a request; wherein,

[0123] The processed service request number acquisition module 410 is used for, when receiving a current service request for a target logical volume, if it is determined that the target logical volume does not have any unprocessed historical service requests, to acquire the number of processed service requests of the sliding window corresponding to the target logical volume within the current sliding period;

[0124] The token acquisition request sending module 420 is used to determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets the preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume;

[0125] The request execution module 430 is used to execute the current service request based on at least one storage node corresponding to the target logical volume when it is detected that the token is successfully acquired.

[0126] The technical solution provided by the embodiment of the present invention, when receiving a current business request for a target logical volume, if it is determined that there are no unprocessed historical business requests for the target logical volume, then the number of processed business requests in the sliding window corresponding to the target logical volume within the current sliding period is obtained; then, when it is determined that the number of processed business requests meets the preset business request number detection condition, a token acquisition request is sent to the token bucket corresponding to the target logical volume; when it is detected that the token is successfully acquired, the current business request is executed based on multiple storage nodes corresponding to the target logical volume; by combining the sliding window and the token bucket, the tolerance for sudden business traffic can be improved while achieving current limiting and stabilization, thereby improving the service quality of the distributed storage system.

[0127] Optionally, based on the above technical solution, the control device for the logical volume service quality further includes:

[0128] The preset leaky bucket processing module is used to add the current business request to the business request cache queue corresponding to the preset leaky bucket, and process each business request in the business request cache queue corresponding to the preset leaky bucket according to the preset business request processing speed.

[0129] Optionally, based on the above technical solution, the control device for the logical volume service quality further includes:

[0130] A preset business request processing speed setting module is used to obtain the business request processing performance matched by the storage pool corresponding to the preset leaky bucket, and set the preset business request processing speed corresponding to the preset leaky bucket according to the business request processing performance; wherein the preset leaky bucket corresponds one-to-one to the storage pool, and the storage pool includes at least one storage node.

[0131] Optionally, based on the above technical solution, the control device for the logical volume service quality further includes:

[0132] The token adding module is used to determine whether the number of tokens in the token bucket corresponding to the target logical volume is greater than or equal to a preset token number threshold at each preset time interval; if not, add a preset number of tokens to the token bucket corresponding to the target logical volume.

[0133] Optionally, based on the above technical solution, the module 410 for obtaining the number of processed business requests includes:

[0134] A sub-window acquiring unit, configured to acquire at least one sub-window of the sliding window corresponding to the target logical volume within a current sliding period according to a preset sub-window length;

[0135] A sub-window processed service request number acquisition unit, used to acquire the number of processed service requests corresponding to each sub-window through a preset request counter corresponding to each sub-window;

[0136] The processed service request quantity acquisition unit is used to acquire the processed service request quantity of the sliding window corresponding to the target logical volume in the current sliding cycle according to the processed service request quantity corresponding to each sub-window.

[0137] Optionally, based on the above technical solution, the control device for the quality of service of the logical volume further includes:

[0138] The waiting processing module is used to add the current business request to the business request cache queue corresponding to the target logical volume if it is determined that there are unprocessed historical business requests for the target logical volume, and wait for all historical business requests in the business request cache queue corresponding to the target logical volume to be processed.

[0139] Optionally, based on the above technical solution, the control device for the quality of service of the logical volume further includes:

[0140] A token re-request module is used to, if it is detected that the token has not been successfully acquired, re-send a token acquisition request to the token bucket corresponding to the target logical volume when it is detected that the sliding window corresponding to the target logical volume begins to slide in a preset direction, until the token issued by the token bucket corresponding to the target logical volume is successfully acquired; wherein the sliding window corresponding to the target logical volume slides in a preset direction by a preset step size at every preset time interval.

[0141] The control device for the logical volume service quality provided by the embodiment of the present invention can execute the control method for the logical volume service quality provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0142] Embodiment 5

[0143] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention is shown in FIG. Figure 5 As shown, the electronic device includes a processor 50, a memory 51, an input device 52 and an output device 53; the number of processors 50 in the electronic device can be one or more. Figure 5 A processor 50 is taken as an example; the processor 50, the memory 51, the input device 52 and the output device 53 in the electronic device can be connected by a bus or other means. Figure 5The example of connecting through bus is taken in the following.

[0144] The memory 51 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the logical volume service quality control method in the embodiment of the present invention (for example, the processed service request quantity acquisition module 410, the token acquisition request sending module 420 and the request execution module 430 in the logical volume service quality control device). The processor 50 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 51, that is, realizing the above-mentioned logical volume service quality control method, that is:

[0145] When a current service request for a target logical volume is received, if it is determined that the target logical volume does not have any unprocessed historical service requests, then obtaining the number of service requests processed by the sliding window corresponding to the target logical volume within the current sliding period;

[0146] Determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume;

[0147] When it is detected that the token is successfully acquired, the current service request is executed based on at least one storage node corresponding to the target logical volume.

[0148] The memory 51 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 51 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 51 may further include a memory remotely arranged relative to the processor 50, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0149] The input device 52 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 53 may include a display device such as a display screen.

[0150] Embodiment 6

[0151] Embodiment 6 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any embodiment of the present invention is implemented. Of course, a computer-readable storage medium provided by an embodiment of the present invention can perform the relevant operations in a method for controlling the quality of service of a logical volume provided by any embodiment of the present invention. That is, when the program is executed by a processor, the following is implemented:

[0152] When a current service request for a target logical volume is received, if it is determined that the target logical volume does not have any unprocessed historical service requests, then obtaining the number of service requests processed by the sliding window corresponding to the target logical volume within the current sliding period;

[0153] Determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume;

[0154] When it is detected that the token is successfully acquired, the current service request is executed based on at least one storage node corresponding to the target logical volume.

[0155] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0156] It is worth noting that in the embodiment of the above-mentioned logical volume service quality control device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0157] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for controlling the quality of service of a logical volume, characterized in that: include: When a current service request for a target logical volume is received, if it is determined that the target logical volume does not have any unprocessed historical service requests, then obtaining the number of service requests processed by the sliding window corresponding to the target logical volume within the current sliding period; Determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume; When it is detected that the token is successfully acquired, the current business request is added to the business request cache queue corresponding to the preset leaky bucket, and each business request in the business request cache queue corresponding to the preset leaky bucket is processed according to the preset business request processing speed, and the current business request is executed based on at least one storage node corresponding to the target logical volume.

2. The method according to claim 1, characterized in that Before processing each service request in the service request cache queue corresponding to the preset leaky bucket according to the preset service request processing speed, the method further includes: Obtaining the service request processing performance matched by the storage pool corresponding to the preset leaky bucket, and setting the preset service request processing speed corresponding to the preset leaky bucket according to the service request processing performance; The preset leaky bucket corresponds to the storage pool one by one, and the storage pool includes at least one storage node.

3. The method according to claim 1, characterized in that Also includes: At preset time intervals, determining whether the number of tokens in the token bucket corresponding to the target logical volume is greater than or equal to a preset token number threshold; If not, a preset number of tokens are added to the token bucket corresponding to the target logical volume.

4. The method according to claim 1, characterized in that Obtaining the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period, including: Acquire at least one sub-window of the sliding window corresponding to the target logical volume within a current sliding period according to a preset sub-window length; Obtaining the number of processed service requests corresponding to each of the sub-windows through a preset request counter corresponding to each of the sub-windows; According to the number of processed business requests corresponding to each of the sub-windows, the number of processed business requests of the sliding window corresponding to the target logical volume in the current sliding period is obtained.

5. The method according to claim 1, characterized in that After receiving the current service request for the target logical volume, the method further includes: If it is determined that the target logical volume has unprocessed historical service requests, the current service request is added to the service request cache queue corresponding to the target logical volume, and waits until all historical service requests in the service request cache queue corresponding to the target logical volume are processed.

6. The method according to claim 1, characterized in that After sending a token acquisition request to the token bucket corresponding to the target logical volume, the method further includes: If it is detected that the token is not successfully acquired, then when it is detected that the sliding window corresponding to the target logical volume starts to slide in a preset direction, a token acquisition request is resent to the token bucket corresponding to the target logical volume until a token issued by the token bucket corresponding to the target logical volume is successfully acquired; The sliding window corresponding to the target logical volume slides in a preset direction by a preset step length at preset time intervals.

7. A control device for logical volume service quality, characterized in that: include: A module for obtaining the number of processed business requests, for obtaining the number of processed business requests of the sliding window corresponding to the target logical volume within the current sliding period when receiving a current business request for the target logical volume and determining that the target logical volume does not have any unprocessed historical business requests; A token acquisition request sending module is used to determine whether the number of service requests processed by the sliding window corresponding to the target logical volume in the current sliding period meets a preset service request number detection condition, and if so, send a token acquisition request to the token bucket corresponding to the target logical volume; A request execution module is used to add the current business request to the business request cache queue corresponding to the preset leaky bucket when it is detected that the token is successfully acquired, and process each business request in the business request cache queue corresponding to the preset leaky bucket according to the preset business request processing speed, and execute the current business request based on at least one storage node corresponding to the target logical volume.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for controlling the quality of service of a logical volume as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for controlling the quality of service of a logical volume as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Flow control method, device and system, server and computer readable medium

    CN110166376A

  • Flow control method, device and system, server and computer readable medium

    CN110213173A

  • A method and apparatus for controlling distributed block storage logical volume burst quality of service

    CN112463066A

  • Transmission rate control method and device, electronic equipment and readable storage medium

    CN113645150A

  • Traffic control method and device, electronic equipment and storage medium

    CN113973342A