CN118113214A - Dynamic allocation algorithm for memory cache space - Google Patents
Dynamic allocation algorithm for memory cache space Download PDFInfo
- Publication number
- CN118113214A CN118113214A CN202311676058.3A CN202311676058A CN118113214A CN 118113214 A CN118113214 A CN 118113214A CN 202311676058 A CN202311676058 A CN 202311676058A CN 118113214 A CN118113214 A CN 118113214A
- Authority
- CN
- China
- Prior art keywords
- cache space
- size
- data
- demand
- memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
- G06F3/0611—Improving I/O performance in relation to response time
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3037—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3058—Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
- G06F11/3062—Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0616—Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0625—Power saving in storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0631—Configuration or reconfiguration of storage systems by allocating resources to storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0656—Data buffering arrangements
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Mathematical Physics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本发明公开了一种存储器缓存空间动态分配算法,数据存储过程包括步骤S1.监测存储器的操作与负载情况;步骤S2.根据监测结果,引入需求参数,动态调整缓存空间的大小,将调整后的缓存空间分配给待存储的数据;步骤S3.将待存储的数据存储到缓存空间中,并写入到对应的存储单元中。本发明提供一种存储器缓存空间动态分配算法,以软件协同处理数据的缓存,以更好的进行均衡负载运算,优化存储器缓存空间的分配,提高了存储器的读写性能与效率,避免频繁对同一个存储单元进行写入,同时降低了存储器的响应时间与功耗。The present invention discloses a memory cache space dynamic allocation algorithm, the data storage process includes step S1. monitoring the operation and load of the memory; step S2. introducing demand parameters according to the monitoring results, dynamically adjusting the size of the cache space, and allocating the adjusted cache space to the data to be stored; step S3. storing the data to be stored in the cache space and writing it to the corresponding storage unit. The present invention provides a memory cache space dynamic allocation algorithm, which uses software to coordinate the processing of data cache, so as to better balance load calculations, optimize the allocation of memory cache space, improve the read and write performance and efficiency of the memory, avoid frequent writing to the same storage unit, and reduce the response time and power consumption of the memory.
Description
技术领域Technical Field
本发明涉及数据存储技术领域,更具体地说,是涉及一种存储器缓存空间动态分配算法。The present invention relates to the technical field of data storage, and more specifically, to a memory cache space dynamic allocation algorithm.
背景技术Background technique
随着通讯、计算、人工智能等新技术的涌现,全球数据量呈指数级增长,数据中心、算力中心、云等的建立,数据存储需求不断上升。在存储数据的硬件使用上,低功耗、超高密度的NAND存储器,如固态硬盘(Solid State Drives,SSD),是常见的数据存储硬件。固态硬盘是采用固态电子存储芯片阵列而制成的硬盘,固态硬盘包括控制单元与存储单元(FLASH存储芯片或DRAM存储芯片),其中存储单元闪存(NAND Flash)是固态硬盘的主要存储介质。With the emergence of new technologies such as communications, computing, and artificial intelligence, the amount of global data is growing exponentially. With the establishment of data centers, computing centers, and clouds, the demand for data storage is rising. In terms of hardware used to store data, low-power, ultra-high-density NAND memories, such as solid-state drives (SSDs), are common data storage hardware. A solid-state drive is a hard disk made of a solid-state electronic storage chip array. The solid-state drive includes a control unit and a storage unit (FLASH storage chip or DRAM storage chip), of which the storage unit flash memory (NAND Flash) is the main storage medium of the solid-state drive.
从主机端开始,使用者在操作系统层面向固态硬盘发出访问请求,然后文件系统将访问请求经驱动转化为符合软硬件共同约定的对存储介质的访问命令,主要包括读写与擦除命令等,接着通过连接接口将命令发送至固态硬盘的控制单元,固态硬盘的控制单元接受到命令后进行响应,对存储单元按照特定的时序进行访问,然后将访问的结果再一次通过连接接口传递到主机侧。对于固态硬盘的控制单元层面来讲,其输入的是命令与数据,输出的是数据与命令状态。然而存储单元的介质寿命有限,每一个存储单元都有一定的写入次数,如果频繁的对同一个存储单元进行写入就会产生坏块,影响使用体验。Starting from the host side, the user sends an access request to the SSD at the operating system level, and then the file system converts the access request into an access command to the storage medium that complies with the common agreement between the software and hardware through the driver, mainly including read, write and erase commands, etc., and then sends the command to the SSD control unit through the connection interface. The SSD control unit responds after receiving the command, accesses the storage unit according to a specific timing, and then passes the access result to the host side through the connection interface again. For the SSD control unit level, its input is commands and data, and its output is data and command status. However, the medium life of the storage unit is limited, and each storage unit has a certain number of writes. If the same storage unit is written frequently, bad blocks will be generated, affecting the user experience.
发明内容Summary of the invention
为了克服频繁对同一存储单元读写造成的坏块的不足,本发明提供一种存储器缓存空间动态分配算法。In order to overcome the problem of bad blocks caused by frequent reading and writing of the same storage unit, the present invention provides a memory cache space dynamic allocation algorithm.
本发明技术方案如下所述:The technical solution of the present invention is as follows:
一种存储器缓存空间动态分配算法,数据存储过程包括A memory cache space dynamic allocation algorithm, the data storage process includes
步骤S1.监测存储器的操作与负载情况;Step S1. Monitoring the operation and load of the memory;
步骤S2.根据监测结果,引入需求参数,动态调整缓存空间的大小,将调整后的缓存空间分配给待存储的数据;Step S2. According to the monitoring results, introduce demand parameters, dynamically adjust the size of the cache space, and allocate the adjusted cache space to the data to be stored;
步骤S3.将待存储的数据存储到缓存空间中,并写入到对应的存储单元中。Step S3: Store the data to be stored in the cache space and write it into the corresponding storage unit.
上述的一种存储器缓存空间动态分配算法,在步骤S1中,监控存储器的参数包括In the above-mentioned memory cache space dynamic allocation algorithm, in step S1, the parameters of the monitoring memory include
(1)读写操作频率,即存储器在单位时间内进行的读操作与写操作的次数。(1) Read and write operation frequency, that is, the number of read and write operations performed by the memory per unit time.
(2)数据大小,即存储器中存储的数据量,包括已存储的数据量与待存储的数据量。(2) Data size, that is, the amount of data stored in the memory, including the amount of data stored and the amount of data to be stored.
(3)访问模式,即存储器在进行读写操作时采用的模式,如随机访问、连续访问等。(3) Access mode, that is, the mode used by the memory when performing read and write operations, such as random access, continuous access, etc.
(4)可用空间,即存储器中剩余的可用于存储数据的空间大小。(4) Available space, that is, the amount of space remaining in the memory that can be used to store data.
(5)已用空间,即存储器中已经存储了数据的空间大小。(5) Used space, that is, the size of the space in the memory that has stored data.
(6)并发访问数量,即同时访问存储器的用户数量或进程数量。(6) The number of concurrent accesses, that is, the number of users or processes accessing the memory at the same time.
(7)访问速度,即存储器对读操作与写操作的响应速度。(7) Access speed, that is, the speed at which the memory responds to read and write operations.
(8)错误修复能力,即存储器对错误的检测与修复能力。(8) Error repair capability, that is, the memory's ability to detect and repair errors.
(9)数据一致性,即存储器中数据的完整性与一致性。(9) Data consistency, that is, the integrity and consistency of data in the memory.
(10)访问权限,即存储器的访问权限设置,包括用户身份认证、访问权限控制等。(10) Access rights, i.e., the access rights setting of the storage device, including user authentication, access rights control, etc.
(11)数据备份与恢复,即存储器对数据的备份与恢复能力。(11) Data backup and recovery, that is, the storage device’s ability to back up and restore data.
(12)能耗,即存储器的能耗情况,包括运行状态下的能耗与待机状态下的能耗。(12) Energy consumption, that is, the energy consumption of the memory, including energy consumption in the running state and energy consumption in the standby state.
上述的一种存储器缓存空间动态分配算法,设置多个需求参数,对需求参数对应的性能参数进行监测,根据监测数据与预设的需求参数的阀值进行比较,当检测数据触发阀值时,根据需求参数预设的缓存空间调整模式进行调整。The above-mentioned memory cache space dynamic allocation algorithm sets multiple demand parameters, monitors the performance parameters corresponding to the demand parameters, compares the monitoring data with the preset threshold of the demand parameters, and when the detection data triggers the threshold, adjusts the cache space adjustment mode preset according to the demand parameters.
进一步的,多项需求参数的调整同时进行,或,按照设定的先后顺序循环滚动式进行比较计算并逐一完成所有的需求参数的比较与缓存空间调整。Furthermore, the adjustment of multiple demand parameters is performed simultaneously, or the comparison and calculation are performed in a cyclic rolling manner according to a set sequence, and the comparison and cache space adjustment of all demand parameters are completed one by one.
进一步的,在步骤S2中,需求参数包括IOPS需求、带宽需求及延迟需求,IOPS需求、带宽需求及延迟需求分别存在需求阀值。Furthermore, in step S2, the demand parameters include IOPS demand, bandwidth demand and delay demand, and the IOPS demand, bandwidth demand and delay demand each have a demand threshold.
再进一步的,缓存空间的调整过程为Furthermore, the cache space adjustment process is
步骤A1.初始化缓存空间大小为固定值;Step A1. Initialize the cache space size to a fixed value;
步骤A2.监测存储单元的IOPS、带宽及延迟三者的信息Step A2: Monitor the storage unit's IOPS, bandwidth, and latency
步骤A3.若IOPS超过阈值A,则增加缓存空间大小,每次增加Y,直到IOPS降低到阈值A以下或缓存空间达到上限;Step A3. If the IOPS exceeds the threshold A, increase the cache size by Y each time until the IOPS drops below the threshold A or the cache size reaches the upper limit;
步骤A4.若带宽使用率超过阈值B,则增加缓存空间大小,每次增加Z,直到带宽使用率降低到阈值B以下或缓存空间达到上限;Step A4. If the bandwidth usage exceeds threshold B, increase the cache size by Z each time until the bandwidth usage drops below threshold B or the cache reaches the upper limit;
步骤A5.若延迟超过阈值C,则增加缓存空间大小,每次增加W,直到延迟降低到阈值C以下或缓存空间达到上限;Step A5. If the delay exceeds the threshold C, increase the cache size by W each time until the delay drops below the threshold C or the cache reaches the upper limit;
步骤A6.若以上三个条件均未满足,但缓存空间小于下限D,则减少缓存空间大小,每次减少E,直到缓存空间不低于下限D;Step A6. If the above three conditions are not met, but the cache space is less than the lower limit D, then reduce the cache space size, reducing E each time until the cache space is not less than the lower limit D;
步骤A7.重复步骤A2-A6,以动态调整缓存空间大小。Step A7. Repeat steps A2-A6 to dynamically adjust the cache space size.
进一步的,完成对需求参数的调整后,根据待存储的数据大小,以需求参数出发调整后的缓存空间为初始空间,进一步进行兼顾待存储的数据大小与缓存空间的动态调整。Furthermore, after the adjustment of the demand parameters is completed, according to the size of the data to be stored, the cache space adjusted based on the demand parameters is used as the initial space, and further dynamic adjustment is performed taking into account the size of the data to be stored and the cache space.
再进一步的,兼顾待存储的数据大小与缓存空间的动态调整过程包括Furthermore, the dynamic adjustment process of taking into account the size of the data to be stored and the cache space includes:
步骤B1.初始化缓存空间的大小和读写速度。Step B1. Initialize the size and read/write speed of the cache space.
步骤B2.设定缓存空间的最大扩展阀值与最小缩减阀值。Step B2: Set the maximum expansion threshold and the minimum reduction threshold of the cache space.
步骤B3.当待存储的数据大小大于等于最大扩展阈值时,将缓存空间大小扩展为现有缓存空间的2倍;当待存储的数据大小小于最小缩减阈值时,将缓存空间大小缩减为现有缓存空间的0.5倍;当待存储的数据大小小于最大扩展阀值并大于最小缩减阀值时,根据缓存空间的利用率来决定是否扩展或缩减缓存空间大小。Step B3. When the size of the data to be stored is greater than or equal to the maximum expansion threshold, the cache space size is expanded to twice the existing cache space; when the size of the data to be stored is less than the minimum reduction threshold, the cache space size is reduced to 0.5 times the existing cache space; when the size of the data to be stored is less than the maximum expansion threshold and greater than the minimum reduction threshold, decide whether to expand or reduce the cache space size based on the utilization of the cache space.
进一步的,将待存储的数据分配至对应的缓存空间时,重新监测存储系统的IOPS、带宽及延迟的信息,评估当前缓存空间是否满足需求,若不满足则返回需求参数对应缓存空间大小的调整过程,重新调整缓存空间大小,直至评估当前缓存空间满足需求为止。Furthermore, when allocating the data to be stored to the corresponding cache space, the IOPS, bandwidth and latency information of the storage system are re-monitored to evaluate whether the current cache space meets the demand. If not, the adjustment process of the cache space size corresponding to the demand parameters is returned, and the cache space size is readjusted until it is evaluated that the current cache space meets the demand.
上述的一种存储器缓存空间动态分配算法,控制单元跟踪并记录每个存储单元的写入次数,并依据写入次数的少多进行优先度排序,在将待存储的数据写入存储单元时,优先写入优先度高的存储单元中。In the above-mentioned memory cache space dynamic allocation algorithm, the control unit tracks and records the number of writes to each storage unit, and prioritizes them according to the number of writes. When writing data to be stored into the storage unit, the data is preferentially written into the storage unit with a high priority.
根据上述方案的本发明,其有益效果在于,本发明提供一种存储器缓存空间动态分配算法,以软件协同处理数据的缓存,以更好的进行均衡负载运算,优化存储器缓存空间的分配,提高了存储器的读写性能与效率,避免频繁对同一个存储单元进行写入,同时降低了存储器的响应时间与功耗。The beneficial effect of the present invention according to the above scheme is that the present invention provides a dynamic allocation algorithm for memory cache space, which uses software to collaboratively process data cache to better balance load operations, optimize the allocation of memory cache space, improve the read and write performance and efficiency of the memory, avoid frequent writing to the same storage unit, and reduce the response time and power consumption of the memory.
具体实施方式Detailed ways
为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
一种存储器缓存空间动态分配算法,数据存储过程包括A memory cache space dynamic allocation algorithm, the data storage process includes
步骤S1.监测存储器的操作与负载情况。Step S1: Monitor the operation and load of the memory.
监控存储器的参数包括Parameters for monitoring memory include
(1)读写操作频率,即存储器在单位时间内进行的读操作与写操作的次数。(1) Read and write operation frequency, that is, the number of read and write operations performed by the memory per unit time.
(2)数据大小,即存储器中存储的数据量,包括已存储的数据量与待存储的数据量。(2) Data size, that is, the amount of data stored in the memory, including the amount of data stored and the amount of data to be stored.
(3)访问模式,即存储器在进行读写操作时采用的模式,如随机访问、连续访问等。(3) Access mode, that is, the mode used by the memory when performing read and write operations, such as random access, continuous access, etc.
(4)可用空间,即存储器中剩余的可用于存储数据的空间大小。(4) Available space, that is, the amount of space remaining in the memory that can be used to store data.
(5)已用空间,即存储器中已经存储了数据的空间大小。(5) Used space, that is, the size of the space in the memory that has stored data.
(6)并发访问数量,即同时访问存储器的用户数量或进程数量。(6) The number of concurrent accesses, that is, the number of users or processes accessing the memory at the same time.
(7)访问速度,即存储器对读操作与写操作的响应速度。(7) Access speed, that is, the speed at which the memory responds to read and write operations.
(8)错误修复能力,即存储器对错误的检测与修复能力。(8) Error repair capability, that is, the memory's ability to detect and repair errors.
(9)数据一致性,即存储器中数据的完整性与一致性。(9) Data consistency, that is, the integrity and consistency of data in the memory.
(10)访问权限,即存储器的访问权限设置,包括用户身份认证、访问权限控制等。(10) Access rights, i.e., the access rights setting of the storage device, including user authentication, access rights control, etc.
(11)数据备份与恢复,即存储器对数据的备份与恢复能力。(11) Data backup and recovery, that is, the storage device’s ability to back up and restore data.
(12)能耗,即存储器的能耗情况,包括运行状态下的能耗与待机状态下的能耗。(12) Energy consumption, that is, the energy consumption of the memory, including energy consumption in the running state and energy consumption in the standby state.
步骤S1中监控存储器的操作与负载情况,主要是为了获取存储器关于数据传输与存储的基本情况,从而得到分配计算的代入数值参数,以便后续的计算。The operation and load conditions of the memory are monitored in step S1 mainly to obtain basic conditions of the memory regarding data transmission and storage, so as to obtain input numerical parameters for allocation calculation for subsequent calculations.
具体的,存储器的监控参数可任意设置,根据需求进行选择即可,数量与参数类型均可任意设置。Specifically, the monitoring parameters of the storage device can be set arbitrarily and can be selected according to the needs. The quantity and parameter type can be set arbitrarily.
步骤S2.根据监测结果,引入需求参数,动态调整缓存空间的大小,将调整后的缓存空间分配给待存储的数据。Step S2: According to the monitoring results, the demand parameters are introduced, the size of the cache space is dynamically adjusted, and the adjusted cache space is allocated to the data to be stored.
设置多个需求参数,即第一需求参数、第二需求参数,……,等等,对需求参数对应的性能参数进行监测,根据监测数据与预设的需求参数的阀值进行比较,当检测数据触发阀值时,根据需求参数预设的缓存空间调整模式进行调整。多项需求参数的调整可以同时进行,也可以按照设定的先后顺序循环滚动式进行比较计算,逐一完成所有的需求参数的比较与缓存空间调整。Set multiple demand parameters, i.e., the first demand parameter, the second demand parameter, ..., etc., monitor the performance parameters corresponding to the demand parameters, compare the monitoring data with the preset threshold of the demand parameters, and when the detection data triggers the threshold, adjust the cache space adjustment mode preset by the demand parameters. The adjustment of multiple demand parameters can be carried out simultaneously, or the comparison and calculation can be carried out in a circular rolling manner according to the set sequence, and all the comparisons and cache space adjustments of the demand parameters are completed one by one.
在本实施例中,在进行缓存空间的动态调整时,引入QoS需求(Quality ofService,服务质量需求),QoS需求主要是为了保证存储系统能够满足不同应用程序或工作负载对访问性能的要求,包括In this embodiment, when dynamically adjusting the cache space, QoS requirements (Quality of Service) are introduced. The QoS requirements are mainly to ensure that the storage system can meet the access performance requirements of different applications or workloads, including
(1)IOPS(每秒输入/输出操作次数)需求,对于需要高频率随机读写的应用程序,如数据库,需要更高的IOPS来保证系统的正常运行。(1) IOPS (input/output operations per second) requirements: For applications that require high-frequency random reads and writes, such as databases, higher IOPS is required to ensure the normal operation of the system.
(2)带宽需求,对于需要连续读写大文件的应用程序,如视频编辑、大数据分析等,需要保证存储系统有足够高的带宽,以防止数据传输成为性能瓶颈。(2) Bandwidth requirements: For applications that require continuous reading and writing of large files, such as video editing and big data analysis, it is necessary to ensure that the storage system has a sufficiently high bandwidth to prevent data transmission from becoming a performance bottleneck.
(3)延迟需求,对于实时性要求高的应用程序,如金融交易系统,需要保证存储系统的低延迟,以确保交易的实时性。(3) Latency requirements: For applications with high real-time requirements, such as financial transaction systems, it is necessary to ensure low latency of the storage system to ensure the real-time nature of transactions.
以上述的QoS需求为基准,缓存空间的调整过程为Based on the above QoS requirements, the adjustment process of cache space is as follows:
步骤A1.初始化缓存空间大小为固定值。在存储器中划分出部分空间作为缓存空间,根据控制单元的运算能力于存储单元的所需存储空间综合判定,运算能力强,在保证存储器写入空间充足的情况下,可以分配多些给予缓存空间。在本实施例中,设定为X。Step A1. Initialize the cache space size to a fixed value. Part of the space in the memory is divided as the cache space. According to the computing power of the control unit and the required storage space of the storage unit, a comprehensive judgment is made. If the computing power is strong and the memory write space is sufficient, more cache space can be allocated. In this embodiment, it is set to X.
步骤A2.监测存储单元的IOPS、带宽及延迟三者的信息。在其他实施例中,即监测需求参数对应的信息。Step A2: Monitor the IOPS, bandwidth and latency of the storage unit. In other embodiments, the information corresponding to the demand parameters is monitored.
步骤A3.若IOPS超过阈值A,则增加缓存空间大小,每次增加Y,直到IOPS降低到阈值A以下或缓存空间达到上限。Step A3. If the IOPS exceeds the threshold A, increase the cache space size by Y each time until the IOPS drops below the threshold A or the cache space reaches the upper limit.
步骤A4.若带宽使用率超过阈值B,则增加缓存空间大小,每次增加Z,直到带宽使用率降低到阈值B以下或缓存空间达到上限。Step A4. If the bandwidth usage exceeds threshold B, the cache space size is increased by Z each time until the bandwidth usage drops below threshold B or the cache space reaches an upper limit.
步骤A5.若延迟超过阈值C,则增加缓存空间大小,每次增加W,直到延迟降低到阈值C以下或缓存空间达到上限。Step A5. If the delay exceeds the threshold C, increase the size of the cache space by W each time until the delay drops below the threshold C or the cache space reaches an upper limit.
步骤A6.若以上三个条件均未满足,但缓存空间小于下限D,则减少缓存空间大小,每次减少E,直到缓存空间不低于下限D。Step A6. If the above three conditions are not met, but the cache space is less than the lower limit D, reduce the cache space size, reducing E each time until the cache space is not less than the lower limit D.
步骤A7.重复步骤A2-A6,以动态调整缓存空间大小。Step A7. Repeat steps A2-A6 to dynamically adjust the cache space size.
其中,A、B、C分别为预设的IOPS、带宽及延迟的阀值数,D、E、W、X、Y、Z分别为调整的缓存空间或存储单元的容量大小,在具体的实施例中,这些数值的单位均为GB。Among them, A, B, and C are respectively the preset threshold values of IOPS, bandwidth, and latency, and D, E, W, X, Y, and Z are respectively the capacity sizes of the adjusted cache space or storage unit. In a specific embodiment, the units of these values are all GB.
缓存空间大小调整后,根据待存储的数据大小,兼顾待存储的数据大小与缓存空间实现动态调整,缓存空间调整的过程如下所示。After the cache space size is adjusted, it is dynamically adjusted based on the size of the data to be stored, taking into account the size of the data to be stored and the cache space. The process of adjusting the cache space is as follows.
步骤B1.初始化缓存空间的大小和读写速度。以上述步骤A1-步骤A7的缓存空间动态调整的结果为基准,进行初始化并设定对应的读写速度,通常情况下缓存空间的大小与读写速度呈正相关,缓存空间越大,读写速度越快。Step B1. Initialize the size of the cache space and the read/write speed. Based on the results of the dynamic adjustment of the cache space in steps A1 to A7, initialize and set the corresponding read/write speed. Usually, the size of the cache space is positively correlated with the read/write speed. The larger the cache space, the faster the read/write speed.
步骤B2.设定缓存空间的最大扩展阀值与最小缩减阀值。Step B2: Set the maximum expansion threshold and the minimum reduction threshold of the cache space.
步骤B3.当待存储的数据大小大于等于最大扩展阈值时,将缓存空间大小扩展为现有缓存空间的2倍;Step B3. When the size of the data to be stored is greater than or equal to the maximum expansion threshold, the cache space size is expanded to twice the existing cache space;
当待存储的数据大小小于最小缩减阈值时,将缓存空间大小缩减为现有缓存空间的0.5倍;When the size of the data to be stored is less than the minimum reduction threshold, the cache space size is reduced to 0.5 times the existing cache space;
当待存储的数据大小小于最大扩展阀值并大于最小缩减阀值时,根据缓存空间的利用率来决定是否扩展或缩减缓存空间大小,若缓存空间的利用率大于80%,则将缓存空间大小扩展为现有缓存空间的2倍,若缓存空间的利用率小于50%,则将缓存空间大小缩减为现有缓存空间的0.5倍。When the size of the data to be stored is less than the maximum expansion threshold and greater than the minimum reduction threshold, the cache space size is decided whether to expand or reduce based on the cache space utilization rate. If the cache space utilization rate is greater than 80%, the cache space size is expanded to twice the existing cache space. If the cache space utilization rate is less than 50%, the cache space size is reduced to 0.5 times the existing cache space.
完成调整后,需要将待存储的数据分配至对应的缓存空间,此时重新监测存储系统的IOPS、带宽及延迟的信息,评估当前缓存空间是否满足需求,若不满足,返回步骤A3-步骤A6,重新调整缓存空间大小,直至评估当前缓存空间满足需求为止。以重新调整缓存空间与需求参数之间的关系为调整结束基准,以为了保证令数据存储优先满足需求,在其他实施例中,可设置待存储的数据大小与缓存空间之间的动态调整为结束点,以优先满足待存储数据的存储写入速度。After the adjustment is completed, the data to be stored needs to be allocated to the corresponding cache space. At this time, the IOPS, bandwidth and latency information of the storage system are re-monitored to evaluate whether the current cache space meets the demand. If not, return to step A3-step A6 to readjust the cache space size until the current cache space is evaluated to meet the demand. The adjustment ends with the readjustment of the relationship between the cache space and the demand parameters as the adjustment end benchmark, in order to ensure that data storage is prioritized to meet the demand. In other embodiments, the dynamic adjustment between the size of the data to be stored and the cache space can be set as the end point to prioritize the storage write speed of the data to be stored.
步骤S3.将待存储的数据存储到缓存空间中,并写入到对应的存储单元中。Step S3: Store the data to be stored in the cache space and write it into the corresponding storage unit.
控制单元跟踪并记录每个存储单元的写入次数,并依据写入次数的少多进行优先度排序,在将待存储的数据写入存储单元时,优先写入优先度高(写入次数少)的存储单元中。The control unit tracks and records the number of writes to each storage unit, and prioritizes the numbers according to the number of writes. When writing data to be stored into a storage unit, the storage unit with a high priority (fewer writes) is given priority.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神与原则之内所作的任何修改、等同替换与改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311676058.3A CN118113214A (en) | 2023-12-08 | 2023-12-08 | Dynamic allocation algorithm for memory cache space |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311676058.3A CN118113214A (en) | 2023-12-08 | 2023-12-08 | Dynamic allocation algorithm for memory cache space |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118113214A true CN118113214A (en) | 2024-05-31 |
Family
ID=91216915
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311676058.3A Pending CN118113214A (en) | 2023-12-08 | 2023-12-08 | Dynamic allocation algorithm for memory cache space |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118113214A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119987686A (en) * | 2025-04-16 | 2025-05-13 | 深圳市星耀半导体有限公司 | A solid state hard disk data processing method, device, storage medium and program product |
-
2023
- 2023-12-08 CN CN202311676058.3A patent/CN118113214A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119987686A (en) * | 2025-04-16 | 2025-05-13 | 深圳市星耀半导体有限公司 | A solid state hard disk data processing method, device, storage medium and program product |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9047273B2 (en) | Data transfer management | |
| TWI676992B (en) | Method and apparatus for writing stored data in a flash memory based storage medium | |
| CN108733579B (en) | Method for providing window of opportunity prompt for background operations in solid state disk and solid state disk | |
| US10241909B2 (en) | Non-volatile memory device | |
| CN103838676B (en) | Data-storage system, date storage method and PCM bridges | |
| US11435914B2 (en) | Dynamic ZNS open zone active limit | |
| CN112749102B (en) | Memory space garbage recycling method, device, equipment and medium | |
| CN118020063A (en) | Host-controlled garbage collection in solid-state drives | |
| US11720164B1 (en) | Achieving power savings and low latency for storage | |
| CN116414727B (en) | Flash memory device space management method, storage control chip and flash memory device | |
| CN113867641B (en) | Host memory buffer management method and device and solid state disk | |
| WO2015061921A1 (en) | Dynamic caching method and system for data storage system | |
| CN118113214A (en) | Dynamic allocation algorithm for memory cache space | |
| WO2023045483A1 (en) | Storage device and data storage method and storage system | |
| CN117406922A (en) | Block allocation method and device for improving writing performance of storage device | |
| US12474855B2 (en) | Duplicating memory content with chipset attached memory | |
| JP2026503987A (en) | Dynamic management of memory read requests | |
| JP6254986B2 (en) | Information processing apparatus, access controller, and information processing method | |
| CN109491593B (en) | Data storage management system and method | |
| CN119718165A (en) | A data access method, CXL storage device and CXL controller | |
| CN115509443A (en) | Method, device, system and electronic equipment for accessing DDR memory | |
| US20250342115A1 (en) | Techniques for managing solid-state storage devices | |
| US20250156320A1 (en) | Dynamic single-level cell write through in memory devices | |
| US20250208925A1 (en) | Devices and methods for improved workload-balancing processing bandwidth allocation | |
| US20260016960A1 (en) | I/O Prioritization During Model Load |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: 510800 5-1, Hongzhu Road, Xinhua Street, Huadu District, Guangzhou City, Guangdong Province Applicant after: China Southern Power Grid Digital Engineering (Guangdong) Co., Ltd. Address before: 5-1 Hongzhu Road, Xinhua Street, Huadu District, Guangzhou City, Guangdong Province Applicant before: China Southern Power Grid Big Data Service Co.,Ltd. Country or region before: China |