Method and device for adjusting cache space of redundant array of disk, equipment and medium

By dynamically adjusting the cache capacity of the RAID array and releasing cache space exceeding the cache quota, the uneven allocation and competition of the cache space of the RAID controller are solved, and the utilization rate of the cache space and overall IOPS are improved.

CN120215835APending Publication Date: 2025-06-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510356860.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the storage system, uneven cache space allocation of RAID controllers leads to performance bottlenecks, and there is a problem of competition in cache space between multiple RAID arrays, affecting the overall IOPS.

Method used

By dynamically adjusting the maximum cache capacity of each RAID array, the cache space occupied by each array, the average cache space, the first exceeding the cache space and the second exceeding the cache space, and the cache space exceeding the cache quota if necessary is released to improve the utilization of the cache space.

Benefits of technology

It realizes efficient utilization of the cache space of the RAID controller, adapts to different business scenarios, reduces the competition problem of cache space, and improves the overall IOPS.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215835A_ABST
    Figure CN120215835A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for adjusting a cache space of a redundant array of disks, and a medium, and relates to the technical field of storage. Determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the average cache space value, the first exceeding cache space and the second exceeding cache space; the first exceeding cache space is the cache space in which the cache space occupied by the business volume of each array exceeds the average value of the cache space; the second exceeding cache space is the total cache space of which the cache space occupied by the business volume of all the arrays exceeds the average value of the cache space; judging whether the cache space occupied by the business volume of the target array is greater than the current cache quota of the target array; and if yes, releasing a target cache space exceeding the current cache quota in the cache space occupied by the business volume of the target array. According to the invention, cache utilization can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technologies, and in particular, to a method, device, equipment, and medium for adjusting the cache space of a redundant array of independent disks (RAID). Background Art

[0002] In a storage system, the read and write speed of a disk (especially a mechanical disk) is much slower than that of other storage media (such as memory). During the data read and write process, data needs to be read from the disk into the memory for processing, or written from the memory to the disk for persistent storage, which consumes time and resources. If the disk read and write speed is too slow, the performance bottleneck of the entire computer system will occur on the disk, thereby reducing the operating efficiency of the entire system. To improve the performance of the storage system, cache technology is often used in the storage system to improve the performance of the entire storage system. In a RAID (Redundant Array of Independent Disks) array controller, there are usually multiple RAID arrays, and they all need to use the cache space to improve the I / O (Input / Output) performance of this array. Therefore, there will be a problem of cache space competition among multiple RAID arrays. The cache quota allocation scheme directly affects the overall IOPS (Input / Output Operations Per Second) of the RAID controller. If the cache space allocated to a RAID array is too small, it may lead to underutilization of the cache space and poor I / O sorting effects. If the cache space allocated to a single RAID is too large, in a scenario where the traffic of multiple volumes is relatively large, it may occur that a small number of volumes occupy too much cache space and there is a large difference in the performance of each RAID group. Therefore, it is necessary to comprehensively consider and find a balance point to make full use of the limited cache space of the controller to improve the overall IOPS of the RAID controller. It can be seen that how to improve the utilization rate of the cache space of the RAID controller is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0003] The purpose of the embodiments of the present invention is to provide a method, device, equipment, and medium for adjusting the cache space of a redundant array of independent disks, which can dynamically adjust the maximum cache capacity available to each RAID array, thereby improving the utilization rate of the cache space of the RAID controller. The specific solution is as follows:

[0004] In a first aspect, the present invention provides a method for adjusting the cache space of a redundant array of independent disks, including:

[0005] When there is user data to be written, determine the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space; the first excess cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second excess cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space;

[0006] Determine whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array;

[0007] If so, release the target cache space in the cache space occupied by the traffic volume of the target array that exceeds the current cache quota.

[0008] Optionally, determining the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space includes:

[0009] Determine the total number of arrays and the total cache space;

[0010] Determine the average cache space according to the total number of arrays and the total cache space;

[0011] Determine the unused cache space of the array based on the difference between the cache space occupied by the traffic volume of the array and the average cache space;

[0012] Determine the total unused cache space of all arrays according to the sum of the unused cache spaces of each array;

