Critical Sections: Re-emerging Concerns for DBMS Ryan JohnsonIppokratis Pandis Anastasia Ailamaki Carnegie Mellon University École Polytechnique Féderale.

Slides:



Advertisements
Similar presentations
Inferring Locks for Atomic Sections Cornell University (summer intern at Microsoft Research) Microsoft Research Sigmund CheremTrishul ChilimbiSumit Gulwani.
Advertisements

From A to E: Analyzing TPCs OLTP Benchmarks Pınar Tözün Ippokratis Pandis* Cansu Kaynak Djordje Jevdjic Anastasia Ailamaki École Polytechnique Fédérale.
@ Carnegie Mellon Databases Data-oriented Transaction Execution VLDB 2010 Ippokratis Pandis Ryan Johnson Nikos Hardavellas Anastasia Ailamaki Carnegie.
© 2010 Ippokratis Pandis Aether: A Scalable Approach to Logging VLDB 2010 Ryan Johnson Ippokratis Pandis Radu Stoica Manos Athanassoulis Anastasia Ailamaki.
Improving OLTP scalability using speculative lock inheritance Ryan Johnson, Ippokratis Pandis, Anastasia Ailamaki.
U NIVERSITY U NIVERSITY OF T ORONTO U NIVERSITY OF T ORONTO Bionic databases are coming. What will they look like? *Ryan Johnson & Ippokratis Pandis**
To Share or Not to Share? Ryan Johnson Nikos Hardavellas, Ippokratis Pandis, Naju Mancheril, Stavros Harizopoulos**, Kivanc Sabirli, Anastasia Ailamaki,
Concurrent programming: From theory to practice Concurrent Algorithms 2014 Vasileios Trigonakis Georgios Chatzopoulos.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Nikos Hardavellas, Northwestern University
1 Database Servers on Chip Multiprocessors: Limitations and Opportunities Nikos Hardavellas With Ippokratis Pandis, Ryan Johnson, Naju Mancheril, Anastassia.
ECE 454 Computer Systems Programming Parallel Architectures and Performance Implications (II) Ding Yuan ECE Dept., University of Toronto
Exploiting Distributed Version Concurrency in a Transactional Memory Cluster Kaloian Manassiev, Madalin Mihailescu and Cristiana Amza University of Toronto,
Phase Reconciliation for Contended In-Memory Transactions Neha Narula, Cody Cutler, Eddie Kohler, Robert Morris MIT CSAIL and Harvard 1.
Concurrency Control Part 2 R&G - Chapter 17 The sequel was far better than the original! -- Nobody.
Evaluation of Message Passing Synchronization Algorithms in Embedded Systems 1 Evaluation of Message Passing Synchronization Algorithms in Embedded Systems.
Chapter 6: Process Synchronization
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Parallel Processing (CS526) Spring 2012(Week 6).  A parallel algorithm is a group of partitioned tasks that work with each other to solve a large problem.
Toward Efficient Support for Multithreaded MPI Communication Pavan Balaji 1, Darius Buntinas 1, David Goodell 1, William Gropp 2, and Rajeev Thakur 1 1.
Concurrent Data Structures in Architectures with Limited Shared Memory Support Ivan Walulya Yiannis Nikolakopoulos Marina Papatriantafilou Philippas Tsigas.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
Optimistic Intra-Transaction Parallelism on Chip-Multiprocessors Chris Colohan 1, Anastassia Ailamaki 1, J. Gregory Steffan 2 and Todd C. Mowry 1,3 1 Carnegie.
A Scalable Approach to Thread-Level Speculation J. Gregory Steffan, Christopher B. Colohan, Antonia Zhai, and Todd C. Mowry Carnegie Mellon University.
Transaction Management and Concurrency Control
Transactions – T4.3 Title: Concurrency Control Performance Modeling: Alternatives and Implications Authors: R. Agarwal, M. J. Carey, M. Livny ACM TODS,
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Scalable, Reliable, Power-Efficient Communication for Hardware Transactional Memory Seth Pugsley, Manu Awasthi, Niti Madan, Naveen Muralimanohar and Rajeev.
Language Support for Lightweight transactions Tim Harris & Keir Fraser Presented by Narayanan Sundaram 04/28/2008.
DB system design for new hardware and sciences Anastasia Ailamaki École Polytechnique Fédérale de Lausanne and Carnegie Mellon University.
/ PSWLAB Eraser: A Dynamic Data Race Detector for Multithreaded Programs By Stefan Savage et al 5 th Mar 2008 presented by Hong,Shin Eraser:
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
Locking Key Ranges with Unbundled Transaction Services 1 David Lomet Microsoft Research Mohamed Mokbel University of Minnesota.
Continuous resource monitoring for self-predicting DBMS Dushyanth Narayanan 1 Eno Thereska 2 Anastassia Ailamaki 2 1 Microsoft Research-Cambridge, 2 Carnegie.
Behavior of Synchronization Methods in Commonly Used Languages and Systems Yiannis Nikolakopoulos Joint work with: D. Cederman, B.
Task Scheduling for Highly Concurrent Analytical and Transactional Main-Memory Workloads Iraklis Psaroudakis (EPFL), Tobias Scheuer (SAP AG), Norman May.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Evaluating FERMI features for Data Mining Applications Masters Thesis Presentation Sinduja Muralidharan Advised by: Dr. Gagan Agrawal.
1 Performance Tuning Next, we focus on lock-based concurrency control, and look at optimising lock contention. The key is to combine the theory of concurrency.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
Integrating and Optimizing Transactional Memory in a Data Mining Middleware Vignesh Ravi and Gagan Agrawal Department of ComputerScience and Engg. The.
The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors THOMAS E. ANDERSON Presented by Daesung Park.
Authors: Stavros HP Daniel J. Yale Samuel MIT Michael MIT Supervisor: Dr Benjamin Kao Presenter: For Sigmod.
Database Replication in Tashkent CSEP 545 Transaction Processing Sameh Elnikety.
Storage Manager Scalability on CMPs Ippokratis Pandis CIDR Gong Show.
Kernel Locking Techniques by Robert Love presented by Scott Price.
CSC 556 – DBMS II, Spring 2013 May 1, 2013 DBMS ACID Properties & Concurrency Control.
Moore’s Law means more transistors and therefore cores, but… CPU clock rate stalled… Meanwhile RAM cost continues to drop.
CS510 Concurrent Systems Why the Grass May Not Be Greener on the Other Side: A Comparison of Locking and Transactional Memory.
Technology from seed Exploiting Off-the-Shelf Virtual Memory Mechanisms to Boost Software Transactional Memory Amin Mohtasham, Paulo Ferreira and João.
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
Architectural Features of Transactional Memory Designs for an Operating System Chris Rossbach, Hany Ramadan, Don Porter Advanced Computer Architecture.
ECE 1747: Parallel Programming Short Introduction to Transactions and Transactional Memory (a.k.a. Speculative Synchronization)
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Scalable Computing model : Lock free protocol By Peeyush Agrawal 2010MCS3469 Guided By Dr. Kolin Paul.
1 Concurrency Control. 2 Why Have Concurrent Processes? v Better transaction throughput, response time v Done via better utilization of resources: –While.
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Hathi: Durable Transactions for Memory using Flash
Reducing OLTP Instruction Misses with Thread Migration
Algorithmic Improvements for Fast Concurrent Cuckoo Hashing
Faster Data Structures in Transactional Memory using Three Paths
Concurrency Control More !
Repairing Write Performance on Flash Devices
Kernel Synchronization II
Yiannis Nikolakopoulos
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Transactions and Concurrency
Kernel Synchronization II
MV-RLU: Scaling Read-Log-Update with Multi-Versioning
Presentation transcript:

Critical Sections: Re-emerging Concerns for DBMS Ryan JohnsonIppokratis Pandis Anastasia Ailamaki Carnegie Mellon University École Polytechnique Féderale de Lausanne

© 2008 Ryan Johnson A Convergence of Trends OLTP fits in memory [stonebraker07] –256GB RAM = 80M TPC-C customers –Amazon.com had 30M customers in 2005 Multi-core computing –Dozens of HW contexts per chip today –Expect 2x more cores each generation Scalability concerns replace I/O bottleneck

© 2008 Ryan Johnson Potential Scalability Bottlenecks Hardware DBMS Applications ??

© 2008 Ryan Johnson DBMS Scalability Comparison Current engines face internal scalability challenges Sun T HW threads Insert-only microbenchmark Lower is better

© 2008 Ryan Johnson Contributions Evaluate common synchronization approaches, identify most useful ones Highlight performance impact of tuning database engines for scalability

© 2008 Ryan Johnson Outline Introduction Scalability and Critical Sections Synchronization Techniques Shore-MT Conclusion

© 2008 Ryan Johnson Sources of Serialization Concurrency control –Serialize conflicting logical transactions –Enforce consistency and isolation Latching –Serialize physical page updates –Protect page integrity Critical sections (semaphores) –Serialize internal data structure updates –Protect data structure integrity Critical sections largely overlooked

© 2008 Ryan Johnson Critical Sections in DBMS Fine-grained parallelism vital to scalability Transactions require tight synchronization –Many short critical sections –Most uncontended, some heavily contended TPC-C Payment –Accesses 4-6 records –Enters ~100 critical sections in Shore Cannot ignore critical section performance

© 2008 Ryan Johnson Example: Index Probe Time Locks Latches Critical Sections Many short critical sections per operation

© 2008 Ryan Johnson Outline Introduction Scalability and Critical Sections Synchronization Techniques Shore-MT Conclusion

© 2008 Ryan Johnson Related Work Concurrency control –Locking [got92] –BTrees [moh90] –Often assumes single hardware context Latching –Solved problem [agr87] –Table-based latching [got92] Synchronization Techniques

© 2008 Ryan Johnson Lock-based Synchronization Blocking Mutex Simple to use Overhead, unscalable Test and set Spinlock Efficient Unscalable Queue-based spinlock Scalable Mem. management Reader-writer lock Concurrent readers Overhead

© 2008 Ryan Johnson Lock-free Synchronization Optimistic Concurrency Control (OCC) No read overhead Writes cause livelock Atomic Updates Efficient Limited applicability Lock-free Algorithms Scalable Special-purpose algs Hardware Approaches (e.g. transactional memory) Efficient, scalable Not widely available

© 2008 Ryan Johnson Experimental Setup Hardware –Sun T2000 Niagara server –8 cores, 4 threads each (32 total) Microbenchmark: while(!timout_flag) delay_ns(t_out); acquire(); delay_ns(t_in); release();

© 2008 Ryan Johnson Critical Section Overhead DBMS Critical Sections t_out = t_in 16 threads Critical sections are 60-90% overhead

© 2008 Ryan Johnson Scalability Under Contention TATAS or MCS best depending on contention t_out = t_in = 0ns

© 2008 Ryan Johnson Reader-writer Performance Reader-writer locks too expensive to be useful t_out = t_in = 100ns 16 threads DBMS spans gamut

© 2008 Ryan Johnson Selecting a Primitive Read-mostly Long Contended Uncontended Mutex Short OCC MCS TAS Lock-free A handful of primitives covers most cases

© 2008 Ryan Johnson Outline Introduction Scalability and Critical Sections Synchronization Techniques Shore-MT Conclusion

© 2008 Ryan Johnson Alleviating Contention Modify algorithms –Shrink/distribute/eliminate critical sections –Fundamental scalability improvements Tune existing critical sections –Reduce overheads –Straightforward and localized changes Both approaches vital for scalability

© 2008 Ryan Johnson From Shore to Shore-MT Tuning and algorithmic changes at each step Concurrent Threads Throughput (tps) baseline dist-bpool tune-locks malloc log2 lockm bpool2 final ideal

© 2008 Ryan Johnson Conclusions Only a few types of primitives useful Algorithms and tuning both essential to performance/scalability Open issues –Developing ever-finer grained algorithms –Reduce synchronization overhead –Improve usability of reader-writer locks –Efficient lock-free algorithms Plenty of room for improvements by future research

© 2008 Ryan Johnson Bibliography [agr87] R. Agrawal, M. Carey, and M. Livoy. Concurrency Control Performance Modeling: Alternatives and Implications. In ACM ToDS, 12(4): , [car94] M. Carey, et al. Shoring up persistent applications. SIGMOD Record 23(2): , [got92] V. Gottemukkala and T. Lehman, Locking and Latching in a Memory-Resident Database System. In proc. VLDB92. [moh90] C. Mohan, Commit-LSN: A novel and simple method for reducing locking and latching in transaction processing system. In proc. VLDB90.

© 2008 Ryan Johnson Thank You!