Bandwidth control method and system of storage system, medium, equipment and program product

By setting up a front-end business token bucket in the distributed storage system, and dynamically adjusting bandwidth control based on the storage system's free space and garbage collection rate, the bandwidth conflict between background tasks and front-end businesses is resolved, thus optimizing resource utilization and system performance.

CN121858036APending Publication Date: 2026-04-14SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In distributed storage systems, background tasks and front-end services compete for I/O bandwidth, leading to bandwidth conflicts, resource waste, service interruptions, and missing feedback links, lacking an effective dynamic coordination mechanism.

Method used

By setting up a front-end business token bucket, the bandwidth control strategy can be dynamically adjusted based on the proportion of free storage block space and garbage collection IO release rate of the storage system, thereby limiting the data write rate and frequency and allocating bandwidth resources reasonably.

Benefits of technology

It achieves load balancing of the storage system, avoids resource waste and congestion, ensures orderly and efficient data writing, and improves system stability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858036A_ABST
    Figure CN121858036A_ABST
Patent Text Reader

Abstract

The invention provides a bandwidth control method and system of a storage system, a medium, equipment and a program product, and relates to the technical field of computer storage, and the method comprises the steps: obtaining a space proportion of a current free storage block of the storage system; if the space ratio is smaller than a preset value, acquiring a garbage collection IO release rate, and configuring a front-end service token bucket in a write-in layer according to the garbage collection IO release rate; when the service IO data is brushed down to a write-in layer, applying for a data token from the front-end service token bucket; and after the data token is obtained, writing the service IO data into a persistence layer. By reasonably controlling the data write-in bandwidth, the storage system can balance the data write-in requirement and the release condition of the storage space under the condition of limited resources, excessive waste or idling of the resources is avoided, and more efficient, stable and reliable storage service is provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer storage technology, and in particular to a bandwidth control method, system, medium, device and program product for a storage system. Background Technology

[0002] In distributed storage systems, background tasks such as garbage collection, data reconstruction, migration, and synchronization compete for I / O bandwidth with user front-end services (read and write operations). This lack of an effective dynamic coordination mechanism between background tasks and front-end services can easily lead to the following problems:

[0003] Bandwidth conflict: High concurrency of background tasks leads to obstruction of user business writes and severe latency jitter.

[0004] Resource waste: When background tasks are overly restricted, garbage collection cannot release space in a timely manner, which in turn affects the available space for front-end business.

[0005] Business interruption: When the water level is high, the garbage collection and release speed of background tasks is lower than the write speed of the foreground, and insufficient cluster space leads to the interruption of foreground business.

[0006] Lack of feedback channels: There is a lack of effective traffic feedback channels between different layers (persistence layer, write layer, cache layer), which makes it impossible to achieve adaptive adjustment based on global load.

[0007] Therefore, how to achieve load balancing between backend tasks and frontend business is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0008] The purpose of this application is to provide a bandwidth control method, system, medium, device, and program product for a storage system, which reduces the conflict between garbage collection and user services by setting a front-end service token bucket to limit the bandwidth.

[0009] To address the aforementioned technical problems, this application provides a bandwidth control method for a storage system, wherein the storage system includes a caching layer, a write layer, and a persistence layer, and the specific technical solution is as follows:

[0010] Obtain the current free storage block space ratio of the storage system;

[0011] If the space ratio is less than a preset value, obtain the garbage collection IO release rate, and configure the front-end business token bucket in the writing layer according to the garbage collection IO release rate.

[0012] When business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket;

[0013] After obtaining the data token, the business IO data is written to the persistence layer.

[0014] Optionally, when obtaining the garbage collection I / O release rate, it also includes:

[0015] Get the business I / O data write rate;

[0016] When the space ratio is less than a preset value, if the business IO data write rate is greater than the garbage collection IO release rate, the garbage collection IO release rate is increased to ensure that the business IO write rate and the garbage collection IO release rate are kept in balance until the garbage collection IO release rate runs at maximum concurrency.

[0017] Optionally, if the space ratio is not less than the preset value, the method further includes:

[0018] The priority ratio of service I / O and garbage collection I / O is set according to the current free storage card space ratio; wherein, the space ratio is positively correlated with the priority ratio.

[0019] Optional, also includes:

[0020] Configure the large IO metadata token bucket in the cache layer server according to the current memory usage of the cache layer and the metadata dirty bandwidth;

