arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.29099cs.DB
收藏

One Ring to Shuffle Them All: 基于环形缓冲区的可扩展进程内数据重分布——Redpanda Oxla中的环形缓冲区洗牌

One Ring to Shuffle Them All: Scalable Intra-Process Data Redistribution with Ring-Buffer Shuffle in Redpanda Oxla

Redpanda(红熊猫)

Adam Szymański, Tyler Akidau

AI总结:

针对并行查询引擎中进程内数据重分布随核心数增加而扩展性差的问题,提出一种基于无锁原子槽获取的环形缓冲区流式洗牌设计,实现摊销O(1)同步开销和O(M)内存,并在Redpanda Oxla引擎中部署两年,生产查询验证其有效性。

摘要:

随着服务器CPU扩展到每个插槽数十甚至数百个核心,并行查询引擎必须重新考虑线程间的数据重分布方式。哈希连接和聚合等分区操作需要频繁的跨线程数据重分布,然而现有的进程内洗牌设计从根本上无法随核心数扩展:批处理分区避免了热路径上的跨线程同步,但物化了所有中间数据,引入了全局生产者/消费者屏障,并需要缓存局部性低的消费方式;而基于通道的流式处理避免了物化,但引入了随核心数扩展性差的每通道同步。随着核心数增加,这些架构权衡日益阻碍引擎充分利用现代硬件。 我们提出了一种环形缓冲区流式洗牌设计,通过无锁原子槽获取固定大小的批组,解决了这些缺陷,实现了摊销O(1)的每批同步成本和与输入大小无关的O(M)内存。环形缓冲区洗牌已在Redpanda的Oxla查询引擎中部署两年,目前为Redpanda SQL用户的生产查询提供支持。 我们在72核NVIDIA GraceHopper、192核双插槽AWS Graviton4和96核(192线程)AMD EPYC上评估了所有三种方法。在72核单插槽系统上,环形缓冲区比通道流式处理性能提升高达44%,比批处理分区提升高达79%;在192核上,相对于通道的优势超过100%,相对于批处理分区超过300%。尽管如此,在具有许多分区L3缓存的芯片架构上,共享原子计数器成为跨芯片瓶颈,通道流式处理仍具竞争力。在TPC-H(21个查询)和ClickBench(43个查询)上的端到端Graviton4评估显示,优势取决于工作负载形状。

英文摘要:

As server CPUs scale to dozens and now hundreds of cores per socket, parallel query engines must rethink how they redistribute data between threads. Partitioned operators such as hash joins and aggregations require frequent data redistribution across threads, yet existing intra-process shuffle designs fundamentally fail to scale with core count: batch partitioning avoids cross-thread synchronization in the hot path but materializes all intermediate data, introduces a global producer/consumer barrier, and requires a consumption approach with low cache locality, while channel-based streaming avoids materialization but incurs per-channel synchronization that scales poorly with core count. As core counts rise, these architectural tradeoffs increasingly prevent engines from fully utilizing modern hardware. We present a ring-buffer streaming shuffle design that addresses these shortcomings through lock-free atomic slot acquisition into fixed-size batch groups, achieving amortized O(1) synchronization cost per batch and O(M) memory independent of input size. Ring-buffer shuffle has been implemented in Redpanda's Oxla query engine for two years, where it currently powers production queries for Redpanda SQL users. We evaluate all three approaches on a 72-core NVIDIA GraceHopper, a 192-core dual-socket AWS Graviton4, and a 96-core (192-thread) AMD EPYC. On a 72-core single-socket system the ring buffer outperforms channel streaming by up to 44% and batch partitioning by up to 79%; at 192 cores the advantage over channel grows to over 100% and over 300% versus batch partitioning. Even so, on chiplet architectures with many partitioned L3 caches, the shared atomic counter becomes a cross-die bottleneck and channel-based streaming remains competitive. End-to-end Graviton4 evaluation on TPC-H (21 queries) and ClickBench (43 queries) shows the advantage is workload-shape-dependent.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