WO2014094306A1 - 一种Cache工作模式的设置方法和装置 - Google Patents

一种Cache工作模式的设置方法和装置 Download PDF

Info

Publication number
WO2014094306A1
WO2014094306A1 PCT/CN2012/087183 CN2012087183W WO2014094306A1 WO 2014094306 A1 WO2014094306 A1 WO 2014094306A1 CN 2012087183 W CN2012087183 W CN 2012087183W WO 2014094306 A1 WO2014094306 A1 WO 2014094306A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
working mode
configuration information
optimal
feature
Prior art date
Application number
PCT/CN2012/087183
Other languages
English (en)
French (fr)
Inventor
刘保红
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/087183 priority Critical patent/WO2014094306A1/zh
Priority to CN201280003146.0A priority patent/CN104321754B/zh
Publication of WO2014094306A1 publication Critical patent/WO2014094306A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/601Reconfiguration of cache memory

Definitions

  • the invention belongs to the technical field of computers, and in particular relates to a method and a device for setting a Cache working mode.
  • SSD Solid State Disk
  • the performance is improved by more than 10 times, which effectively fills the input/output (Input/Output, IO for short) between the system memory and the HDD, but the SSD
  • the cost is very high, so the industry generally uses SSD as the acceleration cache (Cache) of the HDD, and processes a small amount of hotspot data in the system to achieve the use of SSD. A balance between performance improvement and cost increase.
  • Cache acceleration is the key to performance improvement.
  • Cache acceleration brings to the performance of specific applications is that it can be matched with specific application IO features.
  • the best working mode of Cache, and the best working mode of Cache, can be dynamically adjusted as the IO characteristics of the application change.
  • the Cache working mode provided by the prior art is set up by: analyzing in advance, and performing Cache for various business applications.
  • the performance acceleration test identifies the Cache optimal working mode configuration information corresponding to each business application.
  • the user manually sets the Cache on the management interface.
  • the working mode for different business applications, the user needs to manually select settings on the management interface; when the business application changes, the user captures the IO of the business application through the tool Feature, then reset the working mode of Cache on the management interface to realize the adjustment of Cache working mode with the change of business application IO characteristics.
  • Cache's cache mode needs to be manually set in advance, and the cache mode cannot be intelligently and dynamically adjusted according to changes in IO characteristics;
  • Cache's dirty data refresh algorithm needs to be manually set in advance, dirty data refresh algorithm can not be based on IO Intelligent dynamic adjustment of characteristics
  • Cache's best working mode is passively set, not aware of application business IO characteristics, while business IO When the feature changes, the optimal Cache working mode cannot be automatically adapted, and manual interference adjustment is required.
  • the setting method of the Cache working mode requires manual Cache
  • the working mode is set or adjusted, and the real-time and maintainability are poor.
  • the embodiment of the invention provides a method and a device for setting a Cache working mode, which are intended to solve the problems provided by the prior art.
  • Cache working mode Setting method real-time and poor maintainability.
  • the setting method of the Cache working mode includes:
  • the best mode database includes a pre-created optimal Cache The correspondence between the working mode configuration information and the IO features of the upper layer business application.
  • the performing, according to the optimal Cache working mode configuration information, After the Cache working mode is set it also includes:
  • the working mode configuration information is used to set the Cache working mode according to the optimal Cache working mode configuration information.
  • the Cache working mode includes: a Cache switch, a Cache cache mode, and a Cache Prefetch algorithm and dirty data refresh algorithm and strategy.
  • the setting device of the Cache working mode includes:
  • a matching unit configured to find an optimal Cache matching the IO feature from the best mode database Working mode configuration information
  • a setting unit configured to perform a Cache working mode according to the optimal Cache working mode configuration information setting.
  • the best mode database includes a pre-created optimal Cache The correspondence between the working mode configuration information and the IO features of the upper layer business application.
  • the apparatus further includes:
  • An IO feature monitoring unit configured to monitor whether the IO feature is changed, and if yes, triggering the matching unit and the setting unit to perform The setting of the Cache working mode.
  • the setting device of the Cache working mode includes: a processor and a memory,
  • the memory is for storing executable program code, wherein the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for:
  • the best mode database includes a pre-created optimal Cache The correspondence between the working mode configuration information and the IO features of the upper layer business application.
  • the processor is further configured to monitor the IO Whether the feature changes, if yes, finding the best Cache working mode configuration information matching the IO feature from the best mode database, and then according to the best Cache The working mode configuration information is used to set the Cache working mode.
  • an optimal mode database for various IO features is pre-established, and an IO of the current business application is obtained. After the feature, searching for the best mode database according to the IO feature, and finding the optimal Cache working mode configuration information corresponding to the IO feature, according to the optimal Cache
  • the working mode configuration information is set in the Cache working mode, and the intelligent automatic adaptation of the Cache working mode is realized without manual intervention, and the Cache is improved. Real-time and maintainability of working mode settings.
  • FIG. 1 is a flow chart showing an implementation of a method for setting a Cache working mode according to Embodiment 1 of the present invention
  • Embodiment 1 of the present invention is a schematic diagram of a best mode database provided by Embodiment 1 of the present invention.
  • FIG. 3 is a flow chart showing the implementation of a method for setting a Cache working mode according to Embodiment 2 of the present invention.
  • FIG. 4 is a structural block diagram of a device for setting a Cache working mode according to Embodiment 3 of the present invention.
  • FIG. 5 is a structural block diagram of a device for setting a Cache working mode according to Embodiment 4 of the present invention.
  • an optimal mode database for various IO features is pre-established, and an IO of the current business application is obtained. After the feature, searching for the best mode database according to the IO feature, and finding the optimal Cache working mode configuration information corresponding to the IO feature, according to the optimal Cache The working mode configuration information is used to set the Cache working mode.
  • FIG. 1 is a flowchart showing an implementation of a method for setting a Cache working mode according to Embodiment 1 of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown, which are detailed as follows:
  • step S101 an IO feature of the upper layer service application is obtained.
  • the setting device of the Cache working mode After a period of time, the statistical analysis and learning of the input/output (Input/Ou tput, IO) of the upper-layer business application identifies the IO characteristics of the upper-layer business application. It should be noted that the upper layer is regularly When the IO of the business application is statistically analyzed, it does not pay attention to the specific business application, nor does it pay attention to how the business application changes, focusing on the IO characteristics of the business application.
  • step S102 the best Cache matching the IO feature is found from the best mode database. Work mode configuration information.
  • the database is a pre-established optimal Cache working mode configuration information and an IO of an upper layer service application.
  • the correspondence table between the features can be manually established or built into the Cache acceleration software through the test tool.
  • the best mode database is shown in Figure 2, and the fields included are: IO type, IO features, Cache switches, Cache cache mode, Cache pre-stored algorithms, and dirty data refresh algorithms and policies.
  • the IO type corresponds to the IO feature one by one
  • Cache The switch, Cache cache mode, Cache pre-stored algorithm, and dirty data refresh algorithm and policy are fields corresponding to the IO feature for setting the optimal Cache working mode configuration information.
  • Cache switch is on
  • Cache cache mode is write-back mode (Write-back , WB ) or Write-through ( WT )
  • Cache pre-stored algorithms for constant prefetch dirty data refresh algorithms and strategies for least used ( Least Frequently Used (LFU) or Least Recently Used (LRU).
  • LFU Least Frequently Used
  • LRU Least Recently Used
  • the best Cache working mode configuration information corresponding to the IO feature in the best mode database mainly obtained in the following two ways:
  • the second is to automate the enumeration test for various IO types, and continuously test various Cache jobs automatically.
  • the performance test result data obtained by the mode configuration information identifies the optimal Cache working mode configuration information corresponding to each IO feature, and avoids working for each Cache test.
  • the mode configuration information is manually recorded once. It should be noted that the acquisition method can be obtained manually or automatically during the running of the Cache acceleration software.
  • step S103 the Cache working mode is performed according to the optimal Cache working mode configuration information. setting.
  • the setting device of the Cache working mode automatically finds the pre-established optimal Cache.
  • the Cache pre-stored algorithm is an on-demand, dirty data refresh algorithm and strategy for LFU.
  • the setting device of the Cache working mode may be a software unit, a hardware unit or a unit combining software and hardware.
  • an optimal mode database for various IO features is established in advance, and an IO of the current business application is obtained. After the feature, searching for the best mode database according to the IO feature, and finding the optimal Cache working mode configuration information corresponding to the IO feature, according to the optimal Cache
  • the working mode configuration information is set in the Cache working mode, and the intelligent automatic adaptation of the Cache working mode is realized without manual intervention, and the Cache is improved. Real-time and maintainability of working mode settings.
  • FIG. 3 is a flowchart showing an implementation of a method for setting a Cache working mode according to Embodiment 2 of the present invention. For the convenience of description, only the parts related to the embodiment of the present invention are shown, which are detailed as follows:
  • step S 3 01 an IO feature of the upper layer service application is obtained.
  • step S302 the best Cache matching the IO feature is found from the best mode database. Work mode configuration information.
  • step S303 the Cache working mode is set according to the optimal Cache working mode.
  • step S304 it is monitored whether the IO feature changes, and if so, steps S302 to S303 are re-executed. .
  • the setting device of the Cache working mode monitors the IO of the upper layer service application in real time. Whether the feature changes, if there is a change, first find the best Cache working mode configuration information matching the new IO feature from the pre-created best mode database, and then according to the best Cache The working mode configuration information is used to set the Cache working mode; if not, the original working mode is maintained.
  • the optimal mode database is searched again, and the automatic adjustment is performed according to the search result.
  • Cache's working mode ensures maximum Cache acceleration performance at all times.
  • the setting device 4 of the Cache working mode includes: an IO feature acquiring unit 41, a matching unit 42, and a setting unit. 43.
  • the IO feature obtaining unit 41 is configured to acquire an IO feature of an upper layer service application.
  • the matching unit 42 is configured to find the best Cache matching the IO feature from the best mode database.
  • Working mode configuration information
  • a setting unit 43 is configured to set a Cache working mode according to the optimal Cache working mode configuration information, Cache working modes include: Cache switch, Cache cache mode, Cache prefetch algorithm and dirty data refresh algorithm and strategy.
  • the best mode database is a pre-created optimal Cache working mode configuration information and an IO of an upper layer business application.
  • the best Cache working mode configuration information corresponding to the IO feature in the best mode database mainly obtained in the following two ways:
  • the second is to automate the enumeration test for various IO types, and continuously test various Cache jobs automatically.
  • the performance test result data obtained by the mode configuration information identifies the optimal Cache working mode configuration information corresponding to each IO feature, and avoids working for each Cache test.
  • the mode configuration information is manually recorded once. It should be noted that the acquisition method can be obtained manually or automatically during the running of the Cache acceleration software.
  • the device 4 further includes:
  • An IO feature monitoring unit configured to monitor whether the IO feature is changed, and if yes, triggering the matching unit and the setting unit to perform The setting of the Cache working mode.
  • the setting device of the Cache working mode provided in this embodiment can use the setting of the corresponding Cache working mode.
  • Figure 1 and Figure 3 correspond to the description of the corresponding embodiments, and details are not described here.
  • FIG. 5 is a structural block diagram of a device for setting a Cache working mode according to Embodiment 4 of the present invention, For convenience of explanation, only the portion related to the embodiment of the present invention is shown, and the setting device 5 of the Cache working mode includes a processor 51 and a memory 52.
  • the memory 52 is configured to store executable program code; the processor 51 reads the memory 52 by reading The stored executable program code is configured to execute a program corresponding to the executable program code, to: acquire an IO feature of an upper layer business application, and find an optimal match with the IO feature from the best mode database
  • the Cache working mode configuration information is set according to the optimal Cache working mode configuration information, and the Cache working mode includes: a Cache switch, Cache cache mode, Cache prefetch algorithm, and dirty data refresh algorithm and strategy.
  • the best mode database is a pre-created optimal Cache working mode configuration information and an IO of an upper layer business application.
  • the best Cache working mode configuration information corresponding to the IO feature in the best mode database mainly obtained in the following two ways:
  • the second is to automate the enumeration test for various IO types, and continuously test various Cache jobs automatically.
  • the performance test result data obtained by the mode configuration information identifies the optimal Cache working mode configuration information corresponding to each IO feature, and avoids working for each Cache test.
  • the mode configuration information is manually recorded once. It should be noted that the acquisition method can be obtained manually or automatically during the running of the Cache acceleration software.
  • the processor 51 is further configured to monitor the IO Whether the feature changes, if yes, finding the best Cache working mode configuration information matching the IO feature from the best mode database, and then according to the best Cache The working mode configuration information is used to set the Cache working mode.
  • the setting device of the Cache working mode provided in this embodiment can use the setting of the corresponding Cache working mode.
  • Figure 1 and Figure 3 correspond to the description of the corresponding embodiments, and details are not described here.
  • each unit included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be implemented; in addition, the specific name of each functional unit It is also for convenience of distinguishing from each other and is not intended to limit the scope of protection of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明适用于计算机技术领域,提供了一种Cache工作模式的设置方法和装置,所述方法包括:获取上层业务应用的IO特征;从最佳模式数据库中査找到与所述IO特征匹配的最佳Cache工作模式配置信息;根据所述最佳Cache工作模式配置信息进行Cache工作模式的设置。本发明,当获取到当前业务应用的IO特征后,根据IO特征査找最佳模式数据库,从中找到与IO特征对应的最佳Cache工作模式配置信息,根据所述最佳Cache工作模式配置信息进行Cache工作模式的设置,无需人工干预,实现了Cache工作模式的智能自动适配,提升了Cache工作模式设置的实时性及可维护性。

Description

一种 Cache 工作模式的 设置 方法 和 装置 技术领域
本发明属于 计算机 技术领域,尤其涉及一种 Cache 工作模式 的设置方法和装置 。
背景技术
随着技术的发展 , 处理器性能提升的速度远高于机械硬盘 ( Hard Disk Drive , 简称 HDD )性能的提升速度,导致机械硬盘 HDD 的性能已经成为系统性能的瓶颈,固态硬盘( Solid State Disk , 简称 SSD )相对 HDD 性能提升 10 倍以上,正好有效填充系统内存与 HDD 之间的 输入输出 ( Input/Output , 简称 IO )空缺,但是 SSD 的成本又非常高,因此业界普遍将 SSD 作为 HDD 的加速缓存 ( Cache ) ,处理系统中的少量的热点数据 , 来达到 使用 SSD 带来 的 性能提升与成本增加的平衡 。如果 Cache 加速做得好的话, 可以通过配置少量的 SSD 获得大幅的性能提升。 如可以通过配置存储容量的 20% 左右的 SSD ,达到全配置 SSD 90% 以上的性能提升 。 因此 Cache 加速 成为性能提升的关键。
Cache 加速给具体应用带来性能提升高低 的 一个主要因素是 : 结合具体应用 IO 特征 ,能够匹配 Cache 的最 佳 工作模式,以及 Cache 的最 佳 工作模式能够随着应用 IO 特征变化而动态调整。
现有 技术提供的 Cache 工作模式 设置方法为 :提前分析 , 针对各种 业务 应用进行 Cache 性能加速测试,识别出与 每种 业务应用对应的 Cache 最佳工作模式配置 信息 ,进行 Cache 工作模式配置时 , 用户在管理界面上手动设置 Cache 的 工作模式, 针对 不同 业务 应用 , 用户需手动在管理界面上选择设置 ; 当业务应用发生变化 时 ,用户通过工具捕获 业务 应用的 IO 特征,之后在管理界面上重新设置 Cache 的工作模式,实 现 Cache 工作模式随业务应用 IO 特征变化的调整。
现有 的 Cache 工作模式 ( 如缓存模式、预取算法以及脏数据刷新机制或算法等 ) 设置 方法 存在以下问题:
1 ) Cache 的缓存模式需预先手动设置,缓存模式不能根据 IO 特征的变化智能动态调节;
2 ) Cache 的预取算法需预先手动设置,预取算法不能根据 IO 特征的变化智能动态调节;
3 ) Cache 的 脏数据刷新算法需预先手动设置,脏数据刷新算法不能根据 IO 特征的变化智能动态调节;
4 ) Cache 的 最佳工作模式 是 被动设置 的, 不能感知应用业务 IO 特征,同时当业务 IO 特征发生变化时 , 不能自动适配最佳的 Cache 工作模式,需人工干涉调整 。
综上所述,现有技术提供的 Cache 工作模式 的设置方法,需要人工对 Cache 的工作模式进行设置或者调整,实时性及可维护性差。
技术问题
本发明实施例提供了一 种 Cache 工作模式 的设置方法和装置,旨在解决现有技术提供的 Cache 工作模式 设置方法,实时性及可维护性差的问题。
技术解决方案
第一方面, 所述 Cache 工作模式 的 设置 方法 包括:
获取上层业务应用的 IO 特征;
从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
在第一方面的第一种可能的实现方式中, 所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
在第一方面的第 二 种可能的实现方式中 ,在所述根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置之后,还包括:
监控所述 IO 特征是否变化;
如果是,则从所述最佳模式数据库中查找到与变化后的 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
结合第一方面或 第一方面的第 一 种可能的实现方式 或 第一方面的第 二 种可能的实现方式 , 在第一方面的第 三 种可能的实现方式中 , 所述 Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
第二 方面, 所述 Cache 工作模式 的 设置 装置包括:
IO 特征单元,用于获取上层业务应用的 IO 特征;
匹配单元,用于从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
设置单元,用于根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
在第 二 方面的第一种可能的实现方式中 ,所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
在第 二 方面 的 第 二 种可能的实现方式中 ,所述装置还包括:
IO 特征监控单元,用于监控所述 IO 特征是否变化,如果是,则触发所述匹配单元和所述设置单元进行 Cache 工作模式 的设置。
第三方面,所述 Cache 工作模式 的设置装置包括:处理器与存储器, 所述存储器用于存储可执行程序代码,其中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于:
获取上层业务应用的 IO 特征;
从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
在第 三 方面的第一种可能的实现方式中 ,所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
在第 三 方面的第 二 种可能的实现方式中 ,所述处理器还用于,监控所述 IO 特征是否变化,如果是,则从所述最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
有益效果
在本发明实施例中, 预先建立针对各种 IO 特征的最佳模式数据库,当获取到当前业务应用的 IO 特征后,根据所述 IO 特征查找最佳模式数据库,从中找到与所述 IO 特征对应的最佳 Cache 工作模式配置信息,根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式的设置,无需人工干预,实现了 Cache 工作模式的智能自动适配,提升了 Cache 工作模式设置的实时性及可维护性。
附图说明
图 1 是本发明实施例一提供的 Cache 工作模式 的设置方法的实现流程 图;
图 2 是本发明实施例 一 提供的 最佳模式数据库的示意 图 ;
图 3 是本发明实施例 二 提供的 Cache 工作模式 的设置方法的实现流程 图 ;
图 4 是本发明实施例 三 提供的 Cache 工作模式 的设置装置的结构框图;
图 5 是本发明实施例 四 提供的 Cache 工作模式 的设置装置的结构框图 。
本发明的实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
在本发明实施例中, 预先建立针对各种 IO 特征的最佳模式数据库,当获取到当前业务应用的 IO 特征后,根据所述 IO 特征查找最佳模式数据库,从中找到与所述 IO 特征对应的最佳 Cache 工作模式配置信息,根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式的设置。
以下结合具体实施例对本发明的实现进行详细描述:
实施例 一
图 1 示出了本发明实施例 一 提供的 Cache 工作模式 的设置方法的实现流程图 ,为了便于说明,仅示出了与本发明实施例相关的部分 ,详述如下:
在步骤 S101 中, 获取上层业务应用的 IO 特征。
在本发明实 施例中,当针对具体 上层业务 应 用加速时, Cache 工作模式 的设置装置 经过一段时间对上层业务应用的输入输出 (Input/Ou tput , IO )的统计分析与学习,识别出该上层业务应用的 IO 特征。需要说明的是,定期对上层 业务应用的 IO 进行统计分析 时, 不关注具体 业务 应用是什么,也不关注 业务 应用发生怎么样的变化,重点关注 业务 应用的 IO 特征 ,其中,业务应用的 IO 特征包括大块连续、大块随机高读写比、大块随机低读写比、小块连续高读写比、小块连续低读写比、小块随机高读写比、小块随机低读写比等,在此不一一列举。
在步骤 S102 中,从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息。
在本发明实施例中,所述数据库是预先建立的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应表,可以通过人工建立,也可以通过测试工具建立好后植入 Cache 加速软件中。所述最佳模式数据库如图 2 所示,包括的字段有: IO 类型、 IO 特征、 Cache 开关、 Cache 缓存模式、 Cache 预存算法和脏数据刷新算法与策略。其中, IO 类型与 IO 特征一一对应, Cache 开关、 Cache 缓存模式、 Cache 预存算法和脏数据刷新算法与策略是与 IO 特征对应的用于设置最佳 Cache 工作模式配置信息的字段。例如, IO 特征为'小块连续低读写比'时,对应的最佳 Cache 工作模式配置 信息为: Cache 开关为开, Cache 缓存模式为回写模式( Write-back , WB )或直写模式( Write-through , WT )、 Cache 预存算法为恒预取、脏数据刷新算法与策略为最不经常使用( Least Frequently Used , LFU )或最近最少使用( Least Recently Used , LRU )。
其中,需要说明的是 ,最佳模式 数据 库 中和 IO 特征对应的最佳 Cache 工作模式配置 信息 , 主要通过以下两种方式获取:
一是 基于 Cache 历史最佳实践性能经验,结合 上层业务 应用的 IO 特征,归纳总结出各种 IO 特征对应的最佳 Cache 工作模式 配置信息;
二是针对各种 IO 类型进行自动化枚举测试,通过连续自动测试各种 Cache 工作 模式配置信息获取的性能测试结果数据,识别出各个 IO 特征对应的最佳 Cache 工作模式 配置信息,避免每测试一种 Cache 工作 模式配置信息人工记录一次。需要说明的是该种获取方式可以由人工获取,也可以在 Cache 加速 软件 的运行过程中自动获取。
在步骤 S103 中,根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
在本发明实施例中,例如,当通过步骤 S101 获取到上层业务应用的 IO 特征为'大块随机高读写比',需要对 Cache 的 工作模式 进行设置时, Cache 工作模式 的设置装置自动查找预先建立的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应表,根据对应表中的对应关系获取'大块随机高读写比'对应的最佳 Cache 工作模式配置信息,进而根据获取到的最佳 Cache 工作模式配置信息将 Cache 的工作模式设置为: Cache 开关为开, Cache 缓存模式为 WT 、 Cache 预存算法为按需取、脏数据刷新算法与策略为 LFU 。
其中, Cache 工作模式 的设置装置可以是软件单元、硬件单元或者软硬件结合的单元。
本发明实施例,预先建立针对各种 IO 特征的最佳模式数据库,当获取到当前业务应用的 IO 特征后,根据所述 IO 特征查找最佳模式数据库,从中找到与所述 IO 特征对应的最佳 Cache 工作模式配置信息,根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式的设置,无需人工干预,实现了 Cache 工作模式的智能自动适配,提升了 Cache 工作模式设置的实时性及可维护性。
实施例二
图 3 示出了本发明实施例 二 提供的 Cache 工作模式 的设置方法的实现流程图 ,为了便于说明,仅示出了与本发明实施例相关的部分 ,详述如下:
在步骤 S 3 01 中, 获取上层业务应用的 IO 特征。
在步骤 S302 中,从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息。
在步骤 S303 中,根据所述最佳 Cache 工作模式进行 Cache 工作模式 的设置。
在步骤 S304 中,监控所述 IO 特征是否变化,如果是,则重新执行步骤 S302 至 S303 。
在本实施例中, Cache 工作模式 的设置装置实时监控上层业务应用的 IO 特征是否变化,如果发生变化,则先从预先创建的最佳模式数据库中查找与新的 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置;如果否,则保持原有工作模式。
本发明实施例,当业务应用的 IO 特征发生变化时,则重新查找最佳模式数据库,根据查找结果自动调节 Cache 的工作模式,可以时刻保证 Cache 加速性能最大化。
实施例 三
图 4 示出了本发明实施例 三 提供的 Cache 工作模式 的设置装置的结构框图, 为了便于说明,仅示出了与本发明实施例相关的部分 ,所述 Cache 工作模式 的设置装置 4 包括: IO 特征获取单元 41 、匹配单元 42 和设置单元 43 。
其中, IO 特征获取单元 41 ,用于获取上层业务应用的 IO 特征;
匹配单元 42 ,用于从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
设置单元 43 ,用于根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置, Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
进一步地,所述最佳模式数据库是预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应表。
其中,需要说明的是 ,最佳模式 数据 库 中和 IO 特征对应的最佳 Cache 工作模式配置 信息 , 主要通过以下两种方式获取:
一是 基于 Cache 历史最佳实践性能经验,结合 上层业务 应用的 IO 特征,归纳总结出各种 IO 特征对应的最佳 Cache 工作模式 配置信息;
二是针对各种 IO 类型进行自动化枚举测试,通过连续自动测试各种 Cache 工作 模式配置信息获取的性能测试结果数据,识别出各个 IO 特征对应的最佳 Cache 工作模式 配置信息,避免每测试一种 Cache 工作 模式配置信息人工记录一次。需要说明的是该种获取方式可以由人工获取,也可以在 Cache 加速 软件 的运行过程中自动获取。
进一步地,所述装置 4 还包括:
IO 特征监控单元,用于监控所述 IO 特征是否变化,如果是,则触发所述匹配单元和所述设置单元进行 Cache 工作模式 的设置。
本实施例提供的 Cache 工作模式 的设置装置 可以使用在前述对应的 Cache 工作模式 的设置 方法,详情参见上述 Cache 工作模式 的设置方法 图 1 和图 3 对应实施例的相关描述,在此不再赘述。
实施例 四
图 5 示出了本发明实施例 四 提供的 Cache 工作模式 的设置装置的结构框图, 为了便于说明,仅示出了与本发明实施例相关的部分 ,所述 Cache 工作模式 的设置装置 5 包括:处理器 51 和存储器 52 。
其中, 所述存储器 52 用于存储可执行程序代码 ; 所述处理器 51 通过读取所述存储器 52 中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于: 获取上层业务应用的 IO 特征,从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息,根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置, Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
进一步地,所述最佳模式数据库是预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应表。
其中,需要说明的是 ,最佳模式 数据 库 中和 IO 特征对应的最佳 Cache 工作模式配置 信息 , 主要通过以下两种方式获取:
一是 基于 Cache 历史最佳实践性能经验,结合 上层业务 应用的 IO 特征,归纳总结出各种 IO 特征对应的最佳 Cache 工作模式 配置信息;
二是针对各种 IO 类型进行自动化枚举测试,通过连续自动测试各种 Cache 工作 模式配置信息获取的性能测试结果数据,识别出各个 IO 特征对应的最佳 Cache 工作模式 配置信息,避免每测试一种 Cache 工作 模式配置信息人工记录一次。需要说明的是该种获取方式可以由人工获取,也可以在 Cache 加速 软件 的运行过程中自动获取。
进一步地,所述处理器 51 还用于,监控所述 IO 特征是否变化,如果是,则从所述最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
本实施例提供的 Cache 工作模式 的设置装置 可以使用在前述对应的 Cache 工作模式 的设置 方法,详情参见上述 Cache 工作模式 的设置方法 图 1 和图 3 对应实施例的相关描述,在此不再赘述。
值得注意的是,上述系统实施例中,所包括的各个单元只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。
另外,本领域普通技术人员可以理解实现上述各实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,相应的程序可以存储于一计算机可读取存储介质中,所述的存储介质,如 ROM/RAM 、磁盘或光盘等。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (12)

  1. 一种 Cache 工作模式 的设置方法,其特征在于,所述方法包括:
    获取上层业务应用的输入输出 IO 特征;
    从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
    根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
  2. 如权利要求 1 所述的方法,其特征在于,所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
  3. 如权利要求 1 所述的方法,其特征在于,在所述根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置之后,还包括:
    监控所述 IO 特征是否变化;
    如果是,则从所述最佳模式数据库中查找到与变化后的 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
  4. 如权利要求 1 至 3 任一项所述的方法,其特征在于,所述 Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
  5. 一种 Cache 工作模式 的设置装置,其特征在于,所述装置包括:
    输入输出 IO 特征单元,用于获取上层业务应用的 IO 特征;
    匹配单元,用于从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
    设置单元,用于根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
  6. 如权利要求 5 所述的装置,其特征在于,所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
  7. 如权利要求 5 所述的装置,其特征在于,所述装置还包括:
    IO 特征监控单元,用于监控所述 IO 特征是否变化,如果是,则触发所述匹配单元和所述设置单元进行 Cache 工作模式 的设置。
  8. 如权利要求 5 至 7 任一项所述的装置,其特征在于,所述 Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
  9. 一种 Cache 工作模式 的设置装置,其特征在于,所述装置包括:处理器与存储器, 所述存储器用于存储可执行程序代码,其中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于:
    获取上层业务应用的输入输出 IO 特征;
    从最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息;
    根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
  10. 如权利要求 9 所述的装置,其特征在于,所述最佳模式数据库包括预先创建的最佳 Cache 工作模式配置信息与上层业务应用的 IO 特征之间的对应关系。
  11. 如权利要求 9 所述的装置,其特征在于,所述处理器还用于,监控所述 IO 特征是否变化,如果是,则从所述最佳模式数据库中查找到与所述 IO 特征匹配的最佳 Cache 工作模式配置信息,再根据所述最佳 Cache 工作模式配置信息进行 Cache 工作模式 的设置。
  12. 如权利要求 9 至 11 任一项所述的装置,其特征在于,所述 Cache 工作模式包括: Cache 开关、 Cache 缓存模式、 Cache 预取算法及脏数据刷新算法与策略。