[0013] Determine the second excess cache space by summing the first excess cache spaces of each array;

[0014] Determine the first difference between the total unused cache space and the unused cache space;

[0015] Determine the second difference between the second excess cache space and the first excess cache space;

[0016] Determine the third difference between the first difference and the second difference;

[0017] Determine the current cache quota of each array based on the sum of the average cache space and the third difference.

[0018] Optionally, after determining the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space, it further includes:

[0019] Determine the maximum cache quota based on the total cache space and the preset maximum space limit condition;

[0020] If the current cache quota is greater than the maximum cache quota, then determine the maximum cache quota as the current cache quota for each array.

[0021] Optionally, before determining the current cache quota for each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space, it further includes:

[0022] Determine the first sum value between the total unused cache space of all arrays and the first excess cache space;

[0023] Determine the second sum value between the unused cache space of the array and the second excess cache space;

[0024] Determine whether to trigger the step of determining the current cache quota for each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space according to the magnitude relationship between the first sum value and the second sum value.

[0025] Optionally, determining whether to trigger the step of determining the current cache quota for each array according to the magnitude relationship between the first sum value and the second sum value includes:

[0026] If the first sum value is greater than the second sum value, then trigger the step of determining the current cache quota for each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space;

[0027] If the first sum value is less than or equal to the second sum value, then directly determine the current cache quota for each array as the average cache space.

[0028] Optionally, after determining whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array, it further includes:

[0029] If the cache space occupied by the traffic volume of the target array is less than or equal to the current cache quota of the target array, then do not perform any operation, and when new user data is written, jump back to the step of determining the current cache quota for each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space.

[0030] Optionally, the method for adjusting the cache space of the disk redundant array further includes:

[0031] Regularly detect whether there is data that has not been updated within a preset long time range in each array;

[0032] If there is data that has not been updated within a preset long time range, release the data that has not been updated within the preset long time range, determine the cache space occupied by the corresponding released traffic volume, and determine the current cache quota of the array based on the cache space occupied by the released traffic volume, the average cache space, the first cache space exceeding the cache space, and the second cache space exceeding the cache space.

[0033] In a second aspect, the present invention provides a disk redundant array cache space adjustment device, including:

[0034] A current cache quota determination module, configured to determine the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first cache space exceeding the cache space, and the second cache space exceeding the cache space when there is user data writing; the first cache space exceeding the cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second cache space exceeding the cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space;

[0035] A judgment module, configured to judge whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array;

[0036] A cache space release module, configured to, if so, release the target cache space in the cache space occupied by the traffic volume of the target array that exceeds the current cache quota.

[0037] In a third aspect, the present invention provides an electronic device, including:

[0038] A memory, configured to store a computer program;

[0039] A processor, configured to execute the computer program to implement the foregoing disk redundant array cache space adjustment method.

[0040] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing disk redundant array cache space adjustment method is implemented.

[0041] In the present invention, when there is user data writing, the current cache quota of each array is determined according to the cache space occupied by the traffic volume of each array, the average cache space, the first cache space exceeding the cache space, and the second cache space exceeding the cache space; the first cache space exceeding the cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second cache space exceeding the cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space; judge whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array; if so, release the target cache space in the cache space occupied by the traffic volume of the target array that exceeds the current cache quota.

[0042] Beneficial effects: The present invention determines the current cache quota of each array through the cache space occupied by the traffic volume of each array, the average cache space, the first cache space exceeding amount, and the second cache space exceeding amount, and then determines whether to release the cache space according to the size relationship between the cache space occupied by the traffic volume of the array and the current cache quota. In this way, the maximum cache capacity available for each RAID array is dynamically adjusted in real time, effectively solving the problem of cache space allocation of the RAID controller, adapting to various different service scenarios, maximizing the utilization rate of the cache space, and reducing the cache space competition problem. Description of the Drawings

[0043] In order to more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0044] Figure 1 It is a flowchart of a method for adjusting the cache space of a redundant array of independent disks provided by an embodiment of the present invention;

[0045] Figure 2 It is a schematic diagram of a method for determining a cache quota provided by an embodiment of the present invention;

