状态机复制的垃圾回收开销
The Cost of Garbage Collection for State Machine Replication
AI总结:
本文针对基于状态机复制的云系统,通过用C++、Java、Rust、Go实现标准MultiPaxos复制内存键值存储并开展云环境对比实验,系统性研究了垃圾回收带来的性能与资源开销,为云系统的编程语言选择与设计提供参考。
摘要:
状态机复制(State Machine Replication,SMR)协议是众多分布式系统的核心支柱。由于可扩展性、成本效益等诸多优势,企业和初创公司越来越多地在云上构建分布式系统。企业在云上构建系统时面临的首要技术问题之一便是选择哪种编程语言。影响这一决策的众多因素中,关键一项是选择采用垃圾回收(Garbage Collection,GC)的语言(如Java、Go),还是采用手动内存管理的语言(如C++、Rust)。如今,企业出于开发便捷性的考虑,大多偏好带GC的语言,比如Go、Kotlin甚至Python;但天下没有免费的午餐:GC会消耗资源(内存与CPU)并影响性能(GC暂停会导致长尾延迟)。虽然有不少传闻称,从带GC的语言切换到手动内存管理语言后,云成本有所降低、长尾延迟得到改善,但迄今为止,尚无针对运行基于SMR的云系统时GC开销的系统性研究。\n本文研究了采用带GC语言编写的基于SMR的云系统的运行开销。为此,我们从零设计了一个标准SMR系统——一种基于MultiPaxos的复制内存键值存储——并分别用C++、Java、Rust和Go实现了该系统。我们在云上不同工作负载与资源约束条件下,对比了这些实现的性能与资源使用情况,并报告了实验结果。我们的发现对云系统的设计具有参考意义。
英文摘要:
State Machine Replication (SMR) protocols form the backbone of many distributed systems. Enterprises and startups increasingly build their distributed systems on the cloud due to its many advantages, such as scalability and cost-effectiveness. One of the first technical questions companies face when building a system on the cloud is which programming language to use. Among many factors that go into this decision is whether to use a language with garbage collection (GC), such as Java or Go, or a language with manual memory management, such as C++ or Rust. Today, companies predominantly prefer languages with GC, like Go, Kotlin, or even Python, due to ease of development; however, there is no free lunch: GC costs resources (memory and CPU) and performance (long tail latencies due to GC pauses). While there have been anecdotal reports of reduced cloud cost and improved tail latencies when switching from a language with GC to a language with manual memory management, so far, there has not been a systematic study of the GC overhead of running an SMR-based cloud system. This paper studies the overhead of running an SMR-based cloud system written in a language with GC. To this end, we design from scratch a canonical SMR system -- a MultiPaxos-based replicated in-memory key-value store -- and we implement it in C++, Java, Rust, and Go. We compare the performance and resource usage of these implementations when running on the cloud under different workloads and resource constraints and report our results. Our findings have implications for the design of cloud systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。