一句话:首次对 Google 生产集群的 TCMalloc 做仓库级特征分析,并据此逐层优化其缓存结构,使全集群吞吐提升 1.4%、内存占用降低 3.4%。
论文指出内存分配是仓库级计算的重要开销来源,优化分配器既能降低数据中心税,也能提升应用性能。作者对 Google 生产集群中广泛使用的 TCMalloc 进行了首个全面的特征刻画研究,发现大规模数据中心工作负载在分配模式、对象大小与生命周期上存在极大的多样性,且在不同异构硬件平台上的表现差异显著。基于这些观察,作者针对 TCMalloc 缓存层级的每一层提出优化:基于使用情况动态调整分配器缓存大小、利用硬件拓扑缓解核间通信开销、依据统计数据改进分配打包算法。评估采用基准测试与全集群生产 A/B 实验相结合的方式,结果显示整个集群吞吐提升 1.4%、RAM 使用减少 3.4%;对内存分配最密集的应用,吞吐与内存改善分别可达 8.1% 和 6.3%。
Memory allocation constitutes a substantial component of warehouse-scale computation. Optimizing the memory allocator not only reduces the datacenter tax, but also improves application performance, leading to significant cost savings. We present the first comprehensive characterization study of TCMalloc, a memory allocator used by warehouse-scale applications in Google's production fleet. Our characterization reveals a profound diversity in the memory allocation patterns, allocated object sizes and lifetimes, for large-scale datacenter workloads, as well as in their performance on heterogeneous hardware platforms. Based on these insights, we optimize TCMalloc for warehouse-scale environments. Specifically, we propose optimizations for each level of its cache hierarchy that include usage-based dynamic sizing of allocator caches, leveraging hardware topology to mitigate inter-core communication overhead, and improving allocation packing algorithms based on statistical data. We evaluate these design choices using benchmarks and fleet-wide A/B experiments in our production fleet, resulting in a 1.4% improvement in throughput and a 3.4% reduction in RAM usage for the entire fleet. For the applications with the highest memory allocation usage, we observe up to 8.1% and 6.3% improvement in throughput and memory usage respectively. At our scale, even a single percent CPU or memory improvement translates to significant savings in server costs.
@inproceedings{ZhouGVK0KMDR24,
title = {Characterizing a Memory Allocator at Warehouse Scale},
author = {Zhuangzhuang Zhou and Vaibhav Gogte and Nilay Vaish and Chris Kennelly and Patrick Xia and Svilen Kanev and Tipp Moseley and Christina Delimitrou and Parthasarathy Ranganathan},
booktitle = {ASPLOS},
year = {2024},
doi = {10.1145/3620666.3651350}
}