Storage space optimization method and device, electronic device and storage medium
By monitoring the space usage of all-flash storage pool in real time and adjusting the ratio of host writes and garbage collection operations, the problem of low storage performance in all-flash storage systems is solved, and more efficient space management and performance improvement is achieved.
Patent Information
- Application Number
- CN202510775872.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-11
AI Technical Summary
In existing all-flash storage systems, the problem of low storage performance is mainly due to the slow regulation process of space management and flow control mechanism and the rough adjustment granularity, which cannot ensure the stability of the system while maximizing performance output.
By monitoring the space usage of the all-flash storage pool in real time, based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle, the current metadata operation ratio of the current cycle is determined, and the proportion between host writes and garbage collection operations is adjusted to achieve accurate space consumption and recycling speed balance.
It improves storage performance, reduces data response time and performance fluctuations, ensures the stable operation of the all-flash storage system under high space utilization, reduces system overhead caused by garbage collection, and enhances overall performance.
Smart Images

Figure CN120276686B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a storage space optimization method and device, an electronic device, and a storage medium. Background Art
[0002] In current all-flash storage systems, space management and flow control mechanisms typically rely on monitoring storage pool space usage. Multiple throttling levels are set to regulate the speed of host write operations, aiming to achieve a balance between space consumption and reclamation. This mechanism is based on a storage pool space usage threshold. Once the threshold is exceeded, host write performance is gradually reduced until a balance is achieved between space consumption and reclamation speed.
[0003] However, the step-by-step adjustment process is relatively slow and the adjustment granularity is relatively coarse, which cannot maximize performance output while ensuring system stability, thereby causing the technical problem of low storage performance of the all-flash storage system. Summary of the Invention
[0004] The present application provides a storage space optimization method and device, an electronic device, and a storage medium to at least solve the problem of low storage performance of all-flash storage systems in related technologies.
[0005] According to one aspect of an embodiment of the present application, a method for optimizing storage space is provided, comprising: obtaining a space utilization rate in an all-flash storage pool, wherein the space utilization rate is the ratio of used storage space to total storage space in the all-flash storage pool; when the space utilization rate reaches a recovery threshold, determining a current metadata operation ratio for the current cycle based on a target space balance ratio for the current cycle and an actual space balance ratio for the previous cycle, wherein the current metadata operation ratio is the ratio between the number of first metadata operations generated by writing data to the all-flash storage pool in the current cycle and the number of second metadata operations generated by reclaiming data in the all-flash storage pool; and determining, based on the current metadata operation ratio, the consumed storage space obtained by writing data in the current cycle and the released storage space obtained by reclaiming invalid data.
[0006] According to another aspect of an embodiment of the present application, a storage space optimization device is also provided, including: a first acquisition unit, used to obtain the space utilization rate in the all-flash storage pool, wherein the space utilization rate is the ratio of the used storage space to the total storage space in the all-flash storage pool; a first processing unit, used to determine the current metadata operation ratio of the current cycle based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle when the space utilization rate reaches the recovery threshold, wherein the current metadata operation ratio is the ratio between the number of first metadata operations generated by writing data to the all-flash storage pool in the current cycle and the number of second metadata operations generated by recovering data in the all-flash storage pool; a second processing unit, used to determine, based on the current metadata operation ratio, the consumed storage space obtained by writing data in the current cycle and the released storage space obtained by recovering invalid data.
[0007] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the steps of any of the above-mentioned storage space optimization methods through the computer program.
[0008] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned storage space optimization methods when running.
[0009] According to another aspect of an embodiment of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of any of the aforementioned storage space optimization methods.
[0010] By adopting the above-mentioned embodiment provided by the present application, by monitoring the space utilization rate of the all-flash storage pool in real time, when the space utilization rate reaches the recovery threshold, the current metadata operation ratio of the current cycle is determined based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle. Among them, by introducing the current metadata operation ratio, the ratio between host writes and garbage collection operations can be adjusted to meet the target space balance ratio. The exhaustion of storage space is effectively avoided. At the same time, through the periodic negative feedback adjustment mechanism, the adjustment speed and accuracy are improved, the data response time and performance fluctuations are reduced, and the stable operation of the all-flash storage pool under high space utilization is achieved, the host write performance is guaranteed, the system overhead caused by garbage collection is reduced, and the overall performance of the all-flash storage system is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1 This is a schematic diagram of an application scenario of a storage space optimization method according to an embodiment of the present application.
[0013] Figure 2 This is the process intention of an optional storage space optimization method according to an embodiment of the present application.
[0014] Figure 3 This is a specific example of an optional storage space optimization method according to an embodiment of the present application.
[0015] Figure 4 This is a schematic diagram of an optional method for modifying MOR based on negative feedback control according to an embodiment of the present application.
[0016] Figure 5 This is a schematic diagram of an optional method of setting SCR_T based on space utilization according to an embodiment of the present application.
[0017] Figure 6 It is an overall schematic diagram of an optional storage space optimization method according to an embodiment of the present application.
[0018] Figure 7 It is an optional mapping table between space usage and setting SCR_T according to an embodiment of the present application.
[0019] Figure 8 This is a structural block diagram of an optional storage space optimization device according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0021] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0022] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0023] According to one aspect of the embodiment of the present application, a method for optimizing storage space is provided. Optionally, in this embodiment, the above storage space optimization method can be applied to, but is not limited to, Figure 1 In the hardware scenario shown, the server device may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. The server device may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the storage space optimization method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the server 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 a combination thereof.
[0025] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0026] The embodiments of the present application may be applicable to, but not limited to, all-flash array operation optimization scenarios with high storage density and high performance requirements. For ease of understanding, specific examples of several application scenarios are provided below:
[0027] (1) High-performance computing environment: In high-performance computing data centers, all-flash arrays are a key component in improving computing performance. Since high-performance computing tasks typically involve large amounts of data reading and writing and frequent changes in storage space requirements, the technical solution of this application can quickly adapt to changes in space consumption and recycling speed by precisely controlling the proportion of metadata operations, ensuring the continuity and efficiency of computing tasks. For example, when multiple high-performance computing tasks are simultaneously writing large amounts of data, this method can promptly adjust the garbage collection rate to avoid storage space being exhausted due to short-term large-scale writes. At the same time, by controlling the concurrency of metadata operations, it ensures the maximum utilization of CPU (Central Processing Unit) resources and improves overall computing performance.
[0028] (2) Cloud computing platform: Storage resource management in a cloud computing environment faces complex and changing challenges, including fluctuations in storage demand from different tenants, dynamic creation and destruction of virtual machines, etc. The technical solution of this application can provide a fine-grained flow control mechanism through periodic MOR adjustment, effectively balancing the relationship between host writes and storage space recycling. During periods of high cloud service load, the system can dynamically increase garbage collection operations to ensure sufficient supply of storage resources, while slowing down the recycling speed during low-load periods to reduce unnecessary system overhead. This flexible flow control mechanism helps improve the resource utilization efficiency and stability of the cloud computing platform, providing users with more reliable and high-performance cloud services.
[0029] (3) Big Data Analysis System: Big data analysis tasks typically involve the rapid reading, writing, and processing of massive amounts of data, placing extremely high demands on the storage system's response speed and data processing capabilities. Through the methods described in the embodiments of this application, big data systems can achieve rapid space recovery during peak data write periods, avoiding interruptions to data flows due to insufficient storage space. At the same time, they can reduce garbage collection operations during idle periods of data processing, avoiding unnecessary waste of CPU resources. This intelligent flow control and space balancing mechanism helps big data analysis systems continuously optimize data processing performance, reduce data latency, and improve overall analysis efficiency and user experience.
[0030] (4) Data backup and recovery solution: In data backup and recovery scenarios, the space management and flow control mechanism of the storage pool are crucial to ensuring data integrity and timely recovery. The technical solution of this application can dynamically adjust the space recovery speed when data backup operations are frequent through fine-grained control of host write and garbage collection operations, ensuring that the storage system has sufficient available space to cope with sudden data backup needs. At the same time, during the data recovery process, by controlling the metadata operation ratio, it is possible to avoid the large amount of metadata modifications generated by the recovery operation affecting other normal operating tasks, ensuring timely and effective data recovery while maintaining the high throughput and stable performance of the system.
[0031] By applying the technical solution of this application to the above-mentioned scenarios, fine-grained flow control at the metadata level is achieved, which can not only effectively manage storage resources and avoid the risk of space exhaustion, but also optimize the performance of the storage system and improve the utilization efficiency of CPU resources, providing solid technical support for key businesses such as high-performance computing, cloud computing, big data analysis, and data backup and recovery.
[0032] The storage space optimization method of the embodiment of the present application can be executed by a server device, or by the server device in conjunction with at least one of the terminal devices (also understood as input / output devices 108). The storage space optimization method of the embodiment of the present application can also be executed by a client installed on the terminal device.
[0033] Taking the server as an example to execute the storage space optimization method in this embodiment, Figure 2 is a flow chart of an optional storage space optimization method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include steps S202 to S206.
[0034] Step S202 : Obtain the space usage rate of the all-flash storage pool, wherein the space usage rate is the ratio of the used storage space to the total storage space in the all-flash storage pool.
[0035] Step S204, when the space usage reaches the recovery threshold, the current metadata operation ratio of the current cycle is determined based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle, wherein the current metadata operation ratio is the ratio between the first metadata operation number generated by writing data to the all-flash storage pool in the current cycle and the second metadata operation number generated by reclaiming data in the all-flash storage pool.
[0036] Step S206 : determining the storage space consumed by writing data and the storage space released by reclaiming invalid data in the current cycle based on the current metadata operation ratio.
[0037] Before explaining the technical solution of this application, the meaning of the professional terms or professional nouns involved is briefly introduced.
[0038] All-flash storage pool: This refers to, but is not limited to, a collection of storage resources consisting entirely of solid-state drives (SSDs), such as SSD arrays. The high-speed characteristics of SSDs make all-flash storage pools the foundation of high-performance storage solutions.
[0039] Space usage: indicates the ratio of occupied storage space to total storage space in the all-flash storage pool. It is used to monitor the remaining space in the storage pool.
[0040] Recycling threshold: A pre-set value that triggers the garbage collection mechanism. Once the storage pool's space usage reaches this threshold, the garbage collection process will automatically start to free up space occupied by invalid data, ensuring the continued availability and performance of the storage pool.
[0041] Target Space Balance Ratio (SCR_T): This sets the ideal ratio between space consumption and space reclamation, based on the different stages of storage pool space utilization. For example, during low utilization, it might be set to greater than 1 to encourage space consumption; during high utilization, it might be set to less than 1 to prioritize space reclamation.
[0042] Current Metadata Operation Ratio (MOR): The ratio of metadata modifications generated by host write operations to those generated by garbage collection operations during the current cycle. This value reflects the real-time consumption and recovery of storage space.
[0043] First metadata operation: refers to the metadata update action that occurs during the host write operation, such as adding LP metadata or modifying the data fingerprint value. These operations are directly related to data writing.
[0044] Secondary metadata operations refer to metadata updates generated during garbage collection to relocate valid data, such as updating the LP mapping or pointing the data fingerprint value to a new PBA address (storage pool block address, used to locate the specific physical storage location within the storage pool, which is the address at the disk array level). These operations are key to storage pool space recovery.
[0045] It should be noted that the embodiment of the present application classifies metadata modification operations into three categories: metadata modification operations generated by host writes, metadata modification operations generated by garbage collection, and other metadata modification operations. By adjusting the ratio of metadata modification operations generated by host writes and metadata modification operations of garbage collection type, the ratio of space consumption and recovery speed is achieved, thereby achieving IO granularity flow control and balance.
[0046] To facilitate understanding, first combine Figure 3 The specific embodiment shown briefly introduces the overall implementation process of the above storage space optimization method.
[0047] like Figure 3 As shown, it is assumed that during the host write process, the space utilization rate of the all-flash storage pool is monitored in real time. For example, it is idle at time t1 of the first cycle, a small amount of data is written at time t2 of the second cycle, and most of the space is still idle; at time t3 of the third cycle, the space occupied by the written data increases sharply. If it is determined at this time that the space utilization rate is greater than or equal to the recycling threshold, the recycling process will be started in the fourth cycle.
[0048] Since the space usage rates in the first three cycles did not reach the recovery threshold, the fourth cycle is the first cycle to start flow control. Therefore, the pre-set initial target space balance ratio and the actual space balance ratio of the third cycle can be used to determine the current metadata operation ratio MOR0 of the fourth cycle (which can also be understood as the current cycle).
[0049] Based on the current metadata operation ratio, the balance between the consumed space occupied by written data and the reclaimed space (also known as freed space) released by starting to reclaim invalid data in the all-flash storage pool is controlled in the fourth cycle to ensure the continuous availability and storage performance of the all-flash storage pool.
[0050] Similarly, when time passes to the fifth cycle, the current metadata operation ratio MOR1 of the fifth cycle is determined by looking up the target space balance ratio of the fifth cycle and the actual space balance ratio of the fourth cycle. The balance between consumed space and reclaimed space in the fifth cycle is controlled based on MOR1.
[0051] In this embodiment, the metadata operation ratio (which can also be understood as the metadata modification operation ratio) is used to regulate the balance between consumed and released space in the all-flash storage pool. This is because in an all-flash storage pool, the number of metadata modification operations and space consumption (or space reclamation) are linearly proportional. The following is the derivation of the relationship between the two.
[0052] S11, host write is a linear relationship between the number of metadata operations and space consumption.
[0053] The specific formula is as follows (1):
[0054] MOPH = F1 * SC (1)
[0055] MOPH (Metadata Operation of Host) refers to host-generated metadata modification operations, including but not limited to host-generated metadata operations, that modify the all-flash storage system's metadata during read and write operations. Examples include updating the mapping between logical block addresses (LBAs) and physical block addresses (PBAs), and maintaining the logical view of data. SC (Space Consumed), also known as occupied space, describes the total amount of storage space occupied by data in the storage system. F1 represents the first linear coefficient.
[0056] The linear relationship in formula (1) above exists because data is mapped to a fixed granularity, such as 4KB or 8KB, called a grain. Writes and reads are done at the grain granularity, and each grain uses a mapping from LBA to PBA. Each write to the same LBA always goes to a new PBA address. Therefore, the number of writes per grain is proportional to the space consumed, and the number of metadata operations recorded by each grain, such as the number of LP metadata inserts, is also proportional to the number of grain writes.
[0057] S12, the number of metadata operations generated for data relocation during garbage collection is also linearly proportional to the space recovery speed.
[0058] The specific formula is as follows (2):
[0059] MOPG = F2 * SR (2)
[0060] Among them, MOPG (Meta data Operation of Garbage Collection, the number of metadata operations generated by garbage collection), SR (Space Reclaim, the number of space reclaimed), and F2 are the second linear coefficients.
[0061] The linear relationship in formula (2) above exists because during garbage collection, the data inefficiency of all blocks (here refers to data blocks containing data) is tracked and sorted, and the blocks with the highest inefficiency are selected for priority recycling. Similar to host IO, at a certain granularity, such as within a data block range, the number of metadata operations generated by the data that needs to be relocated when recycling one or more blocks is proportional to the recycled space.
[0062] S13, according to the above formula (1) and formula (2), the relationship between the ratio of the two types of metadata modification operations and the ratio of space consumption is obtained.
[0063] The specific formula is as follows (3):
[0064] MOPH / MOPG = ( F1 * SC) / (F2 * SR) = (F1 / F2) * (SC / SR) = F3 * (SC / SR) (3)
[0065] The third linear coefficient F3=F1 / F2, and F3 is a nearly fixed coefficient in a local range.
[0066] Formula (3) shows that the ratio of metadata operations generated by host writes to those generated by garbage collection, MOPH / MOPG, is directly proportional to the ratio of space consumption to space recovery, SC / SR. MOR = MOPH / MOPG, representing the ratio of metadata operations generated by host writes to those generated by garbage collection, and SCR = SC / SR, representing the Space Consuming Ratio, representing the ratio of space consumption to the amount of space recovered. This allows us to derive the following formula (4).
[0067] MOR = F3 * SCR (4)
[0068] Therefore, we can see that the metadata operation ratio is directly proportional to the spatial balance ratio. In other words, controlling the MOR can achieve controlling the SCR.
[0069] In this embodiment, a metadata-level flow control mechanism enables more precise and efficient regulation of the speed between space consumption and space reclamation, achieving a dynamic balance of storage space within the all-flash storage pool. Specifically, by monitoring the storage pool's space utilization in real time and determining that the reclamation threshold has been reached, the system not only adjusts the processing order and rate of metadata operations based on the target and actual space balance ratios, but also rapidly responds to changes in the actual ratio of space consumption and reclamation through periodic MOR calculations and adjustments, ensuring the continued availability of space.
[0070] By adopting the above-mentioned embodiment provided by the present application, by monitoring the space utilization rate of the all-flash storage pool in real time, when the space utilization rate reaches the recovery threshold, the current metadata operation ratio of the current cycle is determined based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle. Among them, by introducing the current metadata operation ratio, the ratio between host writes and garbage collection operations can be adjusted to meet the target space balance ratio. The exhaustion of storage space is effectively avoided. At the same time, through the periodic negative feedback adjustment mechanism, the adjustment speed and accuracy are improved, the data response time and performance fluctuations are reduced, and the stable operation of the all-flash storage pool under high space utilization is achieved, the host write performance is guaranteed, the system overhead caused by garbage collection is reduced, and the overall performance of the all-flash storage system is enhanced.
[0071] In an exemplary embodiment, when the space utilization rate reaches the recovery threshold, the current metadata operation ratio of the current period is determined based on the target space balance ratio of the current period and the actual space balance ratio of the previous period, including: obtaining the historical metadata operation ratio of the previous period; determining the correction coefficient based on the target space balance ratio of the current period and the actual space balance ratio of the previous period, wherein the target space balance ratio is the ratio between the space consumption rate and the space release rate in the current period, and the actual space balance ratio is the ratio between the actual space consumption rate and the actual space release rate in the previous period.
[0072] To determine the metadata operation ratio for the current cycle, we first need to review the historical metadata operation ratio for the previous cycle. The historical metadata operation ratio is calculated by comparing the number of metadata modifications caused by host write operations and garbage collection operations in the previous cycle.
[0073] For example, if host write operations generated 20,000 metadata modifications and garbage collection operations generated 10,000 modifications during the previous cycle, then the historical metadata operation ratio for the previous cycle is equal to 2 (that is, the number of metadata modifications generated by host write operations is twice that of garbage collection operations).
[0074] After determining the historical metadata operation ratio MORc of the previous cycle, the correction coefficient MORf can be calculated based on, but not limited to, the SCR_T set for the current cycle and the SCR_R of the previous cycle. The calculation process can refer to the description in the above embodiment.
[0075] For example, suppose the preset goal is to achieve a ratio of 1:1 between the space consumption rate and the target space release rate, i.e., SCR_T = 1. However, in the previous cycle, the ratio of the actual space consumption rate to the actual space release rate was 1.5:1, i.e., SCR_R = 1.5. Based on the derivation process in the above embodiment, the correction factor MORf = 0.66 can be obtained.
[0076] In other words, the historical metadata operation ratio needs to be adjusted to perform garbage collection operations at a faster rate, slowing down the host write speed, and thus bringing the space balance ratio back to the target value. Specifically, the product of the historical metadata operation ratio and the correction factor is determined as the current metadata operation ratio.
[0077] In this embodiment, by introducing historical metadata operation ratios and correction coefficients, the flow control strategy can more flexibly and efficiently respond to fluctuations in storage pool space utilization. The core of this mechanism lies in rapid feedback and precise adjustment. By periodically calculating the correction coefficient and applying it to the calculation of metadata operation ratios in future cycles (the cycle after the current cycle, or the cycle after the previous cycle), the all-flash storage pool can maintain a good space balance in high-load environments. This prevents space exhaustion while ensuring that host write performance is not affected by excessive flow throttling, maintaining system stability and high performance.
[0078] Compared with traditional fixed flow control levels, the flow control algorithm based on metadata operation ratio in this embodiment significantly improves the accuracy and speed of regulation, especially when dealing with scenarios with drastic changes in space utilization. It can respond quickly to maintain the stable operation of the all-flash storage pool and optimize performance.
[0079] In a specific example, it is possible but not limited to periodic MOR control and real-time monitoring of the actual value of SCR in the previous cycle to modify the historical metadata operation ratio, thereby achieving the goal of quickly reaching the SCR target value (the target space balance ratio of the current cycle).
[0080] Specifically, assuming the SCR target value is SCR_T, where T represents Target, and the MOR used in the previous cycle is recorded as MORc, the actual value of the SCR in the previous cycle (recorded as SCR_R, where R represents Real) is detected in real time, and MORc is corrected to obtain the current metadata operation ratio of the current cycle. The derivation process is as follows.
[0081] Assume that the theoretical value MOR' of the current cycle is obtained by the following formula (5):
[0082] MOR '= F3 * SCR_T (5)
[0083] The actual value of the previous cycle is determined by the following formula (6):
[0084] MORc = F3 * SCR_R (6)
[0085] Based on the above formulas (5) and (6), it is deduced that F3 = MORc / SCR_R, and MOR' is further deduced as shown in the following formula (7):
[0086] MOR ' = MORc / SCR_R*SCR_T = MORc * (SCR_T / SCR_R) (7)
[0087] Note that MORf = SCR_T / SCR_R, and MOR ' can be derived as follows (8):
[0088] MOR' = MORc * MORf (8)
[0089] That is, based on SCR_T and SCR_R, the correction coefficient MORf=SCR_T / SCR_R is calculated, and the corrected MOR'=MORc*MORf.
[0090] like Figure 4 As shown, assuming the input is the target value of SCR_T, the MOR is modified through negative feedback of MORf so that the output SCR_R approaches the target value of SCR_T. In other words, in this embodiment of the application, by modifying the negative feedback control of MOR based on the space utilization rate, the speed adjustment between space consumption and space recovery is made more precise and efficient.
[0091] Specifically, by monitoring the space utilization rate of the all-flash storage pool and determining when the recovery threshold is reached, the system can not only adjust the processing order and rate of metadata operations according to the target space balance ratio, but also quickly respond to actual changes in the ratio of space consumption and recovery through periodic MOR calculation and adjustment, thereby ensuring the continuous availability of space.
[0092] This approach, combining historical metadata operation ratios with dynamic correction coefficients, enables fine-grained flow control of host write and garbage collection operations within an all-flash storage pool. This not only allows for immediate response to changes in storage pool space utilization, but also adjusts the metadata operation ratios between adjacent cycles by calculating correction coefficients, ensuring that space consumption and space release rates precisely match the set target ratio (SCR_T).
[0093] The above method not only shortens the response time of space flow control, improves the accuracy of regulation, and avoids excessive consumption or waste of storage space, but also maintains the high performance and stability of the system while ensuring efficient use of storage pool space and reducing data processing delays.
[0094] In an exemplary embodiment, the correction coefficient is determined based on the target spatial balance ratio of the current cycle and the actual spatial balance ratio of the previous cycle, including: determining the ratio between the target spatial balance ratio of the current cycle and the actual spatial balance ratio of the previous cycle as the correction coefficient.
[0095] The target space balance ratio (SCR_T) can be, but is not limited to, a preset ideal ratio of space consumption to space release based on the current storage pool space usage. The SCR_T value varies in different usage ranges to meet storage pool space management needs.
[0096] The actual space balance ratio (SCR_R) can be used, but is not limited to, to indicate the actual ratio of space consumption to space release during the storage pool's actual operating state over the previous cycle. It directly reflects the current behavior of the storage system and is used to assess whether the system meets expected space management goals.
[0097] The correction factor (MORf) can be, but is not limited to, calculated based on the difference between the current target spatial balance ratio and the actual spatial balance ratio of the previous period, and is used to adjust the historical metadata operation ratio of the previous period to obtain the current metadata operation ratio of the current period, ensuring that the system can quickly converge to the desired spatial balance state.
[0098] The correction coefficient determination method described in this embodiment is a fast and intuitive means of adjusting flow control. This method requires only a simple ratio comparison to determine the correction coefficient, simplifying the process of updating flow control parameters and accelerating system response. This method is particularly suitable for scenarios requiring frequent adjustments to the space balance ratio. It can quickly guide the system metadata operation ratio to near the target value, reducing storage performance bottlenecks caused by improper space management while ensuring the long-term stable operation of the all-flash storage pool.
[0099] Furthermore, by comparing the current target space balance ratio with historical actual space balance ratios, computational complexity is reduced, avoiding the lag effect that can result from over-reliance on historical data, and making flow control strategies more flexible and timely. This improvement is particularly important for handling sudden large-scale data writes or recycling scenarios, as it allows for rapid adjustments to the storage system's operational trends, maintaining a dynamic balance between space consumption and release, and ensuring system efficiency and reliability.
[0100] In summary, the technical solution in this embodiment simplifies the calculation of the correction coefficient while enhancing the immediate response capability of the flow control mechanism, providing a more efficient and flexible IO flow control and space balancing solution for the all-flash storage pool, which is suitable for various application environments that require high data throughput and space utilization.
[0101] In an exemplary embodiment, the above method also includes: obtaining N metadata operation ratios corresponding to N periods before the current period, where N is a positive integer greater than or equal to 2; and performing weighted summation on the N metadata operation ratios to obtain the current metadata operation ratio of the current period.
[0102] In addition to the method of determining the current metadata operation ratio of the current period based on the historical metadata operation ratio and correction coefficient of the previous period in the above embodiment, the current metadata operation ratio can also be obtained by obtaining N metadata operation ratios corresponding to N historical periods and performing weighted summation on the N metadata operation ratios.
[0103] The difference between this embodiment and the above embodiment in which the historical metadata operation ratio of the previous cycle is used to determine the current metadata operation ratio is that the current metadata operation ratio of the current cycle is calculated in a different manner. For example, assuming N=4, the weights are w1=0.1, w2=0.2, w3=0.2, and w4=0.5, respectively. Then, the current metadata operation ratio can be determined by, but is not limited to, the following formula (9):
[0104] MOR=0.1*MOR1+0.2*MOR2+0.3*MOR3+0.5*MOR4*MORf (9)
[0105] Among them, MOR1 is the actual metadata operation ratio of the previous period (first historical period) adjacent to the current period, MOR2 is the actual metadata operation ratio of the second historical period adjacent to the previous period and before the previous period, MOR3 is the actual metadata operation ratio of the third historical period adjacent to the second historical period and before the second historical period, and MOR4 is the actual metadata operation ratio of the fourth historical period adjacent to the third historical period and before the third historical period.
[0106] Compared to directly using the historical metadata operation ratio of the previous cycle (a single cycle) to determine the current metadata operation ratio, this embodiment uses a weighted summation approach to determine the current metadata operation ratio, further emphasizing the importance of historical data. Furthermore, by comprehensively considering the MOR values of multiple consecutive cycles, a weighted summation approach is used to determine the current cycle's MOR. This approach has the following advantages.
[0107] (1) Enhance the stability and predictability of the flow control strategy: Weighted summation can smooth out possible short-term operational fluctuations and provide a stable MOR value that reflects recent operational trends. This is helpful for predicting space usage in future cycles and making flow control preparations in advance.
[0108] (2) Improve the accuracy of flow control regulation: By assigning different weights to different periods, the system can more accurately capture the changing trend of space utilization and then adjust the MOR value to ensure that the flow control measures can not only respond to emergencies but also maintain long-term performance and space utilization efficiency.
[0109] (3) Optimize resource allocation and performance: Comprehensively consider the flow control strategy of historical data to maximize system performance while ensuring efficient use of storage space, reduce host write operation delays caused by excessive flow control, and improve the overall response speed of the storage system and user satisfaction.
[0110] Through the technical solution in this embodiment, a more robust, accurate, and efficient flow control system is constructed by weighted summing of the metadata operation ratios of N historical periods. This provides excellent space management capabilities and system performance for all-flash storage arrays in high-throughput, high-data-density application scenarios, while also increasing the flexibility of the solution.
[0111] In an exemplary embodiment, when the above-mentioned space utilization rate reaches the recovery threshold, before determining the current metadata operation ratio of the current period based on the target space balance ratio of the current period and the actual space balance ratio of the previous period, the above-mentioned method also includes: based on the space utilization rate, determining the target space balance ratio of the current period corresponding to the space utilization rate from the target mapping table; wherein, the target mapping table records the mapping relationship between different space utilization rates and space balance ratios of different values.
[0112] The target mapping table may be, but is not limited to, a table that sets the target space operation ratio SCR_T by referring to the storage pool space usage rate. Figure 7 shown. Figure 7 The table in [1] sets the ideal ratio of space consumption to space release that should be maintained for host write operations and garbage collection operations based on different space usage thresholds. It is a key basis for formulating flow control strategies.
[0113] If the current space usage of the all-flash storage pool reaches the reclamation threshold, for example, 97%, the system queries the pre-created target mapping table based on the current space usage to determine the target space balance ratio (SCR_T).
[0114] For example, when the space utilization rate is 97%, the corresponding SCR_T is 0.8:1. This indicates that in the current cycle, the system should try to control the space consumption rate to be lower than the space release rate to avoid excessive space consumption while maintaining the normal operation and service quality of the storage pool.
[0115] In this embodiment, a target mapping table is introduced to automatically match the all-flash storage pool space usage with the target space balance ratio, providing a guide for dynamic adjustment of the all-flash storage pool's flow control strategy. The advantages of this method are mainly reflected in the following aspects.
[0116] Dynamic adaptability: The target space operation ratio is adjusted based on space utilization, enabling rapid response to changes in storage pool space capacity pressure, ensuring that the flow control strategy closely matches actual needs.
[0117] Fine-grained flow control: By setting target space operation ratios at different space utilization rates, the system can more finely control the balance between host write and garbage collection operations, avoiding performance bottlenecks caused by insufficient capacity and preventing service delays caused by excessive flow control.
[0118] Simplified decision-making process: The target mapping table clarifies the corresponding space balance ratio under different space utilization rates, simplifies the process of formulating and adjusting flow control policies, reduces manual intervention, and improves the efficiency and reliability of automated management.
[0119] In summary, by dynamically querying the target mapping table and automatically selecting the target space operation ratio based on the current space utilization rate of the storage pool, a flexible and sophisticated flow control mechanism has been established. This ensures that the all-flash storage pool can maintain good space management and high-performance output under various space pressures, meeting the space flow control needs of data centers and high-density storage environments.
[0120] In an exemplary embodiment, the method further includes: adjusting the historical space balance ratio of the previous period based on the space usage rate and the target threshold value to obtain the target space balance ratio of the current period.
[0121] In addition to determining the target space balance ratio by querying the target mapping table in the above embodiment, the historical space balance ratio of the previous cycle can also be adjusted by comparing the space utilization rate with the target threshold to obtain the target space balance ratio of the current cycle.
[0122] In a specific example, the system monitors the space usage of an all-flash storage pool in real time, calculates the degree of storage space occupied (i.e., space utilization), and compares this with a preset target threshold to determine whether the flow control strategy needs to be adjusted. For example, if the target threshold is set at 95% and the current space utilization is monitored at 97%, the system will identify that the current storage pressure has exceeded the warning range and needs to activate the flow control strategy.
[0123] The system adjusts the historical space balance ratio based on space utilization and the target threshold. That is, if space utilization is determined to have exceeded the target threshold, the system will use this information to adjust the historical space balance ratio (SCR_R) of the previous cycle to obtain the target space balance ratio (SCR_T) of the current cycle. This adjustment process combines the specific value of space utilization with the target threshold to quickly respond to changes in storage pressure and ensure that the flow control policy can alleviate space pressure without excessively restricting system performance.
[0124] By evaluating the all-flash storage pool's space utilization in real time and comparing it to the target threshold, the system dynamically adjusts the historical space balance ratio to determine the target space balance ratio for the current cycle. This ensures the immediate responsiveness and refinement of the flow control policy, enabling it to quickly adapt to changes in storage pool space pressure, effectively balancing the speed of host writes and garbage collection operations, and avoiding performance degradation caused by space exhaustion or excessive flow control.
[0125] At the same time, it simplifies decision-making processes, reduces manual intervention, and significantly enhances automated management capabilities. This ensures that the storage system can maintain high-efficiency operation and respond promptly to capacity demands in different space usage scenarios, meeting the dual high standards of storage performance and resource management required by data centers and cloud services.
[0126] In an exemplary embodiment, the above-mentioned adjustment of the historical space balance ratio of the previous period based on the space utilization rate and the target threshold value to obtain the target space balance ratio of the current period includes: when the space utilization rate is less than the target threshold value, determining the historical space balance ratio as the target space balance ratio, wherein the value of the target space balance ratio is greater than 1; when the space utilization rate is equal to the target threshold value, adjusting the value of the historical space balance ratio to 1, and determining the adjusted first space balance ratio as the target space balance ratio; when the space utilization rate is greater than the target threshold value, adjusting the value of the historical space balance ratio to less than 1, and determining the adjusted second space balance ratio as the target space balance ratio.
[0127] First, the storage space utilization rate of the all-flash storage pool is divided into segments, and the corresponding SCR target values are set as follows: Figure 5 As shown, there are several adjustment methods as follows.
[0128] (1) When the storage space usage is low, flow control is not required, or SCR_T is set to greater than 1 so that the space consumption rate is greater than the space recovery rate.
[0129] (2) When the storage space usage reaches a certain threshold, SCR_T is set to 1, indicating that the space consumption rate is equal to the space recovery rate, and is in a balanced or near-balanced state.
[0130] (3) When the storage space usage rate is higher than a certain threshold, set SCR_T to less than 1, indicating that the space consumption rate is less than the space recovery rate, to avoid space exhaustion.
[0131] In other words, if the space usage is less than the target threshold, the system determines that the storage pressure is still within the acceptable range. In this case, the target space balance ratio should be set to greater than 1, which means that the speed of space consumption can be faster than the speed of space reclamation, so as to fully utilize storage resources without immediately initiating flow control.
[0132] If the space usage rate is equal to the target threshold, it means that the system is approaching the critical point of flow control. The target space balance ratio should be adjusted to 1 to ensure that the speed of space consumption and space reclamation is equal, thus maintaining the space balance of the storage pool.
[0133] If the space usage exceeds the target threshold, the system detects excessive storage capacity pressure. In this case, the target space balance ratio should be adjusted to less than 1. This means that space reclaiming should be faster than space consumption to alleviate storage pressure and prevent storage pool space from running out.
[0134] In this embodiment, by specifying the target space balance ratio setting rules under different space usage conditions, dynamic adjustment of the host write and garbage collection operation flow control strategy in the all-flash storage pool is achieved. The advantages of this method include but are not limited to the following aspects.
[0135] (1) Intelligent response to storage capacity pressure: When storage pressure is low, the system tends to make full use of storage space to improve the efficiency of host write operations; when approaching or reaching the set target threshold, the flow control strategy is immediately adjusted to ensure space balance; and under high pressure, the space recovery speed is accelerated to urgently alleviate the situation of insufficient storage capacity.
[0136] (2) Flexible flow control strategy adjustment: The solution in this embodiment is based on the comparison between the space utilization rate and the target threshold, and flexibly adjusts the target space balance ratio, so that the flow control strategy can not only adapt to the current state of the storage pool, but also proactively respond to future changes in storage demand.
[0137] (3) Balancing performance and security: By dynamically adjusting the target space balance ratio, the system ensures data storage security (avoiding space exhaustion) while maintaining high performance to the greatest extent possible, reducing the latency of host write operations, and improving user experience and the overall efficiency of the storage system.
[0138] In an exemplary embodiment, the above-mentioned determination of the consumed storage space obtained by writing data and the released storage space obtained by reclaiming invalid data in the current cycle based on the current metadata operation ratio includes: determining a first quota of first-type metadata modification requests and a second quota of second-type metadata modification requests allowed to be processed in the current cycle based on the current metadata operation ratio and the number of metadata modification requests, wherein the first-type metadata modification request is a modification request corresponding to writing data to the all-flash storage pool, and the second-type metadata modification request is a modification request corresponding to reclaiming invalid data in the all-flash storage pool; when it is determined that the metadata modification request issuance condition is met, the first-type metadata modification request and the second-type metadata modification request are issued according to the remaining quota ratio. type metadata modification request; based on the first type metadata modification request, executing a first type metadata modification operation with a first number of operation times, wherein the first type metadata modification operation includes a modification operation generated by writing data to the all-flash storage pool; based on the second type metadata modification request, executing a second type metadata modification operation with a second number of operation times, wherein the second type metadata modification operation includes a modification operation generated by reclaiming data in the all-flash storage pool; based on the first type metadata modification operation with the first number of operation times, determining the consumed storage space obtained by writing data in the current cycle; and based on the second type metadata modification operation with the second number of operation times, determining the released storage space obtained by reclaiming invalid data in the current cycle.
[0139] Among them, the first type of metadata modification request refers to the metadata modification request corresponding to the host write operation, which mainly involves the writing of new data and the updating of LP metadata; the second type of metadata modification request is actually the metadata modification request corresponding to the garbage collection operation, which involves the cleaning of invalid data and the updating of LP metadata.
[0140] The quota may refer to, but is not limited to, the maximum number of metadata modification requests that the system is allowed to process within the current cycle, and is divided into a first quota and a second quota. The first quota corresponds to a first total number of first-type metadata modification requests, and the second quota corresponds to a second total number of second-type metadata modification requests.
[0141] The first-ary number of operations represents the number of first-type metadata modification requests executed in the current cycle, and the second-ary number of operations represents the number of second-type metadata modification requests executed in the current cycle. Both are used to calculate the amount of storage space consumption and released space in the current cycle.
[0142] Based on the current metadata operation ratio and the number of metadata modification requests, the system determines the first quota for type 1 (host write) metadata modification requests and the second quota for type 2 (garbage collection) metadata modification requests within the current cycle. This step ensures that the system can properly allocate resources to process type 1 and type 2 metadata modification requests according to the flow control policy.
[0143] If the conditions for issuing metadata modification requests are met, the corresponding request is issued based on the remaining quota ratio of first-type metadata modification requests and second-type metadata modification requests. This step aims to ensure a balance between host write operations and garbage collection operations through fine-grained control, while maximizing CPU utilization and system performance. The following describes in detail how to determine whether the conditions for issuing metadata modification requests are met, using specific examples.
[0144] For example, assume that 5,000 first-type metadata modification request requests have been issued in the queue, leaving 1,667 remaining; and 2,000 second-type metadata modification request requests have been issued in the queue, leaving 1,333 remaining. The current system maximum concurrency is 500, the number of metadata modification requests of both types currently being processed is 400, and the system can issue 100 metadata modification requests. The number of first-type metadata modification requests that can be issued based on the remaining quota is the first metadata operation count, such as 54. The number of second-type metadata modification requests that can be issued based on the remaining quota is the second metadata operation count, such as 46.
[0145] By determining the number of first-type metadata modification operations (host writes) and second-type metadata modification operations (garbage collection), the amount of storage space consumed and released during the current cycle is determined. This step enables accurate calculation of storage space consumption and recovery, providing a data foundation for subsequent adjustments to flow control strategies.
[0146] In order to more clearly understand the overall implementation process of determining the consumed storage space obtained by writing data and the released storage space obtained by recycling invalid data in the current cycle based on the current metadata operation ratio, it is further described below with reference to a specific example.
[0147] S21, setting SCR_T values of different space usage rates of the all-flash storage pool in segments.
[0148] For details, please refer to Figure 7 The different SCR_T values corresponding to different usage rates in the target mapping table are not described in detail here.
[0149] S22, passed Figure 6The metadata module shown adds metadata modification requests submitted by the host write module and the garbage collection module to different queues respectively, and counts the number of metadata modification requests being processed but not completed and the number of metadata modification requests completed in the current cycle according to the host write and garbage collection categories.
[0150] S23, setting the processing cycle.
[0151] For example, by Figure 6 The metadata module shown takes processing MetaReqCnt metadata modification requests as a cycle, such as MetaReqCnt=10000, and calculates the MOR value of the next cycle at the beginning of each cycle.
[0152] Specifically, the correction coefficient MORf=SCR_T / SCR_R in the above formula and MOR'=MORc*MORf in the above formula (8) are calculated to quickly calculate the MOR value of the next cycle.
[0153] Among them, SCR_T can be but not limited to finding Figure 7 The current storage pool space usage is obtained from the target mapping table shown in the figure. SCR_R is obtained from the space management and read-write modules based on statistical analysis. MORc is the MOR value used in the previous cycle.
[0154] S24, the metadata module determines the number of two types of metadata modification requests that need to be issued in the current batch within the current cycle based on the MOR value, the queue length of the two types of metadata modification requests, namely host write and garbage collection, the number of metadata modification requests of the two types that are being processed but not completed, and the number of metadata modification requests of the two types that have been completed in the current cycle.
[0155] The following describes in detail the process of implementing the number of two types of metadata modification requests that need to be issued in a batch within a cycle in conjunction with specific embodiments.
[0156] Obviously, within a time period, two types of metadata modification requests may be issued in batches multiple times at preset time intervals. Alternatively, two types of metadata modification requests may be issued in equal quantities based on the number of metadata modification requests in each batch. This is not limited in this embodiment.
[0157] This embodiment establishes a closed-loop flow control mechanism from quota allocation to request processing and storage space change calculation by determining the processing quota based on the current metadata operation ratio and the number of metadata modification requests, issuing metadata modification requests based on the remaining quota ratio, and finally executing the metadata modification operations and calculating the storage space change. The advantages of this mechanism include, but are not limited to, the following aspects.
[0158] (1) Accurately control the flow control strategy: Through quota allocation, the system can accurately control the ratio of host write operations to garbage collection operations, avoid excessive space consumption or insufficient recovery, and ensure the stable operation of the storage pool.
[0159] (2) Efficient resource utilization: The remaining quota ratio distribution mechanism ensures that CPU resources are efficiently utilized when concurrency conditions are met, while avoiding performance losses caused by improper resource allocation.
[0160] (3) Dynamic space management: After performing metadata modification operations, the system can accurately calculate the consumption and release of storage space, providing real-time feedback for subsequent adjustments to flow control strategies, and enhancing the dynamics and flexibility of space management.
[0161] In summary, the technical solution in this embodiment achieves precise flow control of metadata operations and dynamic balance of space management in the all-flash storage pool through fine quota allocation and request issuance, providing support for high-performance operation of the storage system under different loads.
[0162] In an exemplary embodiment, when it is determined that the conditions for issuing metadata modification requests are met, issuing the first type of metadata modification requests and the second type of metadata modification requests according to the remaining quota ratio includes: when a first remaining quota of the first type of metadata modification requests is greater than 0, and the sum of a first number of the first type of metadata modification requests issued but not completed and a second number of the second type of metadata modification requests issued but not completed in the current cycle is less than the maximum concurrent number, issuing the first type of metadata modification requests of the current batch according to the first remaining quota ratio; when a second remaining quota of the second type of metadata modification requests is greater than 0, and the sum of the first number and the second number is less than the maximum concurrent number, issuing the second type of metadata modification requests of the current batch according to the second remaining quota ratio.
[0163] In the embodiment of the present application, the conditions for determining whether a type of metadata modification request can be issued may be determined by, but is not limited to, the following steps.
[0164] S31, determining whether the remaining amount of the class metadata modification request is greater than 0.
[0165] The remaining amount is equal to the total amount minus the number of metadata modification requests that have been issued (including completed and issued but not completed).
[0166] If it is greater than 0, execute the following step S32.
[0167] S32: Whether the number of the two types of metadata requests that have been issued but not completed is less than the predetermined maximum concurrent number.
[0168] If yes, execute the following step S33; otherwise, stop the process.
[0169] S33: Send this type of metadata request.
[0170] The process of determining the number of metadata modification requests issued in the current batch within a cycle will be described in detail below with reference to specific embodiments.
[0171] This embodiment further refines the metadata modification request issuance process, and through dual-condition judgment based on the remaining quota and the number of concurrent operations, it implements intelligent scheduling of two types of metadata operations: host write and garbage collection. The core advantages of this method include the following aspects.
[0172] (1) Dynamic adjustment of metadata operation quota: The remaining quota mechanism ensures that the processing quota of metadata modification requests is dynamically adjusted according to the processing status in the current cycle, avoiding resource waste and ensuring the adaptability of the system when space utilization changes.
[0173] (2) Maximizing CPU utilization efficiency: The setting of the maximum number of concurrent operations effectively controls the concurrency of metadata operations, prevents CPU overload, and ensures efficient CPU utilization within the permitted range of resources, thereby improving the overall performance of the system.
[0174] (3) Refined flow control strategy: Metadata modification requests are issued according to the remaining quota ratio, which realizes the refined operation of flow control strategy, ensures the balance between host write operations and garbage collection operations, and avoids storage pool space exhaustion or performance bottlenecks caused by improper flow control strategy adjustment.
[0175] In summary, through the comprehensive judgment of remaining quota and concurrency conditions, the intelligent issuance and scheduling of metadata modification requests are achieved, ensuring the stable operation and high performance of the all-flash storage pool under different space utilization and load conditions.
[0176] In an exemplary embodiment, the issuing of the first-type metadata modification requests of the current batch according to the first remaining quota ratio includes: determining a difference between the maximum concurrent number and the first number to obtain a first difference value; multiplying the first difference value and the first remaining quota to determine a first value, wherein the first remaining quota is the difference between the first quota and a third number of issued first-type metadata modification requests, and the first quota represents a first total number of first-type metadata modification requests allowed to be issued in the current period; determining a first remaining quota ratio as a ratio of the first value to the total remaining quota, wherein the total remaining quota is the sum of the first remaining quota and the second remaining quota, and the second remaining quota is the difference between the second quota and a fourth number of issued second-type metadata modification requests, and the second quota represents a second total number of second-type metadata modification requests allowed to be issued in the current period; issuing the first-type metadata modification requests of the current batch according to the first remaining quota ratio, wherein at least one batch of metadata modification requests is allowed to be issued in the current period.
[0177] First, based on MetaReqCnt and MOR, the total amount of the two types of metadata modification requests in this cycle is calculated, which is determined by the following formulas (10) and (11):
[0178] QT_HOST = MetaReqCnt*MOR / (MOR+1) (10)
[0179] QT_GC = MetaReqCnt / (MOR+1) (11)
[0180] Among them, QT_HOST and QT_GC respectively represent the total amount of two types of metadata modification requests in this cycle (current cycle): host write and garbage collection.
[0181] When it is determined according to the above steps S31 to S33 that the conditions for issuing a certain type of metadata modification request are met, the number of metadata modification requests of this type that can be issued in the current batch of the current cycle (which can also be understood as this time) can be determined by, but not limited to, the following formula (12).
[0182] (12)
[0183] That is, the number of metadata modification requests issued is proportional to the remaining quota.
[0184] In this embodiment, by introducing the concepts of the first difference and the first remaining quota, the concurrency control and processing quota allocation mechanism of the metadata modification request are refined. The core is to use a mathematical model to accurately calculate the first remaining quota ratio based on the maximum concurrency limit and the remaining quota of each type of request. This ratio guides the system to reasonably adjust the number of requests issued for host write and garbage collection operations while ensuring that the number of concurrency does not exceed the upper limit. In this way, not only can the consumption and recovery speed of storage space be dynamically balanced, but also the system resources can be fully utilized to improve CPU utilization and overall operating efficiency. It is especially suitable for all-flash storage pool application scenarios with high load and high performance requirements. At the same time, allowing multiple batches of metadata modification requests to be issued increases the flexibility of the flow control strategy, helps the system to more smoothly respond to sudden high-concurrency requests, and ensures seamless connection between data storage and recovery operations.
[0185] Similarly, issuing the second type of metadata modification requests of the current batch according to the second remaining quota ratio can be achieved, but is not limited to, in the following manner: determining the difference between the maximum concurrent number and the second number to obtain a second difference value; multiplying the second difference value and the second remaining quota as a second value, wherein the second remaining quota is the difference between the second quota and the fifth number of the second type metadata modification requests that have been issued; determining the ratio between the second value and the total remaining quota as the second remaining quota ratio, wherein the total remaining quota is the sum of the first remaining quota and the second remaining quota; issuing the second type of metadata modification requests of the current batch according to the second remaining quota ratio.
[0186] For example, assume that the first remaining quota for Type 1 metadata modification requests in the current cycle is 2000, the second remaining quota for Type 1 metadata modification requests is 1000, the number of issued but uncompleted Type 1 metadata modification requests is 500, the number of issued but uncompleted Type 2 metadata modification requests is 300, and the system's maximum concurrency is set to 1000. At this point, the remaining quota for Type 1 metadata modification requests is 2000, and the sum of the number of issued but uncompleted Type 1 and Type 2 metadata modification requests is 800, which is less than the maximum concurrency of 1000. The system can issue Type 1 metadata modification requests at a ratio of 2:1 (i.e., the ratio of the first remaining quota to the second remaining quota).
[0187] For example, if the remaining quota for Type 1 metadata modification requests has dropped to 0 in the current cycle, while the remaining quota for Type 2 metadata modification requests is still 1000, and the total number of outstanding Type 1 and Type 2 metadata modification requests in the system is 800, which is also less than the maximum concurrency of 1000. In this case, the system can use all remaining concurrency resources to issue Type 2 metadata modification requests to accelerate garbage collection and ensure storage space security.
[0188] By introducing the concepts of first difference, first value, first remaining quota ratio, and second remaining quota ratio, a dynamic and precise flow control method is implemented, which effectively balances host write and garbage collection operations in the all-flash storage pool.
[0189] This technical solution calculates the difference between the maximum concurrency and the number of ongoing host write requests, ensuring that the system properly schedules resources without exceeding the concurrency limit. It also combines the remaining quota with the difference to calculate the proportion of requests to be issued, accurately quantifying the allocation of remaining resources. This allows the system to dynamically adjust the processing rate of host write and garbage collection requests based on real-time load conditions.
[0190] For example, if the system detects that the current host write requests are low, but the demand for garbage collection operations is high, the technical solution in this embodiment can automatically increase the quota for garbage collection operations, speeding up the cleaning of invalid data, and vice versa. This dynamic allocation mechanism not only improves the efficiency of storage space utilization, but also optimizes system response time and overall performance. It ensures that in a high-concurrency environment, the storage pool can both meet the host write needs and complete garbage collection tasks in a timely manner, achieving the dual goals of continuous storage space availability and stable and efficient system operation.
[0191] In an exemplary embodiment, the method further includes: the current cycle is a time period determined according to a preset time interval; or a time interval corresponding to processing a target number of metadata modification requests is determined as the current cycle.
[0192] In this embodiment, two methods for determining the current time period are provided, depending on the design strategy or performance requirements of the system.
[0193] The first method is to periodically evaluate and adjust flow control based on a preset time interval. The second method is more flexible and uses the time interval corresponding to the processing of the target number of metadata modification requests as the current period. This method can more accurately respond to real-time business needs.
[0194] In a specific example, assuming the current cycle is determined based on a preset time interval, and assuming the preset time interval for an all-flash storage pool is 1 minute, the system evaluates the execution of host write and garbage collection operations at the end of each minute and adjusts the processing quotas for the two types of metadata modification requests. For example, at the end of the first minute, if the system finds that space utilization is increasing too quickly, it will increase the garbage collection quota in the next cycle to balance the rate of space consumption.
[0195] In another specific example, suppose the current cycle (the current time period) is determined based on the number of metadata modification requests processed. Assume the system sets a target number of 10,000 metadata modification requests. After processing each of these 10,000 requests, the system automatically enters the next cycle. Suppose, while processing the 10,000th request, the system discovers that garbage collection is lagging, causing space usage to approach a threshold. At the start of the next cycle, the system adjusts its flow control strategy to increase the processing speed of garbage collection requests and ensure that space usage remains within a safe range.
[0196] This embodiment provides a flexible and efficient flow control management approach for all-flash storage pools by introducing a periodic flow control adjustment mechanism based on preset time intervals or the number of metadata modification requests processed. This approach not only regularly evaluates system status based on preset time periods and adjusts flow control policies accordingly to ensure stable system operation, but also dynamically adjusts the time period based on the actual number of metadata operations processed, more accurately responding to real-time business needs, ensuring that host write operations and garbage collection operations are adjusted as needed, and achieving an optimal balance between space management and I / O performance.
[0197] The preset time interval method is suitable for scenarios with relatively stable business needs or clear time period requirements. It ensures that the system adjusts the flow control policy within a fixed time period, avoiding flow control policy lags caused by business fluctuations. The method based on the number of metadata modification requests processed is more suitable for environments with dynamically changing business needs or high performance requirements. It ensures that flow control policy adjustments are closely coupled with business needs, achieving more refined space management and performance optimization.
[0198] Whether using a preset time interval or based on the volume of metadata modification requests, this system enables real-time monitoring and efficient adjustment of host write and garbage collection operations. It also enhances the flexibility of flow control strategies for all-flash storage pools, ensuring the coordinated optimization of system performance and space management.
[0199] In order to understand the above storage space optimization method more clearly, the following Figure 6 The overall schematic diagram shown further describes it.
[0200] When implementing the flow control algorithm, four functional modules are mainly involved, such as Figure 6 As shown in the figure, these are the host write processing module, metadata module, garbage collection module, space management module, and data read / write module. Through the interaction between these functional modules, storage space optimization is achieved. The following describes the interaction between these functional modules using the host write request processing flow as an example.
[0201] S41, the host write processing module is responsible for receiving an upper-layer write request, that is, a write request from the host, and submitting the write request to the space management and data read-write module.
[0202] S42: The space management and data reading and writing module aggregates multiple write requests and writes them to the lower layer in sequence. The aggregated data is then returned to the PBA according to the grain granularity to the host write processing module, and the space consumption amount or speed is counted.
[0203] S43, the host write processing module submits the modification operation request such as inserting LP metadata to the metadata module.
[0204] S44, the metadata module calculates the concurrency and ratio of host-type metadata modification requests and garbage collection-type metadata modification requests according to the current MOR, and queues or processes the metadata modification requests.
[0205] S45 , the metadata module updates the completion quantity according to the metadata request type when each metadata modification operation is completed, and processes the metadata modification requests in the queue according to the MOR.
[0206] S46, the metadata module periodically calculates MORf and MOR value according to the above algorithm.
[0207] That is to say, the MORf and MOR values in each cycle change dynamically and may be the same or different.
[0208] The garbage collection module, on the other hand, initiates garbage collection when the storage pool's space usage reaches a threshold. It prioritizes valid data in blocks with high data inefficiency and submits it to the space management and data read / write modules for data migration. It then submits metadata modification requests to the metadata module. After completion, it passes free blocks to the space management and data read / write modules. These modules receive free blocks and calculate the number and speed of space reclaimed.
[0209] The above embodiments provided in this application solve the following problems in the prior art.
[0210] (1) Before the storage pool space is exhausted, balance the space consumption rate and the recovery rate so that the recovery rate is greater than or equal to the consumption rate and the space is not exhausted.
[0211] (2) Control the granularity of host write operations and garbage collection operations to be as small as possible to avoid large-scale or periodic blocking of host write operations, which may cause fluctuations in host performance or latency.
[0212] (3) Maintain high CPU utilization efficiency and high system and host write performance while balancing the space consumption rate and recovery rate.
[0213] That is to say, by establishing a model and control relationship between metadata modification operations and space consumption and recovery speed, the purpose of controlling space consumption and recovery speed is achieved by controlling the ratio of two types of metadata operations: space-consuming metadata modification operations and space-recovery metadata modification operations. Since metadata operations are the most fine-grained and also the link with the highest CPU consumption, the technical effect of fine-grained flow control is achieved. By controlling the total concurrency of metadata operations and allowing appropriate fluctuations in the ratio of the two types of metadata operations, the purpose of maintaining high CPU utilization efficiency and performance is achieved.
[0214] From the description of the above embodiments, it can be seen that the key points of the technical solution of this application lie in the following aspects.
[0215] (1) A method for IO flow control and space balancing in an all-flash storage array is provided, which is characterized by performing flow control on two types of metadata modification requests generated by host writes and garbage collection, controlling the processing ratio of the two types of metadata modification requests according to the ratio of the storage pool space consumption rate to the space recovery rate, and achieving the regulation of the storage pool space consumption rate and space recovery rate. At the same time, a negative feedback mechanism is established to periodically adjust the metadata modification operation ratio according to the actual ratio of the storage pool space consumption rate to the space recovery rate.
[0216] (2) Supports multi-cycle flow control weighted calculation of metadata control ratio, which improves the flexibility of the solution.
[0217] (3) It supports adjusting two types of metadata modification requests according to a certain deviation range of MOR within the adjustment cycle. When the load is low and one type of metadata request is empty, another type of metadata modification request exceeding the MOR ratio is issued within a certain deviation range, thereby improving CPU utilization.
[0218] The technical solution in this application has at least the following beneficial effects.
[0219] (1) Accurately control the ratio of space consumption and space recovery speed by performing flow control at the metadata layer.
[0220] (2) I / O-level regulation is achieved by controlling the ratio of two types of metadata modification operations (host write and garbage collection), avoiding entering the current limiting state, and making the host I / O response time more balanced while maximizing the CPU performance.
[0221] (3) Establish the actual value and target value based on the ratio of space consumption rate to space recovery rate, and periodically adjust the metadata flow control parameters through negative feedback to achieve rapid approach and achievement of the target value with fast adjustment speed.
[0222] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0223] According to another aspect of the embodiment of the present application, a storage space optimization device is also provided. The structural diagram of the system is shown in FIG. Figure 8 As shown, it includes the following modules: a first acquisition unit 802, used to obtain the space utilization rate in the all-flash storage pool, wherein the space utilization rate is the ratio of the used storage space to the total storage space in the all-flash storage pool; a first processing unit 804, used to determine the current metadata operation ratio of the current cycle based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle when the space utilization rate reaches the recovery threshold, wherein the current metadata operation ratio is the ratio between the number of first metadata operations generated by writing data to the all-flash storage pool in the current cycle and the number of second metadata operations generated by reclaiming data in the all-flash storage pool; a second processing unit 806, used to determine the consumed storage space obtained by writing data and the released storage space obtained by reclaiming invalid data in the current cycle based on the current metadata operation ratio.
[0224] The specific execution steps involved in the various calculation processes in the above modules and the dynamic optimization of storage space can be referred to the description in the above embodiments and will not be repeated here.
[0225] Obviously, the above-mentioned storage space optimization device can be used to implement the storage space optimization method provided in the above-mentioned embodiment, and the details have been explained and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0226] It should be noted that the first acquisition unit 802 in this embodiment can be used to execute the above step S202, the first processing unit 804 in this embodiment can be used to execute the above step S204, and the second processing unit 806 in this embodiment can be used to execute the above step S206.
[0227] In an exemplary embodiment, the above-mentioned first processing unit 804 includes: a first acquisition module, used to obtain the historical metadata operation ratio of the previous cycle; a first processing module, used to determine the correction coefficient based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle, wherein the target space balance ratio is the ratio between the space consumption rate and the space release rate in the current cycle, and the actual space balance ratio is the ratio between the actual space consumption rate and the actual space release rate in the previous cycle; a second processing module, used to determine the product of the historical metadata operation ratio and the correction coefficient as the current metadata operation ratio.
[0228] In an exemplary embodiment, the first processing module includes: a first processing submodule, configured to determine a ratio between a target spatial balance ratio of a current cycle and an actual spatial balance ratio of a previous cycle as a correction coefficient.
[0229] In an exemplary embodiment, the above-mentioned device also includes: a second acquisition unit, used to obtain N metadata operation ratios corresponding to N periods before the current period, where N is a positive integer greater than or equal to 2; and a third processing unit, used to perform weighted summation on the N metadata operation ratios to obtain the current metadata operation ratio of the current period.
[0230] In an exemplary embodiment, the above-mentioned first processing unit 804 also includes: a third processing module, which is used to determine the target space balance ratio of the current period corresponding to the space utilization rate from the target mapping table based on the space utilization rate; wherein, the target mapping table records the mapping relationship between different space utilization rates and space balance ratios with different values.
[0231] In an exemplary embodiment, the apparatus further includes: an adjusting unit configured to adjust the historical space balance ratio of the previous cycle based on the space usage rate and the target threshold value to obtain a target space balance ratio of the current cycle.
[0232] In an exemplary embodiment, the above-mentioned adjustment unit includes: a fourth processing module, used to determine the historical space balance ratio as the target space balance ratio when the space utilization rate is less than the target threshold, wherein the value of the target space balance ratio is greater than 1; a fifth processing module, used to adjust the value of the historical space balance ratio to 1 when the space utilization rate is equal to the target threshold, and determine the adjusted first space balance ratio as the target space balance ratio; a sixth processing module, used to adjust the value of the historical space balance ratio to less than 1 when the space utilization rate is greater than the target threshold, and determine the adjusted second space balance ratio as the target space balance ratio.
[0233] In an exemplary embodiment, the second processing unit 806 includes: a seventh processing module, configured to determine, based on the current metadata operation ratio and the number of metadata modification requests, a first quota of first-type metadata modification requests and a second quota of second-type metadata modification requests that are allowed to be processed within the current cycle, wherein the first-type metadata modification request is a modification request corresponding to writing data to the all-flash storage pool, and the second-type metadata modification request is a modification request corresponding to reclaiming invalid data in the all-flash storage pool; a sending module, configured to send the first-type metadata modification request and the second-type metadata modification request according to the remaining quota ratio when it is determined that the metadata modification request sending condition is met; an eighth processing module, configured to send the first-type metadata modification request and the second-type metadata modification request according to the remaining quota ratio based on the first-type metadata A modification request is provided, which performs a first-type metadata modification operation with a first-number of operation times, wherein the first-type metadata modification operation includes a modification operation generated by writing data to the all-flash storage pool; a ninth processing module is used to perform a second-type metadata modification operation with a second-number of operation times based on the first-type metadata modification request, wherein the second-type metadata modification operation includes a modification operation generated by reclaiming data in the all-flash storage pool; a tenth processing module is used to determine the consumed storage space obtained by writing data in the current cycle based on the first-type metadata modification operation with the first-number of operation times; and to determine the released storage space obtained by reclaiming invalid data in the current cycle based on the second-type metadata modification operation with the second-number of operation times.
[0234] In an exemplary embodiment, the sending module includes: a sending submodule for sending the first type metadata modification requests of the current batch according to the first remaining quota ratio when a first remaining quota of the first type metadata modification requests is greater than 0 and the sum of a first number of the first type metadata modification requests issued but not completed and a second number of the second type metadata modification requests issued but not completed in the current cycle is less than the maximum concurrent number; and a second processing submodule for sending the second type metadata modification requests of the current batch according to the second remaining quota ratio when a second remaining quota of the second type metadata modification requests is greater than 0 and the sum of the first number and the second number is less than the maximum concurrent number.
[0235] In an exemplary embodiment, the issuing module includes: a third processing submodule, configured to determine a difference between a maximum concurrent number and a first number to obtain a first difference; a fourth processing submodule, configured to determine a first value by multiplying the first difference by a first remaining amount, wherein the first remaining amount is the difference between the first amount and a third number of issued first-type metadata modification requests, and the first amount represents a first total number of first-type metadata modification requests permitted to be issued in a current cycle; a fifth processing submodule, configured to determine a first remaining amount ratio by a ratio between the first value and the total remaining amount, wherein the total remaining amount is the sum of the first remaining amount and a second remaining amount, and the second remaining amount is the difference between the second amount and a fourth number of issued second-type metadata modification requests, and the second amount represents a second total number of second-type metadata modification requests permitted to be issued in the current cycle; and a sixth processing submodule, configured to issue a current batch of first-type metadata modification requests according to the first remaining amount ratio, wherein at least one batch of metadata modification requests is permitted to be issued in the current cycle.
[0236] In an exemplary embodiment, the apparatus further includes: a fourth processing unit configured to determine whether the current cycle is a time cycle determined according to a preset time interval; or to determine a time interval corresponding to processing a target number of metadata modification requests as the current cycle.
[0237] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0238] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory 9 and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned storage space optimization method embodiments.
[0239] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned storage space optimization method embodiments when running.
[0240] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0241] According to another aspect of the embodiments of the present application, a computer program product is further provided. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned storage space optimization method embodiments are implemented.
[0242] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned storage space optimization method embodiments are implemented.
[0243] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0244] The above is a detailed introduction to a storage space optimization method provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for optimizing storage space, characterized by: include: Obtaining a space usage rate in the all-flash storage pool, wherein the space usage rate is a ratio of used storage space to total storage space in the all-flash storage pool; When the space usage rate reaches the recycling threshold, determining a current metadata operation ratio of the current cycle based on a target space balance ratio of the current cycle and an actual space balance ratio of a previous cycle, wherein the current metadata operation ratio is a ratio between the number of first metadata operations generated by writing data to the all-flash storage pool in the current cycle and the number of second metadata operations generated by recycling data in the all-flash storage pool, the target space balance ratio is a ratio between a space consumption rate and a space release rate in the current cycle, and the actual space balance ratio is a ratio between an actual space consumption rate and an actual space release rate in the previous cycle; Based on the current metadata operation ratio, the consumed storage space obtained by writing data and the released storage space obtained by recycling invalid data in the current cycle are determined.
2. The method according to claim 1, characterized in that When the space usage rate reaches the recycling threshold, determining the current metadata operation ratio of the current cycle based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle includes: Obtain the historical metadata operation ratio of the previous period; determining a correction coefficient based on the target spatial balance ratio of the current cycle and the actual spatial balance ratio of the previous cycle; The product of the historical metadata operation ratio and the correction coefficient is determined as the current metadata operation ratio.
3. The method according to claim 2, characterized in that The determining of the correction coefficient based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle includes: The ratio of the target space balance ratio of the current cycle to the actual space balance ratio of the previous cycle is determined as the correction coefficient.
4. The method according to claim 1, wherein The method further comprises: Obtaining N metadata operation ratios corresponding to N periods before the current period, where N is a positive integer greater than or equal to 2; A weighted sum is performed on the N metadata operation ratios to obtain the current metadata operation ratio of the current period.
5. The method according to claim 1, wherein When the space usage rate reaches the reclamation threshold, before determining the current metadata operation ratio of the current cycle based on the target space balance ratio of the current cycle and the actual space balance ratio of the previous cycle, the method further includes: Based on the space usage rate, determining from a target mapping table the target space balance ratio of the current cycle corresponding to the space usage rate; The target mapping table records the mapping relationships between different space utilization rates and different values of space balance ratios.
6. The method according to claim 5, characterized in that The method further comprises: Based on the space usage rate and the target threshold, the historical space balance ratio of the previous cycle is adjusted to obtain the target space balance ratio of the current cycle.
7. The method according to claim 6, characterized in that The adjusting the historical space balance ratio of the previous period based on the space usage rate and the target threshold to obtain the target space balance ratio of the current period includes: When the space usage rate is less than the target threshold, determining the historical space balance ratio as the target space balance ratio, wherein the value of the target space balance ratio is greater than 1; When the space usage rate is equal to the target threshold, adjusting the value of the historical space balance ratio to 1, and determining the adjusted first space balance ratio as the target space balance ratio; When the space usage rate is greater than the target threshold, the value of the historical space balance ratio is adjusted to be less than 1, and the adjusted second space balance ratio is determined as the target space balance ratio.
8. The method according to claim 1, characterized in that The determining, based on the current metadata operation ratio, the consumed storage space obtained by writing data and the released storage space obtained by recycling invalid data in the current cycle includes: Determining, based on the current metadata operation ratio and the number of metadata modification requests, a first quota of first-type metadata modification requests and a second quota of second-type metadata modification requests that are permitted to be processed within the current cycle, wherein the first-type metadata modification requests are modification requests corresponding to writing data to the all-flash storage pool, and the second-type metadata modification requests are modification requests corresponding to reclaiming invalid data from the all-flash storage pool; If it is determined that the metadata modification request issuance conditions are met, issuing the first type metadata modification request and the second type metadata modification request in proportion to the remaining quota; Based on the first-type metadata modification request, executing the first-type metadata modification operation for the first metadata operation number, wherein the first-type metadata modification operation includes a modification operation generated by writing data to the all-flash storage pool; executing, based on the second-type metadata modification request, a second-type metadata modification operation for the second metadata operation number, wherein the second-type metadata modification operation includes a modification operation generated by reclaiming data in the all-flash storage pool; Based on the first type of metadata modification operations of the first metadata operation number, the consumed storage space obtained by writing data in the current cycle is determined; and based on the second type of metadata modification operations of the second metadata operation number, the released storage space obtained by recycling the invalid data in the current cycle is determined.
9. The method according to claim 8, characterized in that The step of issuing the first-type metadata modification request and the second-type metadata modification request according to a proportion of the remaining amount upon determining that the metadata modification request issuance condition is satisfied includes: If a first remaining quota of the first-type metadata modification requests is greater than 0, and the sum of a first number of the first-type metadata modification requests issued but not completed and a second number of the second-type metadata modification requests issued but not completed in the current cycle is less than the maximum concurrent number, issuing the first-type metadata modification requests of the current batch in proportion to the first remaining quota; When the second remaining amount of the second type metadata modification requests is greater than 0 and the sum of the first number and the second number is less than the maximum concurrent number, the second type metadata modification requests of the current batch are issued according to the second remaining amount ratio.
10. The method according to claim 9, characterized in that The issuing of the first-type metadata modification request of the current batch according to the first remaining quota ratio includes: Determine a difference between the maximum number of concurrent connections and the first number to obtain a first difference value; Determining a first value by multiplying the first difference and a first remaining quota, wherein the first remaining quota is the difference between the first quota and a third number of issued metadata modification requests of the first type, and the first quota represents a first total number of metadata modification requests of the first type allowed to be issued in the current period; Determining a ratio between the first value and the total remaining credit as the first remaining credit ratio, wherein the total remaining credit is the sum of the first remaining credit and a second remaining credit, the second remaining credit is the difference between the second credit and a fourth number of issued metadata modification requests of the second type, and the second credit indicates a second total number of metadata modification requests of the second type allowed to be issued in the current period; The first type of metadata modification requests of the current batch are issued according to the first remaining credit ratio, wherein at least one batch of metadata modification requests is allowed to be issued within the current cycle.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: The current period is a time period determined according to a preset time interval; or A time interval corresponding to processing the target number of metadata modification requests is determined as the current cycle.
12. A storage space optimization device, characterized in that: include: a first acquiring unit, configured to acquire a space usage rate in the all-flash storage pool, wherein the space usage rate is a ratio of used storage space to total storage space in the all-flash storage pool; a first processing unit, configured to determine, when the space usage rate reaches a recycling threshold, a current metadata operation ratio of the current cycle based on a target space balance ratio of the current cycle and an actual space balance ratio of a previous cycle, wherein the current metadata operation ratio is a ratio between a first metadata operation number generated by writing data to the all-flash storage pool in the current cycle and a second metadata operation number generated by recycling data in the all-flash storage pool; the target space balance ratio is a ratio between a space consumption rate and a space release rate in the current cycle; and the actual space balance ratio is a ratio between an actual space consumption rate and an actual space release rate in the previous cycle; The second processing unit is configured to determine, based on the current metadata operation ratio, the consumed storage space obtained by writing data and the released storage space obtained by recycling invalid data in the current cycle.
13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the storage space optimization method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the storage space optimization method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the storage space optimization method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method, device and apparatus for recycling junk data
CN113835628A
Storage space recovery method and device, storage medium and electronic equipment
CN117608496A