PCT/CN2012/087183 2012-12-21 2012-12-21 一种Cache工作模式的设置方法和装置 WO2014094306A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/087183 WO2014094306A1 (zh) 2012-12-21 2012-12-21 一种Cache工作模式的设置方法和装置
CN201280003146.0A CN104321754B (zh) 2012-12-21 2012-12-21 一种Cache工作模式的设置方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/087183 WO2014094306A1 (zh) 2012-12-21 2012-12-21 一种Cache工作模式的设置方法和装置

Publications (1)

Publication Number Publication Date
WO2014094306A1 true WO2014094306A1 (zh) 2014-06-26

Family

ID=50977583

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087183 WO2014094306A1 (zh) 2012-12-21 2012-12-21 一种Cache工作模式的设置方法和装置

Country Status (2)

Country Link
CN (1) CN104321754B (zh)
WO (1) WO2014094306A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649041A (zh) * 2016-12-27 2017-05-10 郑州云海信息技术有限公司 自动测试存储缓存模式的装置及方法
CN114461150A (zh) * 2022-02-09 2022-05-10 马来西亚明试国际有限公司 一种用于自动测试设备数据聚合的方法、系统及存储介质
CN114630175A (zh) * 2022-03-14 2022-06-14 网络通信与安全紫金山实验室 一种缓存管理方法、装置、设备和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569732B (zh) * 2015-10-12 2021-04-20 中兴通讯股份有限公司 数据迁移方法及装置
CN110009104A (zh) * 2019-03-29 2019-07-12 联想(北京)有限公司 一种信息处理方法及信息处理装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920888A (en) * 1996-02-15 1999-07-06 Kabushiki Kaisha Toshiba Cache memory system having high and low speed and power consumption modes in which different ways are selectively enabled depending on a reference clock frequency
CN1545033A (zh) * 2003-11-14 2004-11-10 清华大学 Fc-san存储子系统的lun cache方法
US20060253656A1 (en) * 2005-05-03 2006-11-09 Donawa Christopher M Method, apparatus, and program to efficiently calculate cache prefetching patterns for loops
CN1910538A (zh) * 2003-12-18 2007-02-07 英特尔公司 改变高速缓存策略的方法和系统
CN101105773A (zh) * 2007-08-20 2008-01-16 杭州华三通信技术有限公司 一种利用缓存实现数据存储的方法和装置
CN101236530A (zh) * 2008-01-30 2008-08-06 清华大学 高速缓存替换策略的动态选择方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4862067B2 (ja) * 2009-06-09 2012-01-25 株式会社日立製作所 キャッシュ制御装置及び方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920888A (en) * 1996-02-15 1999-07-06 Kabushiki Kaisha Toshiba Cache memory system having high and low speed and power consumption modes in which different ways are selectively enabled depending on a reference clock frequency
CN1545033A (zh) * 2003-11-14 2004-11-10 清华大学 Fc-san存储子系统的lun cache方法
CN1910538A (zh) * 2003-12-18 2007-02-07 英特尔公司 改变高速缓存策略的方法和系统
US20060253656A1 (en) * 2005-05-03 2006-11-09 Donawa Christopher M Method, apparatus, and program to efficiently calculate cache prefetching patterns for loops
CN101105773A (zh) * 2007-08-20 2008-01-16 杭州华三通信技术有限公司 一种利用缓存实现数据存储的方法和装置
CN101236530A (zh) * 2008-01-30 2008-08-06 清华大学 高速缓存替换策略的动态选择方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649041A (zh) * 2016-12-27 2017-05-10 郑州云海信息技术有限公司 自动测试存储缓存模式的装置及方法
CN114461150A (zh) * 2022-02-09 2022-05-10 马来西亚明试国际有限公司 一种用于自动测试设备数据聚合的方法、系统及存储介质
CN114630175A (zh) * 2022-03-14 2022-06-14 网络通信与安全紫金山实验室 一种缓存管理方法、装置、设备和存储介质
CN114630175B (zh) * 2022-03-14 2023-08-22 网络通信与安全紫金山实验室 一种缓存管理方法、装置、设备和存储介质

