计算机科学与探索 ›› 2021, Vol. 15 ›› Issue (2): 249-260.DOI: 10.3778/j.issn.1673-9418.2003025

• 学术研究 • 上一篇    下一篇

基于镜像层关联的Docker注册表缓存预取策略

张晨,邓玉辉   

  1. 1. 暨南大学 信息科学技术学院 计算机科学系,广州 510632
    2. 中国科学院 计算技术研究所 计算机体系结构国家重点实验室,北京 100190
  • 出版日期:2021-02-01 发布日期:2021-02-01

Cache Prefetching Strategy Based on Correlation of Image Layers in Docker Registry

ZHANG Chen, DENG Yuhui   

  1. 1. Department of Computer Science, College of Information Science and Technology, Jinan University, Guangzhou 510632, China
    2. State Key Laboratory of Computer Architecture, Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China
  • Online:2021-02-01 Published:2021-02-01

摘要:

随着容器技术的广泛普及,大型Docker公共注册表使用对象存储服务来解决镜像数量剧增的问题,但这种松耦合的注册表设计导致较高的延迟开销。为了增强注册表性能,提出一种基于镜像层关联的Docker注册表缓存预取策略LCPA,当注册表服务器缓存未命中时,通过分析镜像元数据文件构建镜像的存储结构,由关联度模型对存储结构计算得到相关镜像层集合,并从后端存储中主动式预取回注册表中以提高缓存命中率。经真实工作负载下收集的Docker数据集测试,实验结果表明LCPA策略比LRU、LIRS和GDFS等缓存算法提高12%~29%的平均缓存命中率,拉取镜像的平均延迟节省率提高了21.1%~49.4%。与现有的LPA预取算法相比,拉取镜像的平均缓存命中率提升25.6%。仿真实验表明该策略可以有效地利用缓存空间,大幅提升注册表的缓存命中率,并降低镜像拉取的延迟开销。

关键词: 公共注册表, 关联度模型, 缓存命中率, 主动式预取

Abstract:

With the popularization of container technology, large-scale Docker public registries use object storage services to solve the problem of the sharp increasement in the number of images, but this loosely coupled registry design results in higher latency overhead. A cache prefetching strategy named LCPA (layer correlation prefetch algorithm) is proposed based on the correlation of image layers to enhance registry performance. When the registry server cache misses, LCPA creates the storage structure of layer by analyzing image metadata and calculates it by the correlation model to obtain the set of relevant layers. Finally, the registry actively prefetches the set from the back-end storage to the memory to improve the cache hit ratio. Experiment uses the Docker trace collected in real production workloads to test algorithm. The results show that LCPA outperforms the traditional cache algorithms, such as LRU, LIRS and GDFS etc., improves the average cache hit ratio by 12%-29% and increases the average latency saving by 21.1%-49.4%. Compared with the existing LPA prefetching algorithm, LCPA improves the cache hit ratio by 25.6%. Simulation experiments show that LCPA can effectively utilize the cache, greatly improves the cache hit ratio of Docker registry, and reduces the latency overhead of pulling images.

Key words: public registry, association model, cache hit ratio, actively prefetch