CN104794068B - 一种flush缓存的方法及装置 - Google Patents

一种flush缓存的方法及装置 Download PDF

Info

Publication number
CN104794068B
CN104794068B CN201510058628.1A CN201510058628A CN104794068B CN 104794068 B CN104794068 B CN 104794068B CN 201510058628 A CN201510058628 A CN 201510058628A CN 104794068 B CN104794068 B CN 104794068B
Authority
CN
China
Prior art keywords
flush
pending
critical value
write
read
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.)
Active
Application number
CN201510058628.1A
Other languages
English (en)
Other versions
CN104794068A (zh
Inventor
王俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhou Yunke Beijing Technology Co ltd
Wuhan Shenzhou Digital Cloud Technology Co ltd
Original Assignee
Shenzhen Science And Technology Co Ltd Digital Cloud Data
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Science And Technology Co Ltd Digital Cloud Data filed Critical Shenzhen Science And Technology Co Ltd Digital Cloud Data
Priority to CN201510058628.1A priority Critical patent/CN104794068B/zh
Publication of CN104794068A publication Critical patent/CN104794068A/zh
Application granted granted Critical
Publication of CN104794068B publication Critical patent/CN104794068B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种刷新flush缓存的方法及装置,该方法包括:S1:预设待处理的缓存回写的读写流pending flush IO数量的临界值;S2:判断pending flush IO数量是否小于等于所述pending flush IO数量的临界值,如果是,则产生缓存回写的读写流flush IO,否则,不产生flush IO。本发明提供的一种flush缓存的方法及装置,能够降低锁冲突和资源占用。

Description

一种flush缓存的方法及装置
技术领域
本发明涉及存储技术领域,尤其涉及一种flush缓存的方法及装置。
背景技术
存储系统通常采用cache(缓存)系统来缓存写IO(读写流)。写IO先写入写缓存,在合适的时机(例如:缓存不足或CPU空闲时)再将写缓存flush(刷新)到RAID(RedundantArrays of Independent Disks,磁盘阵列)的disk(磁盘)上,通过控制产生flush IO(缓存回写的读写流)可以提高拼条带效果,提高实际的IOPS能力。
现有技术中通过以下方法来产生flush IO:采用最大资源抢占策略来产生flushIO,即有多少资源产生多少flush IO;或者,每个调度点产生固定数量的flush IO。
通过上述描述可见,现有技术中,在产生flush IO时,很难控制产生flush IO的力度,若产生flush IO的力度小,则下面disk的IO吞吐能力可能没有用满;若产生flush IO的力度太大,则下层会积累很多pending flush IO(待处理的缓存回写的读写流),导致资源冲突(例如IO锁冲突)和资源浪费(例如读cache被提前释放,内存被占用)。
发明内容
本发明提供了一种flush缓存的方法及装置,能够降低锁冲突和资源占用。
一方面,本发明提供了一种刷新flush缓存的方法,包括:
S1:预设待处理的缓存回写的读写流pending flush IO数量的临界值;
S2:判断pending flush IO数量是否小于等于所述pending flush IO数量的临界值,如果是,则产生缓存回写的读写流flush IO,否则,不产生flush IO。
进一步地,在所述S2之前还包括:
获取pending flush IO数量。
另一方面,本发明提供了一种刷新flush缓存的装置,包括:
存储单元,用于存储预设的待处理的缓存回写的读写流pending flush IO数量的临界值;
判断单元,用于判断pending flush IO数量是否小于等于所述pending flush IO数量的临界值,如果是,则产生缓存回写的读写流flush IO,否则,不产生flush IO。
进一步地,所述装置还包括:
获取单元,用于获取pending flush IO数量。
通过本发明提供的一种flush缓存的方法及装置,使得进入RAID的IO数量平滑,降低了锁冲突和资源占用,提高了存储系统的整体性能和平顺性。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的一种flush缓存的方法流程图;
图2是本发明实施例提供的一种flush缓存的装置结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种flush缓存的方法,参见图1,包括:
S1:预设pending flush IO数量的临界值;
S2:判断pending flush IO数量是否小于等于所述pending flush IO数量的临界值,如果是,则产生flush IO,否则,不产生flush IO。
在所述S2之前包括:
获取pending flush IO数量。
在一种可能的实现方式中,所述pending flush IO数量的临界值通过以下方法获得:
A1:判断pending flush IO数量是否小于等于所述预设的pending flush IO数量的初始值,如果是,则产生缓存回写的读写数据流flush IO,否则,不产生flush IO;
A2:如果检测到所述pending IO数量在预设时间段内持续上升,则减小所述pending flush IO数量的初始值,返回A1,如果检测到所述pending IO数量在预设时间段内持续下降,则增加所述pending flush IO数量的初始值,返回A1;如果检测到所述pending IO数量收敛,则将所述pending flush IO数量的初始值作为所述pending flushIO数量的临界值。
在另一种可能的实现方式中,所述pending flush IO数量的临界值通过以下方法获得:
B1:判断pending flush IO数量是否小于等于所述预设的pending flush IO数量的初始值,如果是,则产生缓存回写的读写数据流flush IO,否则,不产生flush IO;
B2:检测所述pending IO数量在预设时间段内的增长率,如果所述增长率为正,则减小所述pending flush IO数量的初始值,返回B1,如果所述增长率为负,则增加所述pending IO数量的初始值,返回B1;如果所述增长率为0,则将所述pending flush IO数量的初始值作为所述pending IO数量的临界值。
再一种可能的实现方式中,所述pending flush IO数量的临界值通过以下方法获得:
设定一个临界点经验值N0,
系统运行一段时间后:若检查pending IO数量持续上升,则IO压力已经超过临界点,可降低N0继续测试;若检查pending IO数持续下降,则IO压力没有到达临界点,可增大N0继续测试;直到pending IO数值收敛为止,确定最终的pending flush IO数量的临界值。
其中,pending flush IO数量的临界值可以通过动态自测过程来产生。
本发明实施例还提供了一种flush缓存的装置,参见图2,包括:
存储单元201,用于存储预设的pending flush IO数量的临界值;
判断单元202,用于判断pending flush IO数量是否小于等于所述pending flushIO数量的临界值,如果是,则产生flush IO,否则,不产生flush IO。
所述装置还包括:
获取单元,用于获取pending flush IO数量。
通过上述实施例提供的一种flush缓存的方法及装置,使得进入RAID的IO数量平滑,降低了锁冲突和资源占用,提高了存储系统的整体性能和平顺性。
上述设备内的各单元之间的信息交互、执行过程等内容,由于与本发明方法实施例基于同一构思,具体内容可参见本发明方法实施例中的叙述,此处不再赘述。
需要说明的是,在本文中,诸如第一和第二之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个······”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同因素。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储在计算机可读取的存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质中。
最后需要说明的是:以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。

Claims (2)

1.一种刷新flush缓存的方法,其特征在于,包括:
S1:预设待处理的缓存回写的读写流pending flush IO数量的临界值;
S2:判断pending flush IO数量是否小于等于所述pending flush IO数量的临界值,如果是,则产生缓存回写的读写流flush IO,否则,不产生flush IO;
所述S2中pending flush IO数量的临界值通过以下步骤进行更新:
如果检测到所述pending flush IO数量在预设时间段内持续上升,则减小所述pending flush IO数量的临界值,返回S2;如果检测到所述pending flush IO数量在预设时间段内持续下降,则增加所述pending flush IO数量的临界值,返回S2;如果检测到所述pending flush IO数量收敛,则将所述pending flush IO数量的初始值作为所述pendingflush IO数量的临界值,返回S2。
2.根据权利要求1所述的方法,其特征在于,在所述S2之前还包括:
获取pending flush IO数量。
CN201510058628.1A 2015-02-04 2015-02-04 一种flush缓存的方法及装置 Active CN104794068B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510058628.1A CN104794068B (zh) 2015-02-04 2015-02-04 一种flush缓存的方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510058628.1A CN104794068B (zh) 2015-02-04 2015-02-04 一种flush缓存的方法及装置

Publications (2)

Publication Number Publication Date
CN104794068A CN104794068A (zh) 2015-07-22
CN104794068B true CN104794068B (zh) 2018-05-22

Family

ID=53558874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510058628.1A Active CN104794068B (zh) 2015-02-04 2015-02-04 一种flush缓存的方法及装置

Country Status (1)

Country Link
CN (1) CN104794068B (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116880774B (zh) * 2023-09-06 2023-11-28 麒麟软件有限公司 一种Linux系统下的脏页回写方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075241A (zh) * 2006-12-26 2007-11-21 腾讯科技(深圳)有限公司 缓存处理方法以及缓存处理系统
US7480777B2 (en) * 2005-06-30 2009-01-20 Kabushiki Kaisha Toshiba Cache memory device and microprocessor
CN103631940A (zh) * 2013-12-09 2014-03-12 中国联合网络通信集团有限公司 一种应用于hbase数据库的数据写入方法及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7480777B2 (en) * 2005-06-30 2009-01-20 Kabushiki Kaisha Toshiba Cache memory device and microprocessor
CN101075241A (zh) * 2006-12-26 2007-11-21 腾讯科技(深圳)有限公司 缓存处理方法以及缓存处理系统
CN103631940A (zh) * 2013-12-09 2014-03-12 中国联合网络通信集团有限公司 一种应用于hbase数据库的数据写入方法及系统

Also Published As

Publication number Publication date
CN104794068A (zh) 2015-07-22

Similar Documents

Publication Publication Date Title
US20200218679A1 (en) Context-Aware Dynamic Command Scheduling For A Data Storage System
CN104091617B (zh) 一种闪存存储设备检测的方法及装置
US9489148B2 (en) Selecting between non-volatile memory units having different minimum addressable data unit sizes
US9298389B2 (en) Operating a memory management controller
US20130262749A1 (en) Storage system with flash memory, and storage control method
US20150206567A1 (en) Dynamic temperature adjustments in spin transfer torque magnetoresistive random-access memory (stt-mram)
US8397100B2 (en) Managing memory refreshes
US20080148108A1 (en) Separate Handling of Read and Write of Read-Modify-Write
CN103915110A (zh) 一种易失存储器的刷新方法及相关的易失存储器的控制器
US20180081590A1 (en) System and method for dynamically allocating memory at a memory controller
CN104375954B (zh) 基于工作负载实施对高速缓存的动态启用和禁用的方法和计算机系统
US20140229766A1 (en) Apparatus and method for performing data scrubbing on a memory device
KR20170092536A (ko) 다수의 순차적 기입 스트림을 관리하는 기술
US8245012B2 (en) Adaptively preventing out of memory conditions
US9400603B2 (en) Implementing enhanced performance flash memory devices
US20180150233A1 (en) Storage system
US10789170B2 (en) Storage management method, electronic device and computer readable medium
US20130117603A1 (en) Method for completing write operations to a raid drive pool with an abnormally slow drive in a timely fashion
CN104794068B (zh) 一种flush缓存的方法及装置
CN101957729A (zh) 逻辑块变换方法及基于该方法兼容用户读写的方法和装置
US7418367B2 (en) System and method for testing a cell
US11321022B2 (en) Systems and methods for scheduling flash operations
EP3188026A1 (en) Memory resource management method and apparatus
US10599530B2 (en) Method and apparatus for recovering in-memory data processing system
WO2016091139A1 (zh) 存储数据的分配方法、装置以及存储系统

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20170331

Address after: Nanshan District Guangdong streets, Shenzhen city 518131 Guangdong Province Road No. 8 financial services technology innovation base 1 building 11 floor F3

Applicant after: Shenzhen science and Technology Co.,Ltd. digital cloud data

Address before: 100085 Beijing, Haidian District, No. 9 on the ground floor of the digital science and Technology Plaza, 9

Applicant before: YUNKE CHINA DATA TECHNOLOGY LTD.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190508

Address after: 430200 Six Floors of 777B Office Building, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Address before: 518131 F3, 11th floor, No. 8 Kefa Road, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen science and Technology Co.,Ltd. digital cloud data

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230414

Address after: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Patentee after: Shenzhou Yunke (Beijing) Technology Co.,Ltd.

Address before: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee before: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.