[0021] After obtaining the metadata tokens from the large IO metadata token bucket, the large IO metadata is flushed from the cache layer server to the write layer; wherein, when the current memory usage rate is lower than a set memory usage rate threshold, no rate limiting is performed; when the current memory usage rate is not lower than the set memory usage rate threshold, a first rate limiting value is calculated based on the dirty flushing bandwidth and a first coefficient, the first rate limiting value being used to indicate the number of tokens in the large IO metadata token bucket; wherein, the metadata dirty flushing bandwidth is determined based on the garbage collection IO release rate, and the first coefficient is negatively correlated with the current memory usage rate;

[0022] Configure the server-side small IO data token bucket in the cache layer according to the current memory usage of the cache layer and the small IO data flushing bandwidth;

[0023] After obtaining the small IO data tokens from the small IO data token bucket, the small IO data is flushed from the cache layer server to the write layer. When the current memory usage is lower than a set memory usage threshold, no rate limiting is performed. When the current memory usage is not lower than the set memory usage threshold, a second rate limiting value is calculated based on the small IO data flushing bandwidth and a second coefficient. The second rate limiting value is used to indicate the number of tokens in the small IO data token bucket. The small IO data flushing bandwidth is determined based on the garbage collection IO release rate, and the second coefficient is negatively correlated with the current memory usage.

[0024] Optionally, when the client of the caching layer sends metadata corresponding to large IO data, it further includes:

[0025] The client requests a metadata token from the large IO metadata token bucket;

[0026] If the metadata token is obtained, the metadata of the large IO data of the corresponding storage group will be flushed from the cache layer server to the write layer.

[0027] Optional, also includes:

[0028] Configure the large I / O data token bucket for the client in the caching layer;

[0029] When the cache layer is short of memory, it requests a large IO data token from the large IO data token bucket.

[0030] If the large IO data token is obtained, the large IO data is written to the persistence layer.

[0031] This application also provides a bandwidth control system for a storage system, the storage system comprising a cache layer, a write layer, and a persistence layer, including:

[0032] The blank block data acquisition module is used to acquire the current free storage block space ratio of the storage system.

[0033] The token bucket configuration module is used to obtain the garbage collection IO release rate if the space ratio is less than a preset value, and configure the front-end business token bucket in the writing layer according to the garbage collection IO release rate.

[0034] The data token application module is used to apply for a data token from the front-end business token bucket when business IO data is flushed to the write layer.

[0035] The data writing module is used to write business IO data to the persistence layer after obtaining the data token.

[0036] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0037] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor, when calling the computer program in the memory, implements the steps of the method described above.

[0038] This application also provides a computer program product, including a computer program that, when executed, implements the steps of the method described above.

[0039] This application provides a bandwidth control method for a storage system, the storage system including a caching layer, a writing layer, and a persistence layer, comprising: obtaining the current free storage block space ratio of the storage system; if the space ratio is less than a preset value, obtaining the garbage collection IO release rate, configuring a front-end service token bucket in the writing layer according to the garbage collection IO release rate; when service IO data is flushed to the writing layer, requesting a data token from the front-end service token bucket; and after obtaining the data token, writing the service IO data to the persistence layer.

[0040] This application obtains the current free storage block space ratio of the storage system, enabling real-time and accurate monitoring of storage system space usage and avoiding data write delays or failures due to insufficient space. When the space ratio is less than a preset value, the garbage collection IO release rate is obtained. Referencing the dynamic impact of the storage system's internal garbage collection mechanism on space release, the bandwidth control strategy can be flexibly adjusted based on the actual storage space release situation, enhancing the adaptability and accuracy of bandwidth control. A front-end business token bucket is configured in the write layer based on the garbage collection IO release rate, achieving fine-grained control of write layer data traffic. The introduction of the front-end business token bucket is equivalent to setting a dynamic flow valve for data writing, rationally allocating bandwidth resources for data writing based on the garbage collection space release rate. When business IO data is flushed to the write layer, it needs to request a data token from the front-end business token bucket. This process effectively limits the speed and frequency of data writing, preventing a large influx of business IO data into the write layer and causing congestion, ensuring the stable operation of the storage system, and also ensuring that data can be written to the persistence layer in an orderly and efficient manner, improving the overall performance and reliability of the storage system. This application ensures efficient data writing while also helping to optimize the resource utilization of the storage system. By rationally controlling the data write bandwidth, the storage system can better balance data write demands with storage space release under limited resource conditions, avoiding excessive waste or idleness of resources, improving the overall performance of the storage system in complex business scenarios, and providing users with more efficient, stable, and reliable storage services.

[0041] This application also provides a bandwidth control system for a storage system, a computer-readable storage medium, an electronic device, and a computer program product, which have the above-mentioned beneficial effects, and will not be elaborated here. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0043] Figure 1 This application provides a schematic diagram of the storage system architecture.

