计算机科学 ›› 2026, Vol. 53 ›› Issue (6): 203-213.doi: 10.11896/jsjkx.251000115

• 高性能计算 • 上一篇    下一篇

基于内存映射镜像的高性能集群缓存MMCache

刘中一1,2,3, 肖巍1, 张磊1,2, 阎松柏1,2, 黄向平1,3, 李梦箫1,3   

  1. 1 中国民航信息网络股份有限公司 北京 101318
    2 中国民用航空局民航旅客服务智能化应用技术重点实验室 北京 101318
    3 北京市民航大数据工程技术研究中心 北京 101318
  • 收稿日期:2025-10-27 修回日期:2025-12-17 出版日期:2026-06-15 发布日期:2026-06-09
  • 通讯作者: 肖巍(xiaowei@travelsky.com.cn)
  • 作者简介:(liuzy@travelsky.com.cn)
  • 基金资助:
    国家自然科学基金委2024年项目(U2433212);工信部大数据产业发展试点示范项目(工信厅信发函[2022]219号);工信部未来产业创新任务揭榜项目(工信厅科函[2024]220号)

MMCache:High-performance Cluster Cache with Memory-mapped Mirroring

LIU Zhongyi1,2,3, XIAO Wei1, ZHANG Lei1,2, YAN Songbai1,2, HUANG Xiangping1,3, LI Mengxiao1,3   

  1. 1 TravelSky Technology Limited,Beijing 101318,China
    2 Key Laboratory of Intelligent Passenger Service of Civil Aviation,Beijing 101318,China
    3 Beijing Engineering Research Center of Civil Aviation Big Data,Beijing 101318,China
  • Received:2025-10-27 Revised:2025-12-17 Published:2026-06-15 Online:2026-06-09
  • About author:LIU Zhongyi,born in 1987,master,is a member of CCF(No.T8746M).His main research interests include high performance computing,in-memory data grid and digital intelligence.
    XIAO Wei,born in 1970,master. His main research interests include real-time trading systems,civil aviation informatization and high performance distributed computing.
  • Supported by:
    National Natural Science Foundation of China(U2433212),Pilot Demonstration Project for Big Data Industry Development of the Ministry of Industry and Information Technology of China(MIIT Letter [2022] No.219) and Innovation Mission Project for Future Industry of the Ministry of Industry and Information Technology of China(MIIT Letter [2024] No.220).

摘要: 分布式系统在高性能场景下的应用日趋广泛,但其依赖的传统缓存框架面临复杂对象传输开销大、跨节点同步延迟高、数据存取效率不足等瓶颈。为此,提出一种高性能集群缓存框架 MMCache,核心创新包括:基于内存映射镜像的数据传输读写机制,通过虚拟地址固化实现跨进程零拷贝访问与结构级高效读取;使用冷却池驱动的缓存单元无锁更新机制,在不阻塞业务访问的前提下实现运行时状态的原子可见性与快速回收;面向内存地址空间的泛型分配管理框架,融合 TCMalloc 与泛型适配器以实现镜像内存的高效分配、回收与碎片抑制。测试结果表明,在300万key的多场景负载下,MMCache冷却池占比可控,事务成功率保持在99%以上且响应时间稳定;相比Redis和Memcached,在高频读写、复杂对象存储及集群同步性能方面均表现出显著优势。该技术已在民航运价交易后台系统中应用,展现了高性能、低延迟、强一致性等特性,并在电子商务、大数据处理等高性能数据处理场景中具有广阔的推广价值。

关键词: 内存映射镜像, 分布式集群缓存, 零拷贝访问, 复杂对象存储, 无锁化更新机制, 冷却池, 泛型分配器, 高性能缓存框架

Abstract: Applications of distributed systems in high-performance scenarios are becoming increasingly widespread.However,their reliance on traditional caching frameworks faces bottlenecks such as high overhead in complex object transmission,high synchronization latency across nodes,and inefficient data access and storage.To address these issues,this paper proposes MMCache,a high-performance cluster caching framework whose core innovations include:a memory-mapped mirroring data transfer and access mechanism,which leverages virtual address fixation to achieve cross-process zero-copy access and structure-level high-efficiency reads;a cooling pool-driven lock-free cache unit update mechanism,which ensures runtime state atomic visibility and rapid reclamation without blocking business access;and a generic memory allocation management framework for address space,which integrates TCMalloc with generic adapters to enable efficient allocation,reclamation,and fragmentation suppression of mirrored memory.Experimental results show that under multi-scenario workloads involving 3 million keys,MMCache maintains a controllable cooling pool occupancy ratio,achieves a transaction success rate above 99%,and sustains stable response times.Compared with Redis and Memcached,MMCache demonstrates significant advantages in high-frequency read/write operations,complex object storage,and cluster synchronization performance.The technology has been deployed in the back-end system for aviation fare transactions,showcasing high performance,low latency,and strong consistency,and has broad potential for application in high-performance data processing scenarios such as e-commerce and big data analytics.

