Dynamic cache slot pre-allocation
One or more aspects of the present disclosure relate to dynamically pre-allocating cache slots based on workload forecasting. In embodiments, characteristics corresponding to one or more input/output (IO) operations received by a storage array are determined. An IO workload for one or more cache segments of system memory of the storage array is also forecasted. In addition, a queue depth for each cache pool of the one or more cache segments is dynamically adjusted. Further, cache slots are dynamically pre-allocated to each cache pool based on the queue depth of each cache pool.
1 . An apparatus with a memory and processor, the apparatus configured to:
determine characteristics corresponding to one or more input/output (IO) operations received by a storage array;
establish separate cache slot queues for each cache pool of one or more cache segments of system memory of the storage array;
forecast an IO workload for one or more cache segments of system memory of the storage array;
dynamically adjust a queue depth for each cache pool of the one or more cache segments; and
dynamically reserve cache slots in advance for each cache pool based on the queue depth of each cache pool, wherein the cache slots are reserved before receiving IO operations that will use the cache slots, wherein reserving comprises earmarking the cache slots without filling them with data immediately such that the cache slots are readily available in the cache slot queues when needed without delay of allocation at a time of receiving the IO operations, thereby reducing allocation latency when the IO operations are subsequently received.
2 . The apparatus of claim 1 , further configured to:
determine the characteristics corresponding to the one or more IO operations received by the storage array, wherein the characteristics include IO types, IO sizes, read hits, read misses, write hits, and write misses.
3 . The apparatus of claim 1 , further configured to:
establish an unmirrored cache segment corresponding to IO read requests of the one or more IO operations; and
establish a mirrored cache segment corresponding to IO write requests of the one or more IO operations.
4 . The apparatus of claim 3 , further configured to:
establish one or more cache slot pools with distinct cache slot sizes for the unmirrored cache segment and the mirrored cache segment.
5 . The apparatus of claim 1 , further configured to:
perform a time-series analysis of each IO operation targeting each of the one or more cache segments to forecast the IO workload for the one or more cache segments of the system memory.
6 . The apparatus of claim 1 , further configured to:
determine a weighted distribution of IO request sizes targeting each cache pool of the one or more cache segments.
7 . The apparatus of claim 6 , further configured to:
dynamically establish a queue depth size for each IO queue corresponding to each cache pool based on the weighted distribution of the IO request sizes targeting each cache pool of the one or more cache segments.
8 . The apparatus of claim 7 , further configured to:
assign at least one dedicated cache worker thread to each cache pool of the one or more cache segments, wherein the at least one dedicated cache worker thread is responsible for pre-allocating cache slots for its respective cache pool.
9 . The apparatus of claim 8 , further configured to:
dynamically reassign the at least one dedicated cache worker thread of a subject cache pool to another cache pool based on a completion status of the least one dedicated cache worker thread of the subject cache pool and the weighted distribution of the IO request sizes targeting the other cache pool.
10 . The apparatus of claim 1 , further configured to:
maintain a minimum percentage of pre-allocated cache slots for each cache segment relative to a total number of cache slots in each cache segment.
11 . A method comprising:
determining characteristics corresponding to one or more input/output (IO) operations received by a storage array;
establishing separate cache slot queues for each cache pool of one or more cache segments of system memory of the storage array;
forecasting an IO workload for one or more cache segments of system memory of the storage array;
dynamically adjusting a queue depth for each cache pool of the one or more cache segments; and
dynamically reserving cache slots in advance for each cache pool based on the queue depth of each cache pool, wherein the cache slots are reserved before receiving IO operations that will use the cache slots, wherein reserving comprises earmarking the cache slots without filling them with data immediately such that the cache slots are readily available in the cache slot queues when needed without delay of allocation at a time of receiving the IO operations, thereby reducing allocation latency when the IO operations are subsequently received.
12 . The method of claim 11 , further comprising:
determining the characteristics corresponding to the one or more IO operations received by the storage array, wherein the characteristics include IO types, IO sizes, read hits, read misses, write hits, and write misses.
13 . The method of claim 11 , further comprising:
establishing an unmirrored cache segment corresponding to IO read requests of the one or more IO operations; and
establishing a mirrored cache segment corresponding to IO write requests of the one or more IO operations.
14 . The method of claim 13 , further comprising:
establishing one or more cache slot pools with distinct cache slot sizes for the unmirrored cache segment and the mirrored cache segment.
15 . The method of claim 11 , further comprising:
performing a time-series analysis of each IO operation targeting each of the one or more cache segments to forecast the IO workload for the one or more cache segments of the system memory.
16 . The method of claim 11 , further comprising:
determining a weighted distribution of IO request sizes targeting each cache pool of the one or more cache segments.
17 . The method of claim 16 , further comprising:
dynamically establishing a queue depth size for each IO queue corresponding to each cache pool based on the weighted distribution of the IO request sizes targeting each cache pool of the one or more cache segments.
18 . The method of claim 17 , further comprising:
assigning at least one dedicated cache worker thread to each cache pool of the one or more cache segments, wherein the at least one dedicated cache worker thread is responsible for pre-allocating cache slots for its respective cache pool.
19 . The method of claim 18 , further comprising:
dynamically reassigning the at least one dedicated cache worker thread of a subject cache pool to another cache pool based on a completion status of the least one dedicated cache worker thread of the subject cache pool and the weighted distribution of the IO request sizes targeting the other cache pool.
20 . The method of claim 11 , further comprising:
maintaining a minimum percentage of pre-allocated cache slots for each cache segment relative to a total number of cache slots in each cache segment.