[0044] Figure 2 A flowchart illustrating a bandwidth control method for a storage system provided in an embodiment of this application;

[0045] Figure 3 This is a schematic diagram of a storage system structure including a token bucket provided in an embodiment of this application;

[0046] Figure 4 A schematic diagram of the bandwidth control system of a storage system provided in this application embodiment:

[0047] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0049] To better understand the bandwidth control method for a storage system provided in this application, the following section first describes the application scenario of this application. (See attached document for details.) Figure 1 , Figure 1 A schematic diagram of the storage system structure provided in this application.

[0050] Figure 1The architecture, from top to bottom, consists of a caching layer, an append-only module, and a persistence layer. The caching layer includes a caching client and a caching server, while the append-only module is the intermediate write layer. Data is categorized into large I / O data and small I / O data based on I / O size. Large I / O data typically refers to read / write operations on large external storage devices, such as large data transfers to hard disk drives (HDDs) or solid-state drives (SSDs). These devices have large storage capacities, and each I / O operation involves a relatively large amount of data. Small I / O data refers to operations on small, low-speed I / O devices, such as scanning and reading data from input devices like keyboards and mice.

[0051] Large I / O data is written directly to the persistent layer through the caching client, and the corresponding metadata is also written to the caching client. Small I / O data is written directly to the caching client. When the caching layer is full, the cached data (including metadata for large I / O data and small I / O data) is written to the persistent layer through the append-only module. Small I / O metadata is generated directly in the append-only module. Overwriting and deleting also generate corresponding garbage, which is garbage collected by the append-only module to free up available space for the foreground to write to again.

[0052] See Figure 2 , Figure 2 A flowchart illustrating a bandwidth control method for a storage system provided in this application embodiment, the method comprising:

[0053] S201: Obtain the current free storage block space ratio of the storage system;

[0054] S202: If the space ratio is less than a preset value, obtain the garbage collection IO release rate, and configure the front-end service token bucket in the writing layer according to the garbage collection IO release rate;

[0055] S203: When business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket;

[0056] S204: After obtaining the data token, write the business IO data to the persistence layer.

[0057] In step S201, it is necessary to obtain the current free storage block space ratio. In a storage system, a storage block is the basic unit of data storage, and its space ratio directly reflects the available resources of the storage system. There are no restrictions on how to obtain the current free storage block space ratio. For example, it can be directly queried from the storage block management module. Storage systems typically have a storage block management module responsible for operations such as storage block allocation, reclamation, and status monitoring. By calling the interface functions provided by the storage block management module, the total number of all storage blocks and the number of free storage blocks can be directly obtained. Dividing the number of free storage blocks by the total number of storage blocks yields the free storage block space ratio. Alternatively, the storage system's monitoring tools can be used to perform statistical analysis to obtain the current free storage block space ratio.

[0058] In step S202, when the proportion of currently free storage blocks in the storage system is less than a preset value, it indicates that the available storage space in the storage system is already relatively tight. Garbage collection is a common storage space optimization technique that releases more available storage space by reclaiming storage blocks that are no longer used in the storage system. The garbage collection IO release rate is used to measure the efficiency of garbage collection operations in releasing storage space. By obtaining the garbage collection IO release rate and configuring the front-end business token bucket at the write layer accordingly, the data write speed can be effectively controlled, avoiding excessive storage space occupation. The token generation rate in the front-end business token bucket can be determined by the garbage collection IO release rate. To maintain storage space balance, tokens in the front-end business token bucket can be generated at the same rate as the garbage collection IO release rate. By configuring the front-end business token bucket in a dynamic adjustment manner, the token issuance rate of the front-end business token bucket can be dynamically adjusted according to the real-time operation of the storage system, such as changes in the current storage space utilization rate and the garbage collection IO release rate. For example, when the storage space utilization rate of the storage system is high and the business IO load is heavy, even if the garbage collection IO release rate is high, the token issuance rate of the front-end business token bucket can be appropriately reduced to prevent the rapid exhaustion of storage space. When the storage system's storage space utilization is low and the business I / O load is light, the token issuance rate of the front-end business token bucket can be appropriately increased to improve data write performance. This allows for better adaptation to dynamic changes in the storage system, improving its overall performance and stability.

[0059] In other implementations, the token generation rate in the front-end service token bucket can also be calculated as the product of the garbage collection IO release rate and a set coefficient. This set coefficient can be set by those skilled in the art and is not specifically limited here.

[0060] In addition, it is necessary to obtain the garbage collection I / O release rate. One feasible implementation can be to invoke the garbage collection module in the storage system. During operation, the garbage collection module records relevant information about garbage collection operations in real time, including the number of storage blocks released in each operation and the time spent. Based on this, the garbage collection I / O release rate can be calculated. For example, the garbage collection module can count the number of storage blocks released within a certain time interval (e.g., 1 minute), and then divide the number of released storage blocks by the time interval to obtain the garbage collection I / O release rate, reflecting the current performance status of the garbage collection operation.

[0061] By configuring a front-end business token bucket and leveraging its token issuance mechanism, the speed at which business I / O data is written to the storage system's write layer can be effectively controlled. When the number of tokens in the front-end business token bucket is insufficient, the write operation of business I / O data will be delayed, thus preventing the storage space from being quickly exhausted due to excessively fast data write speeds. For example, in a high-concurrency storage application scenario, without the control of the front-end business token bucket, a large amount of business I / O data may be written to the storage system simultaneously, causing the storage space to be filled in a short period of time, leading to performance problems or even crashes of the storage system. By configuring the front-end business token bucket, storage space resources can be allocated reasonably, ensuring the stable operation of the storage system under high concurrency conditions.

[0062] The front-end business token bucket configuration can be dynamically adjusted based on the garbage collection IO release rate, enabling better coordination between storage space release and data writing. When garbage collection can release storage space in a timely manner, the front-end business token bucket can appropriately increase the token issuance rate, allowing more data to be written to the storage system and improving storage space utilization. Conversely, when garbage collection is slow, the front-end business token bucket will reduce the token issuance rate to avoid excessive storage space occupation, thereby maximizing the utilization of storage space resources while ensuring the stable operation of the storage system.

[0063] Furthermore, it should be noted that if the space percentage is not less than a preset value, it indicates that the current storage system resources are relatively abundant, and in this case, there is no need to set a front-end service token bucket. The preset value for the space percentage is not specifically limited here and can be set by those skilled in the art, for example, it can be set to 15% or 10%.

[0064] In step S103, when business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket. Since the flushing operation of business IO data is usually initiated by the business application, the operation of requesting a data token from the front-end business token bucket is triggered when the write layer receives the flushing request for business IO data. Specifically, this can be achieved by setting a listening mechanism in the data receiving module of the write layer. When the data receiving module receives the flushing request for business IO data, it automatically sends a token request to the front-end business token bucket. For example, a listening function can be written at the entry point of the write layer, which, upon receiving the data flushing request, calls the request interface of the front-end business token bucket to initiate the token request operation.

[0065] Upon receiving a token request, the front-end business token bucket determines whether to issue a token based on its current token bucket status (such as the number of tokens remaining). If there are enough tokens in the token bucket, a data token will be issued to the requesting business IO data; otherwise, the token request will be rejected.

[0066] During the token application process, interaction is required between the write layer and the front-end business token bucket. The write layer sends a token application request, informing the front-end business token bucket of the amount of data to be written, etc. The front-end business token bucket decides whether to issue a token based on its own configuration parameters and returns the result to the write layer. The number of data tokens requested for business IO data usually needs to be set according to the data volume of the business IO data itself; for example, the number of data tokens can be requested based on the current write length of the business IO data. If the remaining data tokens in the front-end business token bucket can meet the write length of the current business IO data, then data tokens can be issued.

[0067] Step S103 controls write traffic by requesting a data token from the front-end business token bucket when business IO data is flushed to the write layer. The front-end business token bucket determines whether to issue a token based on its configuration parameters (such as the token generation rate), thereby limiting the write rate of business IO data and effectively preventing performance degradation or system crashes caused by excessively high data write rates. By controlling write traffic, the storage system can protect overall system performance while ensuring data write performance. Under high load, failure to control write traffic can lead to IO bottlenecks in the storage system, affecting the performance of other business operations. The front-end business token bucket's request mechanism allows for the rational allocation of storage system IO resources, enabling the storage system to maintain good performance under various load conditions.

[0068] Furthermore, when multiple business I / O data are simultaneously flushed to the write layer, requesting data tokens from the front-end business token bucket ensures the order and fairness of data writes. The front-end business token bucket issues tokens according to the order of request, allowing business I / O data that requests first to obtain tokens and perform write operations first. This ensures that each business I / O data can fairly obtain storage system resources, preventing increased write latency for other businesses due to high write rates in a few businesses.

[0069] Once the business I / O data obtains a data token, the write layer can write the business I / O data to the persistence layer. The persistence layer is typically a storage medium responsible for long-term data storage, such as a hard drive or solid-state drive. After obtaining the data token, the write layer will transfer the business I / O data from the write layer's cache or temporary storage area to the designated storage location in the persistence layer.

[0070] This application embodiment obtains the current free storage block space ratio of the storage system, enabling real-time and accurate monitoring of the storage system's space usage and avoiding data write delays or failures due to insufficient space. When the space ratio is less than a preset value, the garbage collection IO release rate is obtained. Referencing the dynamic impact of the storage system's internal garbage collection mechanism on space release, the bandwidth control strategy can be flexibly adjusted based on the actual storage space release situation, enhancing the adaptability and accuracy of bandwidth control. A front-end business token bucket is configured in the write layer based on the garbage collection IO release rate, achieving fine-grained control of write layer data traffic. The introduction of the front-end business token bucket is equivalent to setting a dynamic flow valve for data writing, rationally allocating bandwidth resources for data writing based on the garbage collection space release rate. When business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket. This process effectively limits the speed and frequency of data writing, preventing a large influx of business IO data into the write layer and causing congestion, ensuring the stable operation of the storage system, and also ensuring that data can be written to the persistence layer in an orderly and efficient manner, improving the overall performance and reliability of the storage system. This application ensures efficient data writing while also helping to optimize the resource utilization of the storage system. By rationally controlling the data write bandwidth, the storage system can better balance data write demands with storage space release under limited resource conditions, avoiding excessive waste or idleness of resources, improving the overall performance of the storage system in complex business scenarios, and providing users with more efficient, stable, and reliable storage services.

[0071] Based on the above embodiments, as an optimized embodiment, to better achieve bandwidth isolation between front-end services (garbage collection, read / write requests) and back-end tasks, the service IO data write rate can also be obtained when acquiring the garbage collection IO release rate. The service IO data write rate is used to characterize the speed at which front-end IO writes data per unit time. The garbage collection IO release rate is used to characterize the speed at which garbage collection IO releases storage space per unit time.

[0072] When the space ratio is less than a preset value, if the business IO data write rate is greater than the garbage collection IO release rate, the garbage collection IO release rate is increased to ensure that the business IO write rate and the garbage collection IO release rate are kept in balance until the garbage collection IO release rate runs at maximum concurrency.

[0073] It should be noted that the reason for maintaining a relative balance between the business IO write rate and the garbage collection IO release rate is to avoid high-speed garbage collection IO affecting the front-end business.

[0074] Since the front-end business token bucket is only generated when the space ratio of the free storage block is less than a preset value, the garbage collection IO release rate and the business IO data write rate are periodically measured during the business IO data flushing process. When both conditions are met—that the current space ratio of the free storage block is less than the preset value and that the business IO data write rate is greater than the garbage collection IO release rate—it can be determined that the front-end business token bucket has been configured. This means that when business IO data is flushed to the write layer, it needs to request a data token from the front-end business token bucket first.

[0075] Garbage collection I / O and front-end business writes (large I / O pass-through writes, small I / O aggregation flushing) share the front-end business bandwidth provided by the persistence layer. When the free block level is low, i.e., the current free storage block space ratio is lower than a preset value, the business I / O data write rate at the write layer entry is statistically analyzed. Based on the business I / O data write rate and the garbage collection I / O release rate, the concurrency of garbage collection is adjusted. Through natural contention, a balance between garbage collection release space and front-end writes is maintained. If the garbage collection I / O release rate runs at maximum concurrency and still cannot maintain a balance with the business I / O write rate, then the relevant steps of step S102 in the previous embodiment are executed.

[0076] Meanwhile, when the space occupancy is not less than a preset value, the IO priority of background tasks (reconstruction, migration, synchronization) can be dynamically adjusted according to user configuration (intelligent mode, business priority, data recovery priority). Specifically, the priority ratio of business IO write rate and garbage collection IO release rate can be adjusted according to the blank block level, and the space occupancy is positively correlated with the priority ratio. The priority ratio of foreground IO and garbage collection IO refers to the relative priority relationship between foreground IO and garbage collection IO in acquiring system resources (such as CPU time, disk bandwidth, etc.) during the resource allocation and scheduling process of the storage system.

[0077] Assuming the default value is 15%, an example adjustment method is as follows:

[0078] For example, if the blank block water level is greater than 15%, the priority ratio between foreground I / O and garbage collection I / O is 9:1;

[0079] If the blank block water level is less than 15% and the 10% is less than 15%, the priority ratio between foreground I / O and garbage collection I / O is 7:3. At this point, the processing priority of concurrent garbage collection I / O has been increased.

[0080] If the blank block level is less than 10%, the priority ratio between foreground I / O and garbage collection I / O is 3:7. In this case, garbage collection I / O is processed first to ensure the space of garbage collection I / O is released.

[0081] Correspondingly, in conjunction with the previous embodiment, when the current free storage block space ratio is detected to be less than 15%, the business IO data write rate and garbage collection IO release rate over the past 30 seconds are statistically analyzed. If the business IO data write rate is greater than the garbage collection IO release rate, then garbage collection concurrency is increased;

[0082] If the current free storage block space ratio is less than 10%, the garbage collection concurrency is adjusted to the maximum, meaning the garbage collection IO release rate runs at maximum concurrency. The garbage collection IO release rate is then calculated again over 30 seconds. This current rate is used as the rate limit for the token bucket of the write layer's front-end business. Business IO data flushed from the cache layer needs to obtain a token from the token bucket before being written to the persistent layer, thus ensuring a relatively balanced free block level and achieving equilibrium between writing and releasing.

[0083] Based on the above embodiments, a corresponding token bucket can also be set for the cache layer, which may specifically include the following steps:

[0084] Configure the large IO metadata token bucket in the cache layer server according to the current memory usage of the cache layer and the metadata dirty bandwidth;

[0085] After obtaining the metadata tokens from the large IO metadata token bucket, the large IO metadata is flushed from the cache layer server to the write layer. When the current memory usage is lower than a set memory usage threshold, rate limiting is not performed. When the current memory usage is not lower than the set memory usage threshold, a first rate limiting value is calculated based on the dirty flushing bandwidth and a first coefficient. The first rate limiting value is used to indicate the number of tokens in the large IO metadata token bucket. The metadata dirty flushing bandwidth is determined based on the garbage collection IO release rate, and the first coefficient is negatively correlated with the current memory usage.

[0086] The specific threshold for memory utilization is not limited here; it can be set by those skilled in the art based on the workload and hardware parameters of the storage system. In one exemplary application, no rate limiting is applied when memory utilization is below 60%. When memory utilization is above 60%, rate limiting is applied proportionally. The rate limiting value is the product of the dirty bandwidth and a first coefficient, which is determined based on the current memory utilization. For example, when memory utilization is 60%, the first coefficient can be 1.4; when memory utilization is 110%, the first coefficient can be 0.9.

[0087] Similarly, the server-side small IO data token bucket in the cache layer is configured based on the current memory usage and small IO data flushing bandwidth of the cache layer. After obtaining the small IO data token in the small IO data token bucket, the small IO data can be flushed from the cache layer server to the write layer.

[0088] Similarly, when the current memory usage is lower than the set memory usage threshold, no rate limiting is performed; when the current memory usage is not lower than the set memory usage threshold, a second rate limiting value is calculated based on the small IO data flushing bandwidth and a second coefficient. The second rate limiting value is used to indicate the number of tokens in the small IO data token bucket. The small IO data flushing bandwidth is determined based on the garbage collection IO release rate, and the second coefficient is negatively correlated with the current memory usage.

[0089] Similarly, the setting method for the second coefficient can be referred to the first coefficient above, and will not be repeated here.

[0090] Based on this, a large IO data token bucket can also be configured for the client in the caching layer. When the memory of the caching layer is insufficient, a large IO data token is requested from the large IO data token bucket. If the large IO data token is obtained, the large IO data is written to the persistence layer.

[0091] join Figure 3 , Figure 3 This is a schematic diagram of a storage system structure including a token bucket provided in an embodiment of this application, compared to...Figure 2 It is evident that in this embodiment, a front-end business token bucket is provided at the entry point of the write layer, and a large IO metadata token bucket and a small IO data token bucket are provided on the cache layer server side. The large IO data token bucket is provided at the entry point of the cache layer client.

[0092] During the application process, the presence of tokens in the metadata token bucket of the corresponding storage group on the cache layer server determines whether the cache layer client allows large IO requests belonging to that storage group. The token generation speed of the large IO metadata token bucket at the cache layer server entry point is set based on the large IO dirty flushing bandwidth and the current memory usage of the cache layer. Similarly, the token generation speed of the small IO data token bucket at the cache layer server entry point is set based on the small IO dirty flushing bandwidth and the current memory usage of the cache layer. Finally, the token generation speed of the front-end business token bucket at the write layer entry point is set based on the current free storage block space ratio and the garbage collection IO release speed. All the above token generation speeds can be expressed in bytes per second.

[0093] In practical applications, large IO data token buckets can be set up at the storage group level. The number of tokens in the large IO data token bucket is obtained through IO or a background scheduled task. The tokens at the caching layer client are used to delay and control the flow of large IO, matching it with the speed of garbage collection and space release. That is, large IO data can only be directly written to the persistence layer after obtaining a large IO data token.

[0094] The caching server can also set up large IO metadata token buckets and small IO data token buckets at the storage group level. Metadata for large IO data and small IO data belonging to that storage group each request tokens for their respective token buckets. The large IO metadata token bucket needs to be associated with the large IO data token bucket of the corresponding storage group on the caching client, and the token data of both must be consistent to ensure that write bandwidth traffic from the caching server and the write layer's storage group is fed back to the caching client entry point.

[0095] In specific application scenarios, unlike the front-end business token bucket in the write layer, which requires two conditions to be met before it is generated: the current free storage block space ratio is less than a preset value, and the business IO data write rate is greater than the garbage collection IO release rate. The three token buckets in the cache layer, namely the large IO data token bucket, the large IO metadata token bucket, and the small IO data token bucket, can exist indefinitely after generation. The number of tokens in the large IO metadata token bucket and the small IO data token bucket can be determined by the write layer's flush bandwidth. That is, the number of tokens in the large IO metadata token bucket and the small IO data token bucket are adjusted according to the IO rate of the write layer's IO data flushing to the persistence layer.

[0096] It should also be noted that the initial generation process of the front-end business token bucket, large IO data token bucket, large IO metadata token bucket, and small IO data token bucket can be passed from the persistence layer through the write layer to the cache layer, generating backpressure layer by layer to ensure scheduling consistency across layers. Specifically, because the current free storage block space ratio is less than a preset value, and the business IO data write rate is greater than the garbage collection IO release rate, the front-end business token bucket is generated first. This requires IO data to obtain a token before it can be written to the persistence layer, causing a large amount of data to accumulate at the write layer entry point, waiting to obtain a token from the data token bucket to achieve backpressure. The server and client in the cache layer then generate their respective token buckets sequentially to achieve rate limiting for the front-end business.

[0097] As can be seen, this embodiment, when garbage collection cannot meet the write rate, sets several token buckets to limit the rate of the next higher layer, transferring the pressure to the IO data entry point. This avoids failures caused by insufficient space, achieving backpressure transmission layer by layer, ensuring scheduling consistency across layers, effectively reducing conflicts between garbage collection and user writes, and guaranteeing low latency and high reliability of large-scale storage systems. It should also be noted that this application targets write IO services; read IO services are unaffected. Furthermore, background reconstruction and migration tasks affect the garbage collection IO rate, indirectly impacting the front-end read and write IO rates. This allows for the differentiation of different tasks such as front-end writes, front-end reads, and background reconstruction / migration, providing fine-grained bandwidth management.

[0098] See Figure 4 , Figure 4 This is a schematic diagram of the structure of a bandwidth control system for a storage system provided in an embodiment of this application. The system includes:

[0099] The blank block data acquisition module is used to acquire the current free storage block space ratio of the storage system.

[0100] The token bucket configuration module is used to obtain the garbage collection IO release rate if the space ratio is less than a preset value, and configure the front-end business token bucket in the writing layer according to the garbage collection IO release rate.

[0101] The data token application module is used to apply for a data token from the front-end business token bucket when business IO data is flushed to the write layer.

[0102] The data writing module is used to write business IO data to the persistence layer after obtaining the data token.

[0103] This application also provides a computer-readable storage medium and a computer program product, both of which store a computer program. When executed, the computer program can implement the steps of the methods provided in the above embodiments. The storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0104] This application also provides an electronic device that may include a memory and a processor. The memory stores a computer program, and when the processor invokes the computer program in the memory, it can implement the steps of the method provided in the above embodiments. Of course, the electronic device may also include various network interfaces, power supplies, and other components. Please see [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device in this embodiment may include: a processor 2101 and a memory 2102.

[0105] Optionally, the electronic device may also include a communication interface 2103, an input unit 2104, a display 2105, and a communication bus 2106.

[0106] The processor 2101, memory 2102, communication interface 2103, input unit 2104, and display 2105 all communicate with each other through the communication bus 2106.

[0107] In this embodiment of the application, the processor 2101 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, an off-the-shelf programmable gate array, or other programmable logic devices.

[0108] The processor can call programs stored in memory 2102. Specifically, the processor can execute the operations performed by the electronic device in the above embodiments.

[0109] The memory 2102 is used to store one or more programs, which may include program code, including computer operation instructions. In this embodiment, the memory stores at least a program for implementing the following functions:

[0110] Obtain the current free storage block space ratio of the storage system;

[0111] If the space ratio is less than a preset value, obtain garbage collection I / O, and configure a data token bucket in the write layer according to the garbage collection I / O;

[0112] When business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket;

[0113] After obtaining the data token, the business IO data is written to the persistence layer.

[0114] In one possible implementation, the memory 2102 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during the use of the computer.

[0115] In addition, memory 2102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0116] The communication interface 2103 can be an interface for a communication module, such as the interface for a GSM module.