Also Published As

Publication number Publication date
CN104321754A (zh) 2015-01-28
CN104321754B (zh) 2017-12-15

Similar Documents

Publication Publication Date Title
WO2014094306A1 (zh) 一种Cache工作模式的设置方法和装置
TWI621068B (zh) 伺服器機架電力管理
RU2643651C2 (ru) Система и способ для вычисления дайджеста сообщений
WO2018161478A1 (zh) 多区块链的分片处理方法、装置、服务器和存储介质
WO2018076800A1 (zh) 一种数据异步更新方法及其系统
TW201738731A (zh) 多處理器系統及快取共用方法
WO2013185637A1 (zh) 存储设备及其中断控制方法
WO2018094809A1 (zh) 一种资源共享方法及装置
WO2014065602A1 (en) Apparatus and method for controlling operation mode in a wireless terminal
WO2014015572A1 (zh) 一种Android自动测试跨应用的装置及方法
WO2013097119A1 (zh) 在文件系统中实现多级存储的方法和装置
US8281178B2 (en) Hybrid computer security clock
WO2014029111A1 (zh) 一种用户行为处理系统及方法
WO2012091234A1 (ko) 비휘발성 메모리 및 휘발성 메모리를 포함하는 메모리 시스템 및 그 시스템을 이용한 처리 방법
WO2017067290A1 (zh) 指纹录入方法、装置及终端设备
WO2013189186A1 (zh) 非易失性存储设备的缓存管理方法及装置
WO2018018819A1 (zh) 应用程序的管理方法、管理装置及终端
WO2013127195A1 (zh) 链式沟通协作方法、装置及系统
WO2014094303A1 (zh) 一种监控记录管理方法与装置
WO2012149815A1 (zh) 磁盘缓存的管理方法及装置
WO2019000304A1 (zh) 舆情监控方法及系统
WO2012097569A1 (zh) 一种12c设备的访问方法及装置
WO2018068740A1 (zh) 终端及其应用程序的启动管理方法
WO2014139204A1 (zh) 一种闪存存储设备中数据管理的方法及装置
WO2016127315A1 (zh) 一种私有云系统的资源共享方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12890338

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12890338

Country of ref document: EP

Kind code of ref document: A1