计算机科学与探索 ›› 2023, Vol. 17 ›› Issue (5): 1201-1209.DOI: 10.3778/j.issn.1673-9418.2107032

• 数据库技术 • 上一篇    下一篇

面向两段锁并发控制的RDMA优化技术

李婧瑶,张倩,赵展浩,卢卫,张孝,杜小勇   

  1. 中国人民大学 信息学院,北京 100872
  • 出版日期:2023-05-01 发布日期:2023-05-01

RDMA Optimization Technology for Two-Phase Locking Concurrency Control

LI Jingyao, ZHANG Qian, ZHAO Zhanhao, LU Wei, ZHANG Xiao, DU Xiaoyong   

  1. School of Information, Renmin University of China, Beijing 100872, China
  • Online:2023-05-01 Published:2023-05-01

摘要: 分布式事务的性能优化是学术界和工业界的研究热点之一。基于两段锁的并发控制技术可以保证并发事务调度的正确性,目前广泛应用于主流的商用和开源分布式数据库中。然而,现有的研究结果表明,基于传统TCP/IP协议以及Share-Nothing架构的分布式事务处理技术,受制于事务调度器的CPU低利用率、事务调度器与存取节点的网络高延迟,分布式事务的性能瓶颈明显。针对上述两个问题,提出基于远程直接数据存取(RDMA)的两段锁(2PL)并发控制优化技术,利用RDMA的高带宽、低延时以及内核旁路(消除了TCP/IP协议栈所带来的CPU开销)特性,提升分布式事务的性能。主要贡献包括基于RDMA的网络通信算子重写与优化,利用RDMA单边施加、释放读写锁时的原子性保障。基于YCSB测试基准的实验结果表明:单边排他锁算法和单边读写锁算法分别在低、高冲突负载下具有相对优越性;引入RDMA的2PL并发控制,在高冲突负载下,NO WAIT和WAIT DIE两种模式最高可分别实现5.3倍和10.6倍的吞吐量提升。

关键词: 远程直接数据存取(RDMA), 两段锁(2PL), 分布式数据库, 并发控制

Abstract: Performance optimization of distributed transactions is one of the hottest topics in academic and industry community. Concurrency control technology based on two-phase locking can guarantee the correctness of concurrent transaction scheduling, thus it is widely implemented in mainstream commercial and open source distributed data-bases. However, existing works show that the performance bottleneck of distributed transaction processing tech-nology, based on traditional TCP/IP protocol and Share-Nothing architecture, comes from low CPU utilization of transaction scheduler and high network latency between transaction scheduler and storage nodes. To address the above two problems, an optimization technology of two-phase locking (2PL) concurrency control based on new hardware RDMA (remote direct memory access) is proposed to improve the performance of distributed transactions by using RDMA??s characteristics, e.g., high bandwidth, low latency and kernel bypass (eliminating the CPU overhead caused by TCP/IP protocol stack). The main technical contributions of this paper include the rewriting and opti-mization of network communication operators based on RDMA, and the atomicity guarantee when using RDMA one-sidedly to acquire and release read-write locks. Experimental results based on YCSB benchmark show that: one-sided mutex lock algorithm and one-sided mutex/shared lock algorithm have relative advantages under low and high contention workload respectively; 2PL concurrency control protocols with RDMA achieve up to 5.3x and 10.6x performance gain for NO WAIT and WAIT DIE respectively under high contention workload.

Key words: remote direct memory access (RDMA), two-phase locking (2PL), distributed database, concurrency control