[0046] Figure 3 It is a flowchart of a specific method for adjusting the cache space of a redundant array of independent disks provided by an embodiment of the present invention;

[0047] Figure 4 It is a schematic diagram of the structure of a device for adjusting the cache space of a redundant array of independent disks provided by an embodiment of the present invention;

[0048] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present invention. Detailed Embodiments

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0050] As used in the specification of the present invention and the above-mentioned drawings, the terms "comprising" and "having", and any variations related to "comprising" and "having", are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.

[0051] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the drawings and specific embodiments.

[0052] In some technical solutions, when allocating a RAID array, the maximum available space for all volumes using the cache is the total size of the cache, that is, the quota for each RAID array is 100%. In this allocation method, it may cause a single RAID array to occupy too much cache space in advance, resulting in other RAID arrays being unable to obtain sufficient cache space and having low performance. The performance of each RAID array is unbalanced or unstable. The cache quota may also be evenly distributed according to the number of RAID arrays using the cache. The cache quota for a single RAID array = total cache capacity / number of RAID arrays. This method also has obvious disadvantages. Although there is no problem of cache space competition between arrays, in actual business scenarios, there are often situations where the traffic of some arrays is very large, while the traffic of some other RAID arrays is very small or even there is no traffic. The space allocated to those arrays with very small traffic is wasted. The cache quota may also be allocated according to the number of RAID arrays using the cache, but the combined quotas of all RAID arrays can exceed the total size of the cache space. This is called the over-allocation scheme. In the over-allocation scheme, when there is a single RAID, it occupies all the cache space. When there are two RAIDs, each occupies 66% of all the cache space. When there are three RAIDs, each occupies 40% of all the cache space. When there are four or more RAIDs, each occupies 30% of the total cache space. This significantly improves the utilization rate of the cache space. It can avoid a single or a few RAID groups occupying too much cache space in a scenario where the traffic of each RAID is relatively average, and can also make full use of the cache space when the traffic is concentrated in a few RAID arrays. However, this scheme does not completely solve the problem of insufficient cache space utilization or performance loss caused by mutual competition. For example, the cache space is not fully utilized when the traffic is concentrated in a single RAID or a few RAID groups. Or when there are too many RAID arrays, the cache space competition is fierce. To solve the above technical problems, the present invention discloses a method, device, equipment, and medium for adjusting the cache space of a redundant array of independent disks, which can dynamically adjust the maximum cache capacity available to each RAID array, thereby improving the utilization rate of the cache space of the RAID controller.

[0053] See Figure 1As shown in the figure, an embodiment of the present invention provides a method for adjusting the cache space of a redundant array of independent disks (RAID), including:

[0054] Step S11: When user data is written, determine the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space; the first excess cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second excess cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space.

[0055] In an embodiment of the present invention, when user data is written, the cache quota of each array will be recalculated and updated dynamically. During this process, the specific calculation process of the cache quota of each array is as follows: Determine the total number of arrays and the total cache space; determine the average cache space according to the total number of arrays and the total cache space; determine the unused cache space of the array based on the difference between the cache space occupied by the traffic volume of the array and the average cache space; determine the total unused cache space of all arrays according to the sum of the unused cache spaces of each array; determine the second excess cache space by summing the first excess cache spaces of each array; determine the first difference between the total unused cache space and the unused cache space; determine the second difference between the second excess cache space and the first excess cache space; determine the third difference between the first difference and the second difference; determine the current cache quota of each array based on the sum of the average cache space and the third difference. Among them, the first excess cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second excess cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space. As Figure 2As shown, where fairCacheSize is the cache average value, obtained by dividing the total cache capacity by the number of arrays; unUsedCacheSize is the unused cache size, obtained by traversing all arrays and accumulating (fairCacheSize - the cachesize used by the array); myUnusedCacehSize is the cachesize unused by this array, equal to devCacheSize - fairCacheSize; OverUsedCacheSize is the cache capacity whose used capacity exceeds the average value, obtained by traversing all arrays and accumulating (usedCacheSize - fairCacheSize); myOverUsedCaceSie is the cachesize of this array that exceeds the average value, equal to usedCacheSize - fairCacheSize. Therefore, the cache quota of this device = average cache size + (unused cache space capacity - unused cache space size of this array) - (total exceeded cache capacity - exceeded cache capacity of this device).

