An Analysis of Concurrency Control Protocols for In-Memory Databases with Ccbench

An Analysis of Concurrency Control Protocols for In-Memory Databases with Ccbench

An Analysis of Concurrency Control Protocols for In-Memory Databases with CCBench ∗ Takayuki Tanabe1, Takashi Hoshino2, Hideyuki Kawashima3, Osamu Tatebe4 1NAUTILUS Technologies, Inc., 2Cybozu Labs, Inc., 3Faculty of Environment and Information Studies, Keio University, 4Center for Computational Sciences, University of Tsukuba [email protected], [email protected], [email protected], [email protected] ABSTRACT 1. INTRODUCTION This paper presents yet another concurrency control analy- sis platform, CCBench. CCBench supports seven protocols 1.1 Motivation (Silo, TicToc, MOCC, Cicada, SI, SI with latch-free SSN, Transacting processing systems containing thousands of 2PL) and seven versatile optimization methods and enables CPU cores in a single server have been emulated [63], im- the configuration of seven workload parameters. We ana- plemented [33,57], and analyzed [14]. Along with these sys- lyzed the protocols and optimization methods using various tems, a variety of concurrency control protocols for a single workload parameters and a thread count of 224. Previous server [32,35,53,57,64] have been proposed in recent years studies focused on thread scalability and did not explore the for use in many-core architectures. These modern protocols space analyzed here. We classified the optimization methods use a variety of optimization methods, and their behaviors on the basis of three performance factors: CPU cache, delay depend on the workload characteristics (e.g., thread count, on conflict, and version lifetime. Analyses using CCBench skew, read ratio, cardinality, payload size, transaction size, and 224 threads, produced six insights. (I1) The perfor- and read-modify-write or not). Recent new proposal stud- mance of optimistic concurrency control protocol for a read- ies have compared these protocols with conventional ones only workload rapidly degrades as cardinality increases even [20,22,23,25,27,29,32,33,35,44,51,53,57,58,61,62,64,65], and without L3 cache misses. (I2) Silo can outperform TicToc recent analytical studies have compared the performance of for some write-intensive workloads by using invisible reads conventional protocols on a common platform [13,14,60,63]. optimization. (I3) The effectiveness of two approaches to These studies mostly evaluated protocol scalability. This coping with conflict (wait and no-wait) depends on the situ- paper acknowledges that modern protocols are scalable and ation. (I4) OCC reads the same record two or more times if focuses on other factors that contribute to performance on a concurrent transaction interruption occurs, which can im- a many-core environment. This type of analysis is novel to prove performance. (I5) Mixing different implementations is the best of our knowledge. inappropriate for deep analysis. (I6) Even a state-of-the-art Fairness is important in comparison. However, some re- garbage collection method cannot improve the performance cent studies were unable to perform such analysis fairly be- of multi-version protocols if there is a single long transaction cause they compared their new protocols with others using mixed into the workload. On the basis of I4, we defined the different platforms. For example, evaluations of ERMIA [32], read phase extension optimization in which an artificial de- mostly-optimistic concurrency control (MOCC) [57], and Ci- lay is added to the read phase. On the basis of I6, we defined cada [35] used two or three platforms. Experiments using a the aggressive garbage collection optimization in which even mix of platforms can produce only approximate results be- visible versions are collected. The code for CCBench and all cause the performance of protocols on a many-core architec- the data in this paper are available online at GitHub. ture depends greatly on the exploitation of the underlying PVLDB Reference Format: hardware. In such conditions, only the macroscopic eval- Takayuki Tanabe, Takashi Hoshino, Hideyuki Kawashima, Os- uations (i.e., scalability) can be conducted, and a detailed amu Tatebe. An Analysis of Concurrency Control Protocols for analysis is difficult. A single unified comparison platform is In-Memory Databases with CCBench. PVLDB, 13(13): 3531- needed to conduct a detailed analysis. 3544, 2020. For a fair comparison, a common analysis platform is nec- DOI: https://doi.org/10.14778/3424573.3424575 essary. It should provide shared core modules such as access ∗ Work done while at University of Tsukuba methods (concurrent index) and thread-local data structures (read and write sets) for any protocols. It should also pro- vide a variety of optimization methods to enable obtaining This work is licensed under the Creative Commons Attribution- a deep understanding of the protocols. Finally, the plat- NonCommercial-NoDerivatives 4.0 International License. To view a copy form should be publicly available for reproducing the exper- of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. For iments. Although there are several open-source platforms, any use beyond those covered by this license, obtain permission by emailing including DBx1000 [6], Peloton [8], and Cavalia [4], they do [email protected]. Copyright is held by the owner/author(s). Publication rights not provide certain modern protocols [35, 56, 57, 64]. Ap- licensed to the VLDB Endowment. puswamy et al. [13] evaluated concurrency control protocols Proceedings of the VLDB Endowment, Vol. 13, No. 13 ISSN 2150-8097. in four types of architecture using Trireme, which is not DOI: https://doi.org/10.14778/3424573.3424575 publicly available. 3531 1.2 Contributions 1.3 Organization The first contribution of this paper is CCBench:aplat- The rest of this paper is organized as follows. §2reviews form for fairly evaluating concurrency control protocols. The existing protocols. §3 discusses the fairness condition and protocols are two-phase locking (2PL), Silo, MOCC, TicToc, presents CCBench. §4 describes the reproduction of experi- snapshot isolation (SI), latch-free serial safety net (SSN), ments. §5 investigates the effect of cache. §6 investigates the and Cicada. CCBench supports seven versatile optimization effect of delay. §7 investigates the effect of version lifetime methods and two identified in this work (Table 1, §3.2). Op- management. §8 reviews related work, and §9 concludes this timization methods can thus be applied to non-original pro- paper and shows future directions. tocols. For example, the NoWait method [18] can be applied to Silo, the rapid garbage collection (GC) method [35] can be applied to multi-version protocols, and the AdaptiveBack- 2. PRELIMINARIES off optimization method [35] can be applied to all protocols. Fairness in analyzing protocols is achieved through shared 2.1 Concurrency Control Protocols modules including a workload generator, access methods The concurrency control protocols we analyzed are classi- (Masstree [7, 36]), local datasets (read/write sets), and a fied as (1) pessimistic (2PL [24]), (2) optimistic (Silo [53] and memory manager (mimalloc [11] and AssertiveVersionReuse TicToc [64]), (3) multi-version (SI [31] and ERMIA [32]), (4) presented in this paper). Evaluation of protocols under var- integration of optimistic and pessimistic (MOCC [57]), and ious conditions is enabled by providing of seven workload (5) integration of optimistic and multi-version (Cicada [35]). configuration parameters: skew, payload size, transaction size, cardinality, read ratio, read-modify-write (RMW) or Silo [53] is an OCC protocol that has influenced sub- not, and the number of worker threads. CCBench and all of sequent concurrency control protocols. For example, FOE- the data in this paper are available online at GitHub [5]. DUS [33] and MOCC [57] extend the commit protocol of The second contribution is an analysis of cache, delay, Silo. Silo selects the design of InvisibleReads [37] so that and version lifetime using 224 threads. We clarified it does not update the metadata during a read operation. the effects of the protocols on the performance factors by The invisible read process avoids cache-line conflicts, so it configuring the optimization methods and workload settings. provides scalability, as shown by Wang and Kimura [57]. As suggested elsewhere [63] and [33], the era of a thousand TicToc [64] is an OCC protocol based on timestamp or- cores is just around the corner, so conventional analytical dering with data-driven timestamp management. TicToc studies focused on evaluating thread scalability [28,60,63]. has a larger scheduling space than Silo, so it can commit In contrast, we performed all analyses with 224 threads on schedules where Silo cannot. TicToc provides three opti- 224 cores. mization methods. PreemptiveAbort initiates abort process- We first investigated the effects of the optimization meth- ing immediately if an abort is detected before write lock- ods related to cache. By determining that a centralized ing in the validation phase. NoWaitTT does not wait for counter increases cache-line conflicts and degrades perfor- lock release in the validation phase. It instead releases the mance, we gained two insights. I1: The performance of locks and retries the validation phase after a fixed dura- optimistic concurrency control (OCC) for a read-only work- tion of a wait without an abort. TimestampHistory expands load rapidly degrades as cardinality increases even without the scheduling space by recording the write timestamp of L3 cache misses (§5.2). I2: Silo outperforms TicToc for an older version so that some of the read

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us