Key words: Memory-mapped mirroring, Distributed cluster caching, Zero-copy access, Complex object storage, Lock-free update mechanism, Colling pool, Generic memory allocator, High-performance caching framework

中图分类号: 

  • TP391
[1]CARLSON J.Redis in Action [M].New York:Simon & Schus-ter,2013:126-134.
[2]FITZPATRICK B.Distributed caching with Memcached [J].Linux Journal,2004,2004(124):5.
[3]CHENG W,REN F,JIANG W,et al.Modeling and Analyzing Latency in the Memcached System [C]//Proceedings of 2017 IEEE 37th International Conference on Distributed Computing Systems(ICDCS).IEEE,2017:538-548.
[4]CHIDAMBARAM V,RAMAMURTHI D.Performance analysis of Memcached [EB/OL].http://citeseerx.ist.psu.edu/viewdoc/download.
[5]MERTZ J,NUNES I,DELLA TOFFOLA L,et al.Satisfying increasing performance requirements with caching at the application level [J].IEEE Software,2020,38(3):87-95.
[6]MERTZ J,NUNES I.A Qualitative Study of Application-Level Caching [J].IEEE Transactions on Software Engineering,2017,43(9):798-816.
[7]MARATHE V J,SELTZER M,BYAN S,et al.PersistentMemcached:Bringing Legacy Code to Byte-Addressable PersistentMemory [C]//Proceedings of the 9th USENIX Workshop on Hot Topics in Storage and File Systems(HotStorage'17).USENIX Association,2017.
[8]QIX C,HU H Q,WEI X,et al.High Performance Design for Redis with Fast Event-Driven RDMA RPCs [C]//Proceedings of the 25th International Conference on Database Systems for Advanced Applications(DASFAA 2020)Springer,2020:195-210.
[9]COSTA A J C.FLEEC:A Fast and Lock-Free ApplicationalCache [D].Lisboa:Universidade NOVA de Lisboa(Portugal),2023.
[10]COTRONEO D,NATELLA R,ROSIELLO S.Dependabilityevaluation of middleware technology for large-scale distributed caching [C]//2020 IEEE 31st International Symposium on Software Reliability Engineering(ISSRE).IEEE,2020:218-228.
[11]OLSON M A,BOSTIC K,SELTZER M I.Berkeley DB [C]//Proceedings of the USENIX Annual Technical Conference,FREENIX Track.USENIX Association,1999:183-191.
[12]HENRY G.Howard Chu on Lightning Memory-Mapped Database [J].IEEE Software,2019,36(6):83-87.
[13]WRIGHT C P,SPILLANE R,SIVATHANU G,et al.Exten-ding ACID semantics to the file system [J].ACM Transactions on Storage,2007,3(2):4-es.
[14]HUANG X P,PENG M T,YANG Y K.High performance inventory caching system based on memory-mapping files [J].Application of Electronic Technique,2020,46(7):113-117,126.
[15]LIANG H F,YANG Y,LIU Z Y.MMDB:A complex object-oriented high-performance database based on memory mapping [J].Computer Engineering & Design,2023,44(3):937-944.
[16]CUI Y L,PI D C.SQLmmdb:An Embedded Main Memory Database Management System [J].Information Technology Journal,2007,6(6):872-878.
[17]FAERBER F,KEMPER A,LARSON P A,et al.Main Memory Database Systems [J].Foundations and Trends in Databases,2017,8(1/2):1-130.
[18]HUANG X P,PENG M T,YANG Y K.Fast Reading Method of Complex Objects Based on Memory-Mapped Files [J].Computer Technology and Development,2020,30(3):82-87.
[19]LIANG H F,LIU Z Y,YANG Y.Architecture and Key Technologies of High-Performance Airfare Price and Shop System [J/OL].https://kns.cnki.net/kcms/detail/31.1260.tp.20240703.1142.002.html.
[20]YANG Y K,PENG M T,WANG W D.Design of Efficient and Reliable Data File Distribution Solution in Cluster [J].Compu-ter Technology and Development,2019,29(11):163-167.
[21]LIU Z Y,LI M X,LIN C,et al.Zynco:A distributed service framework supporting runtime state collaborative evolution [J/OL].https://link.cnki.net/urlid/51.1307.TP.20250925.1513.036.
[22]GHEMAWAT S,MENAGE P.Tcmalloc:Thread-Caching Malloc [EB/OL].(2009-01-01)[2018-06-14].http://goog-perftools.sourceforge.net/doc/tcmalloc.html.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!