[0117] This application may also include a display 2105 and an input unit 2104, etc.

[0118] Figure 5 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of this application. In practical applications, the electronic device may include more than [other components]. Figure 5 More or fewer components as shown, or combinations of certain components.

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

[0120] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

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

Claims

1. A bandwidth control method for a storage system, characterized in that, include: Obtain the current free storage block space ratio of the storage system; If the space ratio is less than a preset value, obtain the garbage collection IO release rate, and configure the front-end business token bucket in the writing layer according to the garbage collection IO release rate. When business IO data is flushed to the write layer, a data token is requested from the front-end business token bucket; After obtaining the data token, the business IO data is written to the persistence layer.

2. The bandwidth control method according to claim 1, characterized in that, When obtaining the garbage collection I / O release rate, it also includes: Get the business I / O data write rate; When the space ratio is less than a preset value, if the business IO data write rate is greater than the garbage collection IO release rate, the garbage collection IO release rate is increased to ensure that the business IO write rate and the garbage collection IO release rate are kept in balance until the garbage collection IO release rate runs at maximum concurrency.

3. The bandwidth control method according to claim 2, characterized in that, If the space ratio is not less than the preset value, it also includes: The priority ratio of service I / O and garbage collection I / O is set according to the current free storage card space ratio; wherein, the space ratio is positively correlated with the priority ratio.

4. The bandwidth control method according to claim 1, characterized in that, Also includes: Configure the large IO metadata token bucket in the cache layer server according to the current memory usage of the cache layer and the metadata dirty bandwidth; After obtaining the metadata tokens from the large IO metadata token bucket, the large IO metadata is flushed from the cache layer server to the write layer; wherein, when the current memory usage rate is lower than a set memory usage rate threshold, no rate limiting is performed; when the current memory usage rate is not lower than the set memory usage rate threshold, a first rate limiting value is calculated based on the dirty flushing bandwidth and a first coefficient, the first rate limiting value being used to indicate the number of tokens in the large IO metadata token bucket; wherein, the metadata dirty flushing bandwidth is determined based on the garbage collection IO release rate, and the first coefficient is negatively correlated with the current memory usage rate; Configure the server-side small IO data token bucket in the cache layer according to the current memory usage of the cache layer and the small IO data flushing bandwidth; After obtaining the small IO data tokens from the small IO data token bucket, the small IO data is flushed from the cache layer server to the write layer. When the current memory usage is lower than a set memory usage threshold, no rate limiting is performed. When the current memory usage is not lower than the set memory usage threshold, a second rate limiting value is calculated based on the small IO data flushing bandwidth and a second coefficient. The second rate limiting value is used to indicate the number of tokens in the small IO data token bucket. The small IO data flushing bandwidth is determined based on the garbage collection IO release rate, and the second coefficient is negatively correlated with the current memory usage.

5. The bandwidth control method according to claim 4, characterized in that, When the client of the caching layer sends metadata corresponding to large IO data, it also includes: The client requests a metadata token from the large IO metadata token bucket; If the metadata token is obtained, the metadata of the large IO data of the corresponding storage group will be flushed from the cache layer server to the write layer.

6. The bandwidth control method according to claim 4, characterized in that, Also includes: Configure the large I / O data token bucket for the client in the caching layer; When the cache layer is short of memory, it requests a large IO data token from the large IO data token bucket. If the large IO data token is obtained, the large IO data is written to the persistence layer.

7. A bandwidth control system for a storage system, the storage system comprising a caching layer, a write layer, and a persistence layer, characterized in that, include: The blank block data acquisition module is used to acquire the current free storage block space ratio of the storage system. The token bucket configuration module is used to obtain the garbage collection IO release rate if the space ratio is less than a preset value, and configure the front-end business token bucket in the writing layer according to the garbage collection IO release rate. The data token application module is used to apply for a data token from the front-end business token bucket when business IO data is flushed to the write layer. The data writing module is used to write business IO data to the persistence layer after obtaining the data token.

8. A computer program product, characterized in that, Includes a computer program, which, when executed, implements the steps of the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.

10. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor, when calling the computer program in the memory, implements the steps of the method as described in any one of claims 1-6.