Movatterモバイル変換


[0]ホーム

URL:


CN111026681A - Caching method, caching system and caching medium based on Ceph - Google Patents

Caching method, caching system and caching medium based on Ceph
Download PDF

Info

Publication number
CN111026681A
CN111026681ACN201911047928.4ACN201911047928ACN111026681ACN 111026681 ACN111026681 ACN 111026681ACN 201911047928 ACN201911047928 ACN 201911047928ACN 111026681 ACN111026681 ACN 111026681A
Authority
CN
China
Prior art keywords
solid state
ceph
state disk
data
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.)
Pending
Application number
CN201911047928.4A
Other languages
Chinese (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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
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 Fiberhome Telecommunication Technologies Co LtdfiledCriticalFiberhome Telecommunication Technologies Co Ltd
Priority to CN201911047928.4ApriorityCriticalpatent/CN111026681A/en
Publication of CN111026681ApublicationCriticalpatent/CN111026681A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a caching method, a caching system and a caching medium based on Ceph. The method comprises the following steps: writing data generated by a client into a solid state disk; the data stored on the solid state disk is printed back into the Ceph according to a preset rule; and judging whether the data to be read by the client is stored on the solid state disk, if so, accessing the solid state disk to read the data, and if not, accessing the Ceph to read the data. The invention has high data reliability and small risk of data loss.

Description

Caching method, caching system and caching medium based on Ceph
Technical Field
The invention belongs to the technical field of cloud computing, and particularly relates to a caching method, a caching system and a caching medium based on Ceph.
Background
Ceph is a storage system platform that focuses on distributed, elastically scalable, highly reliable, and excellent performance, and can be used to provide a block storage scheme for virtual machines or a conventional file system through FUSEs. Ceph is a highly configurable system that an administrator can control various aspects of the system. It provides a command line interface for monitoring and controlling its storage clusters. In the prior art, as shown in fig. 1, a client accesses a Ceph, and generally uses a memory implemented by the Ceph to cache data, and a client reads and writes data to the memory first, so that the memory temporarily stores data of a certain volume, and after the data in the memory meets a condition of writing in the Ceph, the data in the memory is written in the Ceph. However, caching data with memory poses a serious risk: 1) the memory is a volatile memory, and when the client is abnormal, the data stored in the memory can be lost, for example, the data in the memory cached by Ceph is lost due to sudden power failure of a machine, program abnormality and the like; 2) the memory resource is limited, and the requirement of concurrent client access cannot be met; 3) the machine restarts and cannot access the previously cached data.
Disclosure of Invention
In view of at least one of the defects or improvement requirements of the prior art, the present invention provides a caching method, system and storage medium based on Ceph, and aims to solve the problem in the prior art that data is easily lost.
To achieve the above object, according to a first aspect of the present invention, there is provided a Ceph-based caching method, including the steps of:
writing data generated by a client into a solid state disk;
the data stored on the solid state disk is printed back into the Ceph according to a preset rule;
and judging whether the data to be read by the client is stored on the solid state disk, if so, accessing the solid state disk to read the data, and if not, accessing the Ceph to read the data.
Preferably, the rule is:
and determining whether to refresh the data stored on the solid state disk into the Ceph according to the comparison between the time when the data on the solid state disk is not accessed and the preset time.
Preferably, the rule is:
and determining whether to refresh the data stored on the solid state disk into the Ceph according to the comparison of the ratio of the cache data amount on the solid state disk to the total capacity of the solid state disk and a preset ratio.
Preferably, the data on the solid state disk is directly flushed back to the Ceph in an FIFO manner.
Preferably, the data which is not accessed in the solid state disk hot chain for more than the preset time is moved to the solid state disk cold chain by adopting an LRU mode, and the data which is not accessed in the solid state disk cold chain for more than the preset time is printed back to the Ceph.
According to a second aspect of the present invention, there is provided a Ceph-based cache system, comprising:
the solid state disk is used for writing data generated by the client into the solid state disk;
the Ceph is used for refreshing the data stored on the solid state disk to the Ceph according to a preset rule;
and the cache management unit is used for judging whether the data to be read by the client is stored on the solid state disk, if so, accessing the solid state disk to read the data, and if not, accessing the Ceph to read the data.
According to a third aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
In general, compared with the prior art, the above technical solution contemplated by the present invention can achieve the following beneficial effects: 1) when the client is abnormal, the data stored in the memory cannot be lost; 2) the machine is restarted, and the previously cached data can be accessed; 3) the client can be highly concurrent under the condition of starting the cache; 4) the capacity of the solid state disk is larger than that of the memory, and the solid state disk has price advantage and can be used in a large scale.
Drawings
FIG. 1 is a diagram of a prior art Ceph cache system;
fig. 2 is a schematic diagram of a Ceph cache system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
According to the caching method, the caching system and the caching medium based on the Ceph, cached data are stored on the solid state disk which is the nonvolatile memory, so that the data cached on the nonvolatile memory cannot be lost even if the power is off, and the storage speed of the solid state disks such as the SSD and the NMVE is high, so that the data accessing speed of a user can be improved.
As shown in fig. 2, a cache system based on Ceph according to an embodiment of the present invention includes:
the solid state disk is used for caching the data generated by the client to the solid state disk;
the Ceph is used for refreshing the data stored on the solid state disk to the Ceph according to a preset rule;
and the cache management unit is responsible for managing cache data and judging whether the data to be read by the client is stored on the solid state disk, if so, accessing the solid state disk to read the data, and if not, directly accessing the Ceph to read the data.
The caching method based on the Ceph comprises the following steps:
s1, when caching data, the client writes the data generated by the client into the solid state disk;
and S2, and then, the data stored on the solid state disk is flushed back to Ceph according to a preset rule.
There are two kinds of back-brushing strategies:
(1) time strategy
The time for which the swap-out operation is required to be performed when the data is not accessed in the solid state disk cache for a long time can be dynamically set by configuration parameters, and the default time is 10 minutes.
After the back-flushing interface is called, the code prepares to flush back to a Ceph data mode by judging whether each cache data block has data which is not accessed for more than 10 minutes, and the following two modes exist:
in FIFO mode, data is flushed back directly to Ceph. FIFO is to brush back data according to the rule of first-in first-out.
In the LRU approach, data in the solid state disk hot chain that was not accessed for more than 10 minutes will be moved to the solid state disk cold chain, and data in the solid state disk cold chain that was not accessed for more than 10 minutes will be flushed back to Ceph. LRU flushes data back according to the least recently used rule.
(2) Spatial strategy
The threshold value of the ratio of the cache data volume to the total capacity of the solid state disk can be dynamically set by parameters, and the default value is 20%.
When the refresh interface is called, whether the ratio is reached is judged to determine whether the data block needs to be refreshed to Ceph.
And S3, when the client reads the data, judging whether the data to be read by the client is stored on the solid state disk, if so, accessing the solid state disk to read the data, and if not, directly accessing the Ceph to read the data.
Compared with the prior art in which a memory is used for storing cache data, the cache method, the cache system and the storage medium based on the Ceph provided by the invention have the following advantages: 1) when the client is abnormal, the data stored in the memory cannot be lost; 2) the machine is restarted, and the previously cached data can be accessed; 3) the client can be highly concurrent under the condition of starting the cache; 4) the capacity of the solid state disk is larger than that of the memory, and the solid state disk has price advantage and can be used in a large scale.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement any of the technical solutions of the above embodiments of the Ceph-based caching method. The implementation principle and the technical effect are similar, and the detailed description is omitted here.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

CN201911047928.4A2019-10-302019-10-30Caching method, caching system and caching medium based on CephPendingCN111026681A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911047928.4ACN111026681A (en)2019-10-302019-10-30Caching method, caching system and caching medium based on Ceph

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911047928.4ACN111026681A (en)2019-10-302019-10-30Caching method, caching system and caching medium based on Ceph

Publications (1)

Publication NumberPublication Date
CN111026681Atrue CN111026681A (en)2020-04-17

Family

ID=70205819

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911047928.4APendingCN111026681A (en)2019-10-302019-10-30Caching method, caching system and caching medium based on Ceph

Country Status (1)

CountryLink
CN (1)CN111026681A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112764690A (en)*2021-02-032021-05-07北京同有飞骥科技股份有限公司Distributed storage system

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104572491A (en)*2014-12-302015-04-29华为技术有限公司Read cache management method and device based on solid-state drive (SSD)
US20150254003A1 (en)*2014-03-102015-09-10Futurewei Technologies, Inc.Rdma-ssd dual-port unified memory and network controller
CN108628765A (en)*2018-04-132018-10-09新华三技术有限公司Cache implementation methods and device in distributed storage of increasing income software Ceph
CN109800185A (en)*2018-12-292019-05-24上海霄云信息科技有限公司A kind of data cache method in data-storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20150254003A1 (en)*2014-03-102015-09-10Futurewei Technologies, Inc.Rdma-ssd dual-port unified memory and network controller
CN104572491A (en)*2014-12-302015-04-29华为技术有限公司Read cache management method and device based on solid-state drive (SSD)
CN108628765A (en)*2018-04-132018-10-09新华三技术有限公司Cache implementation methods and device in distributed storage of increasing income software Ceph
CN109800185A (en)*2018-12-292019-05-24上海霄云信息科技有限公司A kind of data cache method in data-storage system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SKDKJZZ: "ceph存储 缓存淘汰算法--LRU算法", 《HTTPS://BLOG.CSDN.NET/SKDKJZZ/ARTICLE/DETAILS/51243624》*
WEIXIN_34375233: "ceph的数据存储之路(12)----- cache tier", 《HTTPS://BLOG.CSDN.NET/WEIXIN_34375233/ARTICLE/DETAILS/92297024》*
YELIANG WU: "【ceph的通用解决方案】-如何将ssd作为hdd的缓存池", 《HTTPS://BLOG.CSDN.NET/WYLFENGYUJIANCHENG/ARTICLE/DETAILS/88305702》*
楼下小黑哥: "聊聊缓存淘汰算法-LRU 实现原理", 《HTTPS://WWW.CNBLOGS.COM/GOODANDYXUBLOG/P/11757134.HTML》*

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112764690A (en)*2021-02-032021-05-07北京同有飞骥科技股份有限公司Distributed storage system

Similar Documents

PublicationPublication DateTitle
US20140006687A1 (en)Data Cache Apparatus, Data Storage System and Method
CN103257701B (en)The technology of the information being buffered is retained under low-power consumption mode
US20200264980A1 (en)Apparatus and method of handling caching of persistent data
CN102521147B (en)Management method by using rapid non-volatile medium as cache
KR101612922B1 (en)Memory system and method of managing memory system
JP4808275B2 (en) Network boot system
US9208101B2 (en)Virtual NAND capacity extension in a hybrid drive
CN103514112B (en)A kind of date storage method and system
CN110413211B (en)Storage management method, electronic device, and computer-readable medium
KR101472967B1 (en)Cache memory and method capable of write-back operation, and system having the same
US20170004087A1 (en)Adaptive cache management method according to access characteristics of user application in distributed environment
CN111258967A (en)Data reading method and device in file system and computer readable storage medium
US20160283387A1 (en)Dynamic caching method and system for data storage system
KR20200040294A (en) Preemptive cache backlog with transaction support
CN116737613A (en)Mapping table management method and memory
US20120047387A1 (en)Cache control device and cache control method
US20120047330A1 (en)I/o efficiency of persistent caches in a storage system
CN113867641B (en)Host memory buffer management method and device and solid state disk
US8732404B2 (en)Method and apparatus for managing buffer cache to perform page replacement by using reference time information regarding time at which page is referred to
CN111026681A (en)Caching method, caching system and caching medium based on Ceph
US20140195571A1 (en)Fast new file creation cache
US20120017048A1 (en)Inter-frame texel cache
CN104808967A (en)Dynamic data prefetching system of processor
CN115599592A (en)Memory mirroring method and computing device
EP4033346B1 (en)Affinity-based cache operation for a persistent storage device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20200417

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp