基于Ceph的小文件预取缓存算法
2020-09-29陆小霞



摘要:为解决Ceph系统在处理小文件时,由于小文件被频繁访问时,集群需要在多个存储节点之间不断查找文件,导致系统读取性能较低的问题,本文提出了一种基于Ceph的文件预取缓存算法。该算法通过引入权重衰减因子来动态计算缓存文件的权重,当小文件长时间未被访问时,该文件的权重会随之降低。若权重小于阈值时,该文件会从缓存中移除,这样可以减少缓存空间的浪费,提高缓存文件的命中率。实验结果表明,该方法与现有方法相比能明显提高小文件的访问效率。
关键词:ceph;小文件;预读取;缓存;权重因子
中图分类号:TP302 文献标识码:A
文章编号:1009-3044(2020)17-0225-03
Abstract: In order to solve the problem that when CEPH system processes small files, because of the frequent access of small files, the cluster needs to constantly search for files among multiple storage nodes, resulting in low system read performance, this paper proposes a file prefetch caching algorithm based on CEPH. In this algorithm, the weight of the cache file is calculated dynamically by introducing the weight attenuation factor. When the small file is not accessed for a long time, the weight of the file will be reduced. If the weight is less than the threshold value, the file will be removed from the cache, which can reduce the waste of cache space and improve the hit rate of the cache file. Experimental results show that this method can significantly improve the access efficiency of small files compared with the existing methods.
Key words: ceph; small file; prepare reading; cache; weight factor
Ceph[1,2]是一種基于对象存储的无中心化的分布式文件系统,由于采用了对象存储的方式,其数据处理过程高度并行化,Ceph系统能够通过添加普通服务器来扩大集群,可轻松将存储规模扩展至PB级。而CRUSH[5,6]作为Ceph集群的核心算法可以动态的计算出各个文件的存储位置,实现了文件元数据的服务器功能,使之成了一个即使出现单节点故障也能正常使用的存储系统。但Ceph系统在频繁读取小文件时,由于集群需要在多个存储节点之间不断查找文件,导致系统读取性能较低的问题[8]。
在小文件访问时,目前有两种方法可以提高小文件的访问效率。Zou Zhenyu[3]等人采用文件预取机制将文件预取至缓存中,减少用户与集群的直接交互,从而提高文件的访问效率;Cheng Wenjuan[4]等人提出一种索引机制,在文件合并时生成相应的索引文件,减少小文件的查找时间,可以提高小文件的访问效率。……