[0056] In addition, after determining the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first exceeded cache space, and the second exceeded cache space, it is also necessary to check the specific size of the current cache quota, and determine the maximum cache quota based on the total cache space and the preset maximum space limit condition; if the current cache quota is greater than the maximum cache quota, then the maximum cache quota is determined as the current cache quota of each array. Simply put, when the traffic volume of a certain array occupies a large amount of cache space, while other arrays do not use cache space or use less cache space, the array with a large traffic volume will gradually occupy the unused cache space of other devices, and can use up to 90% of the total cache space at most. Therefore, if the current cache quota determined according to the cache space occupied by the traffic volume of each array, the average cache space, the first exceeded cache space, and the second exceeded cache space of each array is greater than 90% of the total cache space, then only 90% of the total cache space can be determined as the current cache quota, rather than the calculated cache quota. For example, assume that the total cache capacity is 100G, and there are two RAID arrays A and B in the RAID controller. Array A has a large traffic volume at the beginning, and array B has no traffic. When other devices do not use cache space, the array with a large traffic volume can use 90% of the total cache space, that is, 90G. It should be noted that the purpose of setting the maximum space limit is to reserve space for other devices. To avoid the situation where there is no space available when other arrays have sudden IOs. It should be noted that the maximum space limit of 90% is only a reference value and can be configured and adjusted according to the actual business situation.

[0057] In the embodiments of the present invention, the current cache quota of the array is not necessarily determined for each array based on the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space. When determining how to specifically calculate the current cache quota, the first sum value between the total unused cache space of all arrays and the first excess cache space will be determined first; the second sum value between the unused cache space of the array and the second excess cache space will be determined; whether to trigger the step of determining the current cache quota of each array based on the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space will be determined according to the size relationship between the first sum value and the second sum value. That is to say, it depends on the size relationship between (the total unused cache space of all arrays + the first excess cache space) and (the unused cache space of the array + the second excess cache space). If the first sum value is greater than the second sum value, the step of determining the current cache quota of each array based on the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space will be triggered; if the first sum value is less than or equal to the second sum value, the average cache space will be directly determined as the current cache quota of each array. That is to say, when (the total unused cache space of all arrays + the first excess cache space) is greater than (the unused cache space of the array + the second excess cache space), the cache quota of this device = average cache size + (the total capacity of the unused cache space of all arrays - the size of the unused cache space of this array) - (the total excess cache capacity of all arrays - the excess cache capacity of this device). When (the total unused cache space of all arrays + the first excess cache space) is less than or equal to (the unused cache space of the array + the second excess cache space), the cache quota of this device = average cache space.

[0058] Step S12: Determine whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array.

[0059] In the embodiments of the present invention, after determining the current cache quota of each array, as Figure 3 shown, check whether the cache space occupied by the traffic volume of any array exceeds its quota capacity. If the cache space occupied by the traffic volume of the target array is less than or equal to the current cache quota of the target array, no operation will be performed. When new user data is written, it will jump back to the step of determining the current cache quota of each array based on the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space. That is to say, if the cache space occupied by the traffic volume of the array does not exceed its quota capacity, no processing will be done, and the capacity judgment of other subsequent arrays will continue until the last array.

[0060] Step S13: If so, release the target cache space in the cache space occupied by the traffic of the target array that exceeds the current cache quota.

[0061] In the embodiments of the present invention, if the cache space occupied by the traffic of the array exceeds its quota capacity, the exceeded capacity is calculated, and then according to the cache eviction algorithm, the cache data of the exceeded part of the array is destaged to migrate the exceeded cache data to the disk (cache destage is a data management technology used to write the data in the cache to the permanent memory to release the cache space and ensure data persistence), thereby releasing the cache space. For example, assume that the total cache capacity is 100G, and the RAID controller has two RAID arrays A and B. Array A has a large traffic at the beginning, and array B has no traffic. The cache space used by the array with a large traffic continues to grow. Suppose this array has used 90G of the maximum cache space limit. At the same time, array B also starts to process traffic and occupies the remaining 10G of cache space. According to the cache quota calculation formula, the current cache quota of B is 50G, and the quota that array A can use is 50G, but it actually uses 90G. In this case, it will trigger that the array uses the cache space exceeding the quota, and data destage will be triggered to release the cache space. This can avoid the problem that other arrays cannot apply for cache space when suddenly performing IO.

[0062] It should be noted that when destaging the cache data of the exceeded part of the array to the disk according to the cache eviction algorithm, if the current application scenario is a scenario where the access pattern has temporal locality (such as frequent access to hot data), then by maintaining a linked list or queue, each time the data is accessed, it is moved to the head, and the data that has not been accessed for the longest time is evicted by removing it from the tail when evicting. If the current application scenario is a scenario where the access pattern is long-term stable (such as fixed popular content), then by maintaining a counter to record the access times of each data, the data with the lowest access frequency is evicted by selecting the data with the smallest count when evicting. If the current application scenario is for simplicity of implementation and is suitable for scenarios with low performance requirements, then by maintaining a queue, new data is inserted at the end of the queue, and the data that entered the cache earliest is evicted by removing it from the head when evicting. If the current application scenario is for extremely high performance requirements but allows a certain error, then data is directly randomly selected for eviction. The current cache eviction algorithms include but are not limited to the above several methods. In the process of using the present invention, it is necessary to select and optimize in combination with specific scenarios (such as data access patterns, memory limitations, performance requirements) to improve the cache hit rate and system performance.

[0063] In addition, the present invention also periodically detects whether there is data that has not been updated within a preset long time range in each array; if there is data that has not been updated within the preset long time range, the data that has not been updated within the preset long time range is released, the cache space occupied by the released traffic is determined, and the current cache quota of the array is determined based on the cache space occupied by the released traffic, the average cache space, the first cache space exceeded, and the second cache space exceeded. For example, if the traffic of array B decreases after a period of time. Some cached data has not been updated for a long time, then the timeout destage mechanism will be triggered to release the cache space, and array A can use more cache space by dynamic adjustment. In this way, the maximum cache capacity that can be used by each RAID array can be dynamically adjusted in real time by adopting the method of average allocation + floating quota, and the utilization rate of the cache space can be maximized.

[0064] Beneficial effects: The present invention determines the current cache quota of each array based on the cache space occupied by the traffic of each array, the average cache space, the first cache space exceeded, and the second cache space exceeded, and then determines whether to release the cache space according to the size relationship between the cache space occupied by the traffic of the array and the current cache quota. In this way, the maximum cache capacity that can be used by each RAID array is dynamically adjusted in real time, effectively solving the problem of cache space allocation of the RAID controller, adapting to various different service scenarios, maximizing the utilization rate of the cache space, and reducing the cache space competition problem.

[0065] Based on the previous embodiment, it can be known that when user data is written, the present invention will recalculate and update the cache quota of each array dynamically. Next, the cache quota allocation in different scenarios will be illustrated by examples.

[0066] Assume that the total cache capacity is 100G, and the RAID controller has two RAID arrays A and B. Array A has a large traffic at the beginning, and array B has no traffic. After array A has used up the 50G of cache space evenly allocated by the disk, dynamic adjustment is required. At this time, the average quota is 50G, the remaining space size is 50G, the unused space of this array is 0G, the space size exceeding the average value is 0G, and the space size of this array exceeding the average value is 0G. Then the cache quota that array A can use = 50G + (50G - 0) - (0G - 0G) = 100G. However, since when other devices do not use the cache space, the array with a large traffic can use 90% of all the cache space, that is, 90G. It should be noted that the purpose of setting the maximum space limit is to reserve space for other devices. To avoid the situation that there is no space available when other arrays have sudden I / O. And the 90% of the maximum space limit is just a reference value, which can be configured and adjusted according to the actual business situation. Therefore, the cache quota that array A can use = 90G.

[0067] In this case, the cache space used by array A with a large business volume continues to grow. Suppose the array has used 90G of the maximum cache space limit. At the same time, array B also starts processing business and occupies the remaining 10G of cache space. At this time, the average quota is 50G, the remaining space size is 0G, the unused space of array A is 0G, and the space size of array A exceeding the average value is 40G. The unused space of array B is 40G, and the space size exceeding the average value is 0G. At this time, (the total unused cache space of all arrays 0G + the first excess cache space 0G) is less than (the unused cache space of the array 40G + the second excess cache space 0G), so the quota of array B is the average quota space of 50G. At this time, the available quota for array A is 50G, but it actually uses 90G. In this case, it will trigger the situation that the array uses more cache space than the quota, and data destage will be triggered to release the cache space. This can avoid the problem that other arrays cannot apply for cache space when there is a sudden IO.

[0068] As the cache space of array A continues to be released and the space of array B continues to grow, the two arrays will evenly divide the cache space. Suppose the business volume of array B is limited and it no longer grows after using 20G of cache space, while the space used by array A has dropped to 60G. At this time, the cache quota of array A = the average cache size of 50G + (the unused cache space capacity of 20G - the unused cache space size of this array 0G) - (the total excess cache capacity of 10G - the excess cache capacity of this device 10G) = 70G. (The total unused cache space of all arrays 20G + the first excess cache space 0G) is less than (the unused cache space of the array 10G + the second excess cache space 30G), and the cache quota of array B is the average quota space of 50G. At this time, the cache space of array A, 60G, is less than the quota limit of 70G, so it can continue to use more cache space. The 20G space used by array B does not exceed the 50G quota, so it can also continue to use the remaining cache space.

[0069] If the business volume of array B decreases after a period of time and some cache data has not been updated for a long time, the timeout destage mechanism will be triggered to release the cache space, and array A can use more cache space through dynamic adjustment.

[0070] Beneficial effects: The present invention dynamically adjusts the maximum cache capacity that each RAID array can use in real time through the method of average distribution + floating quota, which can not only adapt to the scenario where the business volumes of multiple RAID arrays are relatively average, but also adapt to the scenario where the business volume is concentrated in a single or a few RAID arrays. In both scenarios, the utilization rate of the cache space can be maximized, the competition problem of the cache space can be reduced, and the utilization rate of the cache space of the RAID controller can be improved.

[0071] See Figure 4As shown in the figure, an embodiment of the present invention provides a disk redundant array cache space adjustment device, including:

[0072] A current cache quota determination module 11, configured to determine the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space when user data is written; the first excess cache space is the cache space where the cache space occupied by the traffic volume of each array exceeds the average cache space; the second excess cache space is the total cache space where the cache space occupied by the traffic volume of all arrays exceeds the average cache space;

[0073] A judgment module 12, configured to judge whether the cache space occupied by the traffic volume of the target array is greater than the current cache quota of the target array;

[0074] A cache space release module 13, configured to, if so, release the target cache space that exceeds the current cache quota in the cache space occupied by the traffic volume of the target array.

[0075] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part are described with reference to the embodiments of the above method part and will not be elaborated here.

[0076] Beneficial effects: The present invention determines the current cache quota of each array according to the cache space occupied by the traffic volume of each array, the average cache space, the first excess cache space, and the second excess cache space, and then determines whether to release the cache space according to the size relationship between the cache space occupied by the traffic volume of the array and the current cache quota. In this way, the maximum cache capacity available for each RAID array is adjusted in real time and dynamically, effectively solving the problem of cache space allocation of the RAID controller, adapting to various different service scenarios, maximizing the utilization rate of the cache space, and reducing the competition problem of the cache space.

[0077] Furthermore, an embodiment of the present application also discloses an electronic device. Figure 5 It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure cannot be considered as any limitation on the scope of use of the present application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the disk redundant array cache space adjustment method disclosed in any of the foregoing embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0078] In this embodiment, the power supply 23 is used to provide operating voltages for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and no specific limitation is imposed on it here.

[0079] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be transient storage or permanent storage.

[0080] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the disk redundant array cache space adjustment method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0081] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the disk redundant array cache space adjustment method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0082] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, the disk redundant array cache space adjustment method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0083] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method part.

[0084] Those skilled in the art may further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0085] The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0086] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0087] The technical solutions provided in this application have been introduced in detail above. Specific examples are used herein to illustrate the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A method for adjusting the cache space of a redundant array of disks, characterized in that: include: When user data is written, the current cache quota of each array is determined according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space; The first excess cache space is the cache space occupied by the cache space of each array whose business volume exceeds the average value of the cache space; The second excess cache space is the total cache space occupied by the cache space occupied by the business volume of all arrays exceeding the average value of the cache space; Determine whether the cache space occupied by the business volume of the target array is greater than the current cache quota of the target array; If so, the target cache space in the cache space occupied by the business volume of the target array that exceeds the current cache quota is released.

2. The method for adjusting the redundant array of disks cache space according to claim 1, characterized in that: The determining of the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space includes: Determining the total number of arrays and the total cache space; Determining the cache space average value according to the total number of the arrays and the total cache space; Determine the unused cache space of the array based on the difference between the cache space occupied by the traffic volume of the array and the average value of the cache space; Determine the total unused cache space of all arrays according to the sum of the unused cache spaces of each array; Determine the second excess cache space by the sum of the first excess cache spaces of the arrays; determining a first difference between the unused total cache space and the unused cache space; determining a second difference between the second excess cache space and the first excess cache space; determining a third difference between the first difference and the second difference; The current cache quota of each of the arrays is determined based on the sum of the cache space average value and the third difference value.

3. The method for adjusting the redundant array of disk cache space according to claim 1, characterized in that: After determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space, the method further includes: Determine the maximum cache quota based on the total cache space and the preset maximum space limit; If the current cache quota is greater than the maximum cache quota, the maximum cache quota is determined as the current cache quota of each array.

4. The method for adjusting the redundant array of disk cache space according to claim 1, characterized in that: Before determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space, the method further includes: determining a first sum of the total unused cache space of all arrays and the first excess cache space; determining a second sum between the unused cache space of the array and the second excess cache space; Determine whether to trigger the step of determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the cache space average, the first excess cache space and the second excess cache space according to the size relationship between the first sum value and the second sum value.

5. The method for adjusting the redundant array of disks cache space according to claim 4, characterized in that: The step of determining whether to trigger the step of determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space, and the second excess cache space according to the size relationship between the first sum value and the second sum value comprises: If the first sum is greater than the second sum, the step of determining the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space is triggered; If the first sum is less than or equal to the second sum, the current cache quota of each array is directly determined by using the average value of the cache space.

6. The method for adjusting the redundant array of disks cache space according to claim 1, characterized in that: After determining whether the cache space occupied by the business volume of the target array is greater than the current cache quota of the target array, the method further includes: If the cache space occupied by the business volume of the target array is less than or equal to the current cache quota of the target array, no operation is performed. When new user data is written, the process jumps again to the step of determining the current cache quota of each array based on the cache space occupied by the business volume of each array, the cache space average, the first excess cache space, and the second excess cache space.

7. The method for adjusting the redundant array of disks cache space according to any one of claims 1 to 6, characterized in that: Also includes: Regularly checking whether there is data in each of the arrays that has not been updated within a preset long period of time; If there is data that has not been updated within a preset long time range, the data that has not been updated within the preset long time range is released, the corresponding business volume occupied cache space after the release is determined, and the current cache quota of the array is determined based on the cache space occupied by the business volume after the release, the cache space average value, the first excess cache space and the second excess cache space.

8. A redundant array of disks cache space adjustment device, characterized in that: include: A current cache quota determination module is used to determine the current cache quota of each array according to the cache space occupied by the business volume of each array, the average value of the cache space, the first excess cache space and the second excess cache space when user data is written; The first excess cache space is the cache space occupied by the cache space of each array whose business volume exceeds the average value of the cache space; The second excess cache space is the total cache space occupied by the cache space occupied by the business volume of all arrays exceeding the average value of the cache space; A judgment module, used to judge whether the cache space occupied by the business volume of the target array is greater than the current cache quota of the target array; The cache space releasing module is used to release the target cache space in the cache space occupied by the business volume of the target array that exceeds the current cache quota.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the method for adjusting the cache space of a redundant array of disks as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for adjusting the redundant array of disk cache space according to any one of claims 1 to 7 are implemented.