Phase Reconciliation for Contended In-Memory Transactions Neha Narula, Cody Cutler, Eddie Kohler, Robert Morris MIT CSAIL and Harvard 1.

Slides:



Advertisements
Similar presentations
Wyatt Lloyd * Michael J. Freedman * Michael Kaminsky David G. Andersen * Princeton, Intel Labs, CMU Dont Settle for Eventual : Scalable Causal Consistency.
Advertisements

Serializability in Multidatabases Ramon Lawrence Dept. of Computer Science
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Transaction chains: achieving serializability with low-latency in geo-distributed storage systems Yang Zhang Russell Power Siyuan Zhou Yair Sovran *Marcos.
Piccolo: Building fast distributed programs with partitioned tables Russell Power Jinyang Li New York University.
Concurrency Control II
LIBRA: Lightweight Data Skew Mitigation in MapReduce
Scalable Multi-Cache Simulation Using GPUs Michael Moeng Sangyeun Cho Rami Melhem University of Pittsburgh.
Exploiting Distributed Version Concurrency in a Transactional Memory Cluster Kaloian Manassiev, Madalin Mihailescu and Cristiana Amza University of Toronto,
Helper Threads via Virtual Multithreading on an experimental Itanium 2 processor platform. Perry H Wang et. Al.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
Lock-free Cuckoo Hashing Nhan Nguyen & Philippas Tsigas ICDCS 2014 Distributed Computing and Systems Chalmers University of Technology Gothenburg, Sweden.
Scaling Distributed Machine Learning with the BASED ON THE PAPER AND PRESENTATION: SCALING DISTRIBUTED MACHINE LEARNING WITH THE PARAMETER SERVER – GOOGLE,
Concurrency Control and Recovery In real life: users access the database concurrently, and systems crash. Concurrent access to the database also improves.
Distributed Systems 2006 Styles of Client/Server Computing.
Concurrency control using transactions 1Transactions.
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Transaction Management
Phase Reconciliation for Contended In-Memory Transactions Neha Narula, Cody Cutler, Eddie Kohler, Robert Morris MIT CSAIL and Harvard.
Everest: scaling down peak loads through I/O off-loading D. Narayanan, A. Donnelly, E. Thereska, S. Elnikety, A. Rowstron Microsoft Research Cambridge,
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management and Concurrency Control
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Optimizing RAM-latency Dominated Applications
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Accelerating SQL Database Operations on a GPU with CUDA Peter Bakkum & Kevin Skadron The University of Virginia GPGPU-3 Presentation March 14, 2010.
Silo: Speedy Transactions in Multicore In-Memory Databases
Some key-value stores using log-structure Zhichao Liang LevelDB Riak.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
Architectural Support for Fine-Grained Parallelism on Multi-core Architectures Sanjeev Kumar, Corporate Technology Group, Intel Corporation Christopher.
1 Concurrency Control II: Locking and Isolation Levels.
CHAN Siu Lung, Daniel CHAN Wai Kin, Ken CHOW Chin Hung, Victor KOON Ping Yin, Bob SPRINT: A Scalable Parallel Classifier for Data Mining.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
Consider the program fragment below left. Assume that the program containing this fragment executes t1() and t2() on separate threads running on separate.
1 Multiversion Reconciliation for Mobile Databases Shirish Hemanath Phatak & B.R.Badrinath Presented By Presented By Md. Abdur Rahman Md. Abdur Rahman.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Scale up Vs. Scale out in Cloud Storage and Graph Processing Systems
DynamicMR: A Dynamic Slot Allocation Optimization Framework for MapReduce Clusters Nanyang Technological University Shanjiang Tang, Bu-Sung Lee, Bingsheng.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
1 Adaptive Parallelism for Web Search Myeongjae Jeon Rice University In collaboration with Yuxiong He (MSR), Sameh Elnikety (MSR), Alan L. Cox (Rice),
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Bigtable: A Distributed Storage System for Structured Data
SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by :
Distributed Computing Systems CSCI 6900/4900. Review Definition & characteristics of distributed systems Distributed system organization Design goals.
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
The Scalable Commutativity Rule: Designing Scalable Software for Multicore Processors Austin T. Clements, M. Frans Kaashoek, Nickolai Zeldovich, Robert.
Page 1 2P13 Week 1. Page 2 Page 3 Page 4 Page 5.
Tool Support for Testing Classify different types of test tools according to their purpose Explain the benefits of using test tools.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Kendo: Efficient Deterministic Multithreading in Software M. Olszewski, J. Ansel, S. Amarasinghe MIT to be presented in ASPLOS 2009 slides by Evangelos.
Hathi: Durable Transactions for Memory using Flash
Transaction Management and Concurrency Control
Faster Data Structures in Transactional Memory using Three Paths
Scaling a file system to many cores using an operation log
The SNOW Theorem and Latency-Optimal Read-Only Transactions
Building a Database on S3
Chapter 10 Transaction Management and Concurrency Control
Degree-aware Hybrid Graph Traversal on FPGA-HMC Platform
Fundamentals of Databases
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Transactions and Concurrency
Data Warehousing Concepts
Presentation transcript:

Phase Reconciliation for Contended In-Memory Transactions Neha Narula, Cody Cutler, Eddie Kohler, Robert Morris MIT CSAIL and Harvard 1

IncrTxn(k Key) { INCR(k, 1) } LikePageTxn(page Key, user Key) { INCR(page, 1) liked_pages := GET(user) PUT(user, liked_pages + page) } FriendTxn(u1 Key, u2 Key) { PUT(friend:u1:u2, 1) PUT(friend:u2:u1, 1) } 2

IncrTxn(k Key) { INCR(k, 1) } LikePageTxn(page Key, user Key) { INCR(page, 1) liked_pages := GET(user) PUT(user, liked_pages + page) } FriendTxn(u1 Key, u2 Key) { PUT(friend:u1:u2, 1) PUT(friend:u2:u1, 1) } 3

Applications experience write contention on popular data 4 Problem

5

Concurrency Control Enforces Serial Execution core 0 core 1 core 2 INCR(x,1) 6 time Transactions on the same records execute one at a time

Throughput on a Contentious Transactional Workload 7

8

INCR on the Same Records Can Execute in Parallel core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) INCR(x 2,1) 9 time Transactions on the same record can proceed in parallel on per-core slices and be reconciled later This is correct because INCR commutes per-core slices of record x x is split across cores

Databases Must Support General Purpose Transactions IncrTxn(k Key) { INCR(k, 1) } PutMaxTxn(k1 Key, k2 Key) { v1 := GET(k1) v2 := GET(k2) if v1 > v2: PUT(k1, v2) else: PUT(k2, v1) return v1,v2 } 10 IncrPutTxn(k1 Key, k2 Key, v Value) { INCR(k1, 1) PUT(k2, v) } Must happen atomically Returns a value

Challenge Fast, general-purpose serializable transaction execution with per-core slices for contended records 11

Phase Reconciliation Database automatically detects contention to split a record among cores Database cycles through phases: split, reconciliation, and joined 12 reconciliation Joined Phase Split Phase Doppel, an in-memory transactional database

Contributions Phase reconciliation –Splittable operations –Efficient detection and response to contention on individual records –Reordering of split transactions and reads to reduce conflict –Fast reconciliation of split values 13

Outline 1.Phase reconciliation 2.Operations 3.Detecting contention 4.Performance evaluation 14

Split Phase core 0 core 1 core 2 INCR(x,1) INCR(x,1) PUT(y,2) INCR(x,1) PUT(z,1) 15 core 3 INCR(x,1) PUT(y,2) core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) PUT(y,2) INCR(x 2,1) PUT(z,1) core 3 INCR(x 3,1) PUT(y,2) The split phase transforms operations on contended records (x) into operations on per-core slices (x 0, x 1, x 2, x 3 ) split phase

Transactions can operate on split and non-split records Rest of the records use OCC (y, z) OCC ensures serializability for the non-split parts of the transaction 16 core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) PUT(y,2) INCR(x 2,1) PUT(z,1) core 3 INCR(x 3,1) PUT(y,2) split phase

Split records have assigned operations for a given split phase Cannot correctly process a read of x in the current state Stash transaction to execute after reconciliation 17 core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) PUT(y,2) INCR(x 2,1) PUT(z,1) core 3 INCR(x 3,1) PUT(y,2) split phase INCR(x 1,1) INCR(x 2,1) INCR(x 1,1) GET(x)

18 core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) PUT(y,2) INCR(x 2,1) PUT(z,1) core 3 INCR(x 3,1) PUT(y,2) reconcile split phase All threads hear they should reconcile their per-core state Stop processing per-core writes GET(x) INCR(x 1,1) INCR(x 2,1) INCR(x 1,1)

Reconcile state to global store Wait until all threads have finished reconciliation Resume stashed read transactions in joined phase 19 core 0 core 1 core 2 core 3 All done reconcile reconciliation phasejoined phase x = x + x 0 x = x + x 1 x = x + x 2 x = x + x 3 GET(x)

20 core 0 core 1 core 2 core 3 x = x + x 0 x = x + x 1 x = x + x 2 x = x + x 3 reconcile reconciliation phase GET(x) All done joined phase Reconcile state to global store Wait until all threads have finished reconciliation Resume stashed read transactions in joined phase

21 core 0 core 1 core 2 core 3 GET(x) Process new transactions in joined phase using OCC No split data All done joined phase INCR(x) INCR(x, 1) GET(x)

Batching Amortizes the Cost of Reconciliation 22 core 0 core 1 core 2 INCR(x 0,1) INCR(x 1,1) INCR(y,2) INCR(x 2,1) INCR(z,1) core 3 INCR(x 3,1) INCR(y,2) GET(x) Wait to accumulate stashed transactions, batch for joined phase Amortize the cost of reconciliation over many transactions Reads would have conflicted; now they do not INCR(x 1,1) INCR(x 2,1) INCR(z,1) GET(x) All done reconcile GET(x) split phase joined phase

Phase Reconciliation Summary Many contentious writes happen in parallel in split phases Reads and any other incompatible operations happen correctly in joined phases 23

Outline 1.Phase reconciliation 2.Operations 3.Detecting contention 4.Performance evaluation 24

Ordered PUT and insert to an ordered list Operation Model Developers write transactions as stored procedures which are composed of operations on keys and values: 25 value GET(k) void PUT(k,v) void INCR(k,n) void MAX(k,n) void MULT(k,n) void OPUT(k,v,o) void TOPK_INSERT(k,v,o) Traditional key/value operations Operations on numeric values which modify the existing value Not splittable Splittable

27 55 MAX Can Be Efficiently Reconciled 26 core 0 core 1 core 2 MAX(x 0,55) MAX(x 1,10) MAX(x 2,21) 21 Each core keeps one piece of state x i O(#cores) time to reconcile x Result is compatible with any order MAX(x 0,2) MAX(x 1,27) x = 55

What Operations Does Doppel Split? Properties of operations that Doppel can split: –Commutative –Can be efficiently reconciled –Single key –Have no return value However: –Only one operation per record per split phase 27

Outline 1.Phase reconciliation 2.Operations 3.Detecting contention 4.Performance evaluation 28

Which Records Does Doppel Split? Database starts out with no split data Count conflicts on records –Make key split if #conflicts > conflictThreshold Count stashes on records in the split phase –Move key back to non-split if #stashes too high 29

Outline 1.Phase reconciliation 2.Operations 3.Detecting contention 4.Performance evaluation 30

Experimental Setup and Implementation All experiments run on an 80 core Intel server running 64 bit Linux 3.12 with 256GB of RAM Doppel implemented as a multithreaded Go server; one worker thread per core Transactions are procedures written in Go All data fits in memory; don’t measure RPC All graphs measure throughput in transactions/sec 31

Performance Evaluation How much does Doppel improve throughput on contentious write-only workloads? What kinds of read/write workloads benefit? Does Doppel improve throughput for a realistic application: RUBiS? 32

Doppel Executes Conflicting Workloads in Parallel Throughput (millions txns/sec) 20 cores, 1M 16 byte keys, transaction: INCR(x,1) all on same key 33

Doppel Outperforms OCC Even With Low Contention cores, 1M 16 byte keys, transaction: INCR(x,1) on different keys 5% of writes to contended key

Contentious Workloads Scale Well 1M 16 byte keys, transaction: INCR(x,1) all writing same key 35 Communication of phase changing

LIKE Benchmark Users liking pages on a social network 2 tables: users, pages Two transactions: –Increment page’s like count, insert user like of page –Read a page’s like count, read user’s last like 1M users, 1M pages, Zipfian distribution of page popularity Doppel splits the page-like-counts for popular pages But those counts are also read more often 36

Benefits Even When There Are Reads and Writes to the Same Popular Keys 37 Throughput (millions txns/sec) 20 cores, transactions: 50% LIKE read, 50% LIKE write

Doppel Outperforms OCC For A Wide Range of Read/Write Mixes 20 cores, transactions: LIKE read, LIKE write 38 Doppel does not split any data and performs the same as OCC More stashed read transactions

RUBiS Auction application modeled after eBay –Users bid on auctions, comment, list new items, search 1M users and 33K auctions 7 tables, 17 transactions 85% read only transactions (RUBiS bidding mix) Two workloads: –Uniform distribution of bids –Skewed distribution of bids; a few auctions are very popular 39

StoreBid Transaction StoreBidTxn(bidder, amount, item) { INCR(NumBidsKey(item),1) MAX(MaxBidKey(item), amount) OPUT(MaxBidderKey(item), bidder, amount) PUT(NewBidKey(), Bid{bidder, amount, item}) } All commutative operations on potentially conflicting auction metadata Inserting new bids is not likely to conflict 40

Doppel Improves Throughput on an Application Benchmark 41 Throughput (millions txns/sec) 80 cores, 1M users 33K auctions, RUBiS bidding mix 8% StoreBid Transactions 3.2x throughput improvement

Related Work Commutativity in distributed systems and concurrency control –[Weihl ’88] –CRDTs [Shapiro ’11] –RedBlue consistency [Li ’12] –Walter [Lloyd ’12] Optimistic concurrency control –[Kung ’81] –Silo [Tu ’13] Split counters in multicore OSes 42

Conclusion Doppel: Achieves parallel performance when many transactions conflict by combining per-core data and concurrency control Performs comparably to OCC on uniform or read- heavy workloads while improving performance significantly on skewed workloads. 43