Async-fork: Mitigating Query Latency Spikes Incurred by the Fork-based Snapshot Mechanism from the OS Level
Pu Pang, Gang Deng, Kaihao Bai, Quan Chen, Shixuan Sun, Bo Liu, Yu Xu, Hongbo Yao, Zhengheng Wang, Xiyu Wang, Zheng Liu, Zhuo Song
Abstract
In-memory key-value stores (IMKVSes) serve many online applications because of their efficiency. To support data backup, popular industrial IMKVSes periodically take a point-in-time snapshot of the in-memory data with the system call fork. However, this mechanism can result in latency spikes for queries arriving during the snapshot period because fork leads the engine into the kernel mode in which the engine is out-of-service for queries. In contrast to existing research focusing on optimizing snapshot algorithms, we optimize the fork operation to address the latency spikes problem from the operating system (OS) level, while keeping the data persistent mechanism in IMKVSes unchanged. Specifically, we first conduct an in-depth study to reveal the impact of the fork operation as well as the optimization techniques on query latency. Based on findings in the study, we propose Async-fork to offload the work of copying the page table from the engine (the parent process) to the child process as copying the page table dominates the execution time of fork. To keep data consistent between the parent and the child, we design the proactive synchronization strategy. Async-fork is implemented in the Linux kernel and deployed into the online Redis database in public clouds. Our experiment results show that compared with the default fork method in OS, Async-fork reduces the tail latency of queries arriving during the snapshot period by 81.76% on an 8GB instance and 99.84% on a 64GB instance.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext eabba371-3a7b-44c7-8a03-736db42c91dcCited by top-tier papers3
- BUDAlloc: Defeating Use-After-Free Bugs by Decoupling Virtual Address Management from KernelJunho Ahn, Jaehyeon Lee, Kanghyuk Lee, Wooseok Gwak et al.USENIX Security 2024 · 6 citations
- Practical DB-OS Co-Design with Privileged Kernel BypassXinjing Zhou, Viktor Leis, Jinming Hu, Xiangyao Yu et al.SIGMOD 2025 · 4 citations
- The Case for DBMS Live PatchingMichael Fruth, Stefanie ScherzingerVLDB 2024 · 2 citations
Builds on2
- Mitosis: Transparently Self-Replicating Page-Tables for Large-Memory MachinesReto Achermann, Ashish Panwar, Abhishek Bhattacharjee, Timothy Roscoe et al.ASPLOS 2020 · 62 citations
- Fast local page-tables for virtualized NUMA servers with vMitosisAshish Panwar, Reto Achermann, Arkaprava Basu, Abhishek Bhattacharjee et al.ASPLOS 2021 · 29 citations
Related papers
- On-demand-fork: a microsecond fork for memory-intensive and latency-sensitive applicationsKaiyang Zhao, Sishuai Gong, Pedro FonsecaEuroSys 2021 · 25 citations
- μFork: Supporting POSIX fork Within a Single-Address-Space OSJohn Alistair Kressel, Hugo Lefeuvre, Pierre OlivierSOSP 2025
- Enabling Low Tail Latency on Multicore Key-Value StoresLucas Lersch, Ivan Schreter, Ismail Oukid, Wolfgang LehnerVLDB 2020 · 30 citations
- How to Copy Memory? Coordinated Asynchronous Copy as a First-Class OS ServiceJingkai He, Yunpeng Dong, Dong Du, Mo Zou et al.SOSP 2025 · 2 citations
- TreeSLS: A Whole-system Persistent Microkernel with Tree-structured State Checkpoint on NVMFangnuo Wu, Mingkai Dong, Gequan Mo, Haibo ChenSOSP 2023 · 10 citations
