CN106873910A - 一种基于openstack平台的SSD缓存方法 - Google Patents
一种基于openstack平台的SSD缓存方法 Download PDFInfo
- Publication number
- CN106873910A CN106873910A CN201710062792.9A CN201710062792A CN106873910A CN 106873910 A CN106873910 A CN 106873910A CN 201710062792 A CN201710062792 A CN 201710062792A CN 106873910 A CN106873910 A CN 106873910A
- Authority
- CN
- China
- Prior art keywords
- page
- ssd
- caching
- structures
- methods based
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本发明公开了一种基于openstack平台的SSD缓存方法,其特征在于:SSD缓存放置于VFS和Distribute/Stripe之间;SSD缓存模块三种结构体,其中page结构体包括所有与缓存页相关的属性,inode结构体用于存放与文件相关的属性,table结构体用于存放全局信息。基于SSD的缓存方法能很好解决openstack平台的网络和磁盘读写瓶颈问题。
Description
技术领域
本发明提出一种基于openstack平台的SSD缓存方法,涉及云计算、计算机技术领域。
技术背景
OpenStack已经被越来越多的厂家和云计算服务提供商采纳并应用至生产环境中。Rackspace已经采用OpenStack提供虚拟机和云存储服务,其中云存储Swift已经达到100PB。HP新推出的公有云服务也是基于OpenStack的。新浪已经推出基于OpenStack的虚拟机和云存储服务。
GlusterFS是Openstack采用的集群的文件系统,支持PB级的数据量。GlusterFS通过RDMA和TCP/IP方式将分布到不同服务器上的存储空间汇集成一个大的网络并行文件系统。该系统现在正式支持OpenStack的三种主要模式存储,包括:文件、块和对象。GlusterFS用户空间采用的堆栈式架构。该架构在GlusterFS的客户端和服务端(均在用户空间)可以在服务初始化的过程中插入链状的自定义模块。但它带来的问题是网络I/O和磁盘I/O的性能瓶颈。加入缓存能够很好的解决此类问题,GlusterFS本身也包含I/O缓存模块,但他提供的缓存是只读的,而且缓存大小受限制。
现存的缓存架构也很多,比如最近很火热的memcached架构以及其变种。Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态、数据库驱动网站的速度。为了提高性能,memcached中保存的数据都存储在memcached内置的内存存储空间中。由于数据仅存在于内存中,因此重启memcached、重启操作系统会导致全部数据消失。另外,内容容量达到指定值之后,就基于LRU(Least Recently Used)算法自动删除不使用的缓存,因此很多缓存替换算法都未能使用。该系统正在被广泛应用,但是它并不适合GlusterFS,应用场景也有所不同,它无法根据我们的需求很好的调整参数。
故本发明将提出一个适合GlusterFS,并且可读可写的SSD缓存方法。
发明内容
发明目的:本发明的目的在于提供一种基于openstack平台的SSD缓存方法,解决网络I/O和磁盘I/O瓶颈。
实现本发明目的技术方案:在GlusterFS上添加了SSD缓存模块,SSD缓存模块包括三种结构体:page结构体包括所有与缓存页相关的属性,inode结构体用于存放与文件相关的属性,table结构体用于存放全局信息。基于这三种结构体,可以在服务初始化的过程中插入链状的自定义模块,实现SSD缓存方案。
SSD缓存模块中的page结构体包括所有与缓存页相关的属性:包含缓存页本身字段,缓存页的替换算法和当前页的等待队列。
(1)页自身相关字段:包含inode指针,ready字段,offset字段,size字段。通过inode指针可以访问该页所属的inode。ready字段表示该页的内容是否准备就绪以供读写。offset表示该页的起始在inode中的偏移量。size字段表示该页的实际大小。
(2)缓存页的替换算法:包括inode_lru与table_lru:前者通过list_head与inode形成双向链表结构,以inode为head,可以遍历与该inode相关联的所有页;后者与table形成双向链表结构,这个链表包含了所有的页,是全局的LRU链表,在缓存页用满需要替换时,从链表尾取出page,并将其释放。
(3)当前页的等待队列。等待队列用来对读写请求进行排队。
SSD缓存模块中的inode结构体用于存放与文件相关的属性:包括与table结构体相关的属性,与page结构体相关的属性和自身属性。
(1)与table相关的属性。inode_list是所有inode形成的双向链表。table指向的是inode关联的table。
(2)与page相关的属性。page_lru是inode下page组成的链表。dirty_list是inode下所有脏页组成的链表。dirty_cnt表示脏页的数量。
(3)inode自身的属性。inode指针指向原始的inode。size字段表示inode关联的文件的大小,如果当前写入的数据块超过了文件大小,则需要更新该字段,同时需要对后端存储的该文件执行truncate操作。
SSD缓存模块中的table结构体用于存放全局信息:包含页大小、缓存大小、缓存的使用情况、与替换算法相关的信息等。
其中page_size表示页大小,cache_size表示缓存文件的大小,即缓存容量,该值为page_size的整数倍,cache_used表示已使用的缓存大小,该值等于已分配的dc_page数量乘以page_size,list_head inodes表示所有inode组成的双向链表,inode_count表示inode的数量,page_lru表示page LRU的链表头,访问页时将页插入到链表头之后,替换页时替换链表尾的页,page_lru_cnt表示pageLRU链表中的page数量,dirty_list表示所有的脏页链表,在回写线程中进行遍历,dirty_cnt表示所有脏页的数量
本发明具有的有益效果:
本发明在openstack本身采用的GlusterFS上添加了SSD Cache模块,比原有提供的可配置Cache多了以下好处:缓存策略可配置、页大小可配置、缓存容量不受限制、读写均可缓存。
附图说明
图1是本发明的openstack架构图。
图2是本发明的GlusterFS架构图。
图3是本发明的具体实施方式的详细流程图。
具体实施方式
下面结合附图对本发明的技术方案进行详细说明:
图1显示了本发明在openstack平台中添加SSD Cache位置,它在计算结点端的分布式文件系统的客户端。因为该缓存直接存在于客户端,若缓存命中率较高,缓存的数据也无需经常通过网络读取服务器硬盘上的数据,故在该位置可以在该位置可以明显改善网络I/O和磁盘I/O。
图2显示了本发明在GlusterFS分布式文件系统中的详细位置。因为GlusterFS用户空间的堆栈式架构指的是在GlusterFS的客户端和服务端(均在用户空间)通过配置可以在服务初始化的过程中插入链状的自定义模块,故本发明在VFS和Distribute之间加入SSDCache模块,以起到缓存的目的。
为了便于公众理解本发明的技术方案,以读请求为例(采用LRU替换策略)。图3为该例子的详细流程图,具体步骤如下:
步骤S101、读页请求。
步骤S102、判断缓存中是否有该页,即是否命中(table中是否有该页)。若没有跳转至步骤S103,否则跳转至步骤S110。
步骤S103、根据LRU替换算法,替换链表链尾的page。
步骤S104、根据请求和page结构体的结构,根据步骤101读取的请求和page结构体的结构,申请空间,创建新页,构造page。
步骤S105、添加当前读请求至page waitq中。
步骤S106、通过异步的方式请求页内容。即暂时搁置当前请求的响应,处理下一个请求,当通过轮询或其他方式得到回调通知后,开始运行;
步骤S107、通过异步的方式更新页内容,成功后,将该页置于链表链头。
步骤S108、设置该page的ready为1。
步骤S109、处理page waitq中的请求,跳转至结束。
步骤S110、添加当前读请求到page waitq中。
步骤S111、检查page是否ready,若是,则跳转至步骤S112,否则结束。
步骤S112、处理page waitq中的请求,将访问的新页放置于链头。
Claims (4)
1.一种基于openstack平台的SSD缓存方法,其特征在于:采用GlusterFS作为openstack平台的分布式文件系统,在GlusterFS的VFS和Distribute/Stripe之间加入SSD缓存模块;所述SSD缓存模块包括三种结构体:page结构体包括所有与缓存页相关的属性,inode结构体用于存放与文件相关的属性,table结构体用于存放全局信息;通过所述SSD缓存模块的三种结构体在服务初始化的过程中插入链状的自定义模块。
2.根据权利要求1所述的基于openstack平台的SSD缓存方法,其特征在于:所述page结构体包含缓存页本身字段,缓存页的替换算法和当前页的等待队列。
3.根据权利要求1所述的基于openstack平台的SSD缓存方法,其特征在于:所述inode结构体包括与table结构体相关的属性与page结构体相关的属性和自身属性。
4.根据权利要求1所述的基于openstack平台的SSD缓存方法,其特征在于:所述table结构体包含页大小、缓存大小、缓存的使用情况及与替换算法相关的信息。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710062792.9A CN106873910B (zh) | 2017-01-25 | 2017-01-25 | 一种基于openstack平台的SSD缓存方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710062792.9A CN106873910B (zh) | 2017-01-25 | 2017-01-25 | 一种基于openstack平台的SSD缓存方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106873910A true CN106873910A (zh) | 2017-06-20 |
CN106873910B CN106873910B (zh) | 2020-06-05 |
Family
ID=59165961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710062792.9A Active CN106873910B (zh) | 2017-01-25 | 2017-01-25 | 一种基于openstack平台的SSD缓存方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106873910B (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189339A (zh) * | 2018-08-28 | 2019-01-11 | 郑州云海信息技术有限公司 | 一种存储系统下自动配置缓存加速方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103605630A (zh) * | 2013-11-28 | 2014-02-26 | 中标软件有限公司 | 一种虚拟服务器系统及其数据读写方法 |
US20150067001A1 (en) * | 2013-08-30 | 2015-03-05 | International Business Machines Corporation | Cache management in a computerized system |
CN104536988A (zh) * | 2014-12-10 | 2015-04-22 | 杭州斯凯网络科技有限公司 | MonetDB分布式计算存储方法 |
-
2017
- 2017-01-25 CN CN201710062792.9A patent/CN106873910B/zh active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150067001A1 (en) * | 2013-08-30 | 2015-03-05 | International Business Machines Corporation | Cache management in a computerized system |
CN103605630A (zh) * | 2013-11-28 | 2014-02-26 | 中标软件有限公司 | 一种虚拟服务器系统及其数据读写方法 |
CN104536988A (zh) * | 2014-12-10 | 2015-04-22 | 杭州斯凯网络科技有限公司 | MonetDB分布式计算存储方法 |
Non-Patent Citations (2)
Title |
---|
严峥: "面向桌面云的I_O访存模式及缓存管理策略_严峥", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
周凡夫: "GlusterFS 缓存机制研究", 《计算机应用与软件》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189339A (zh) * | 2018-08-28 | 2019-01-11 | 郑州云海信息技术有限公司 | 一种存储系统下自动配置缓存加速方法 |
CN109189339B (zh) * | 2018-08-28 | 2021-08-20 | 郑州云海信息技术有限公司 | 一种存储系统下自动配置缓存加速方法 |
Also Published As
Publication number | Publication date |
---|---|
CN106873910B (zh) | 2020-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107491523B (zh) | 存储数据对象的方法及装置 | |
CN102760101B (zh) | 一种基于ssd 的缓存管理方法及系统 | |
US9251003B1 (en) | Database cache survivability across database failures | |
US8819074B2 (en) | Replacement policy for resource container | |
US20110191522A1 (en) | Managing Metadata and Page Replacement in a Persistent Cache in Flash Memory | |
CN103530387A (zh) | 一种hdfs针对小文件的改进方法 | |
US8868863B2 (en) | Method and apparatus for a frugal cloud file system | |
US9542401B1 (en) | Using extents of indirect blocks for file mapping of large files | |
US9940023B2 (en) | System and method for an accelerator cache and physical storage tier | |
CN110188108A (zh) | 数据存储方法、装置、系统、计算机设备及存储介质 | |
US10061523B2 (en) | Versioning storage devices and methods | |
US20120290595A1 (en) | Super-records | |
KR20220139784A (ko) | 객체 저장 방법 및 이를 이용하는 분산 객체 스토리지와 시스템 | |
US9021208B2 (en) | Information processing device, memory management method, and computer-readable recording medium | |
US20080229333A1 (en) | Method, System And Storage Medium For Implementing A Message Board Cache System | |
CN109117088A (zh) | 一种数据处理方法及系统 | |
CN109086462A (zh) | 一种分布式文件系统中元数据的管理方法 | |
CN114817195A (zh) | 一种分布式存储缓存管理的方法、系统、存储介质及设备 | |
US11221956B2 (en) | Hybrid storage device with three-level memory mapping | |
US20130086325A1 (en) | Dynamic cache system and method of formation | |
US7529891B2 (en) | Balanced prefetching exploiting structured data | |
CN106873910A (zh) | 一种基于openstack平台的SSD缓存方法 | |
US11947817B2 (en) | Memory mapping to enhance data cube performance | |
CN116225693A (zh) | 元数据管理方法、装置、计算机设备及存储介质 | |
US11586353B2 (en) | Optimized access to high-speed storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |