We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published bySydnie Caples
Modified over 2 years ago
Improving OLTP scalability using speculative lock inheritance Ryan Johnson, Ippokratis Pandis, Anastasia Ailamaki
© 2009 Ryan Johnson 2 OLTP scalability limitations Application: scalable Hardware: scalable Storage manager? –Good at interleaving threads –True concurrency is harder => Increased latch contention Contention within storage manager limits scalability
© 2009 Ryan Johnson 3 Contention in the lock manager Centralized service –Locks managed globally Fine-grained parallelism –Each lock has its own latch Skewed access –Some hotter than others Culprit: shared high-level locks 0 100 200 300 400 2%11%48%67%86%98% System load LM Contention Other Contention LM Overhead Computation Per-thread work breakdown
© 2009 Ryan Johnson 4 Contributions Identify lock manager bottleneck –Latch contention during lock state updates Eliminate most requests for hot locks –Pass hot locks directly between transactions –No changes at application level Improve throughput by 20-50%
© 2009 Ryan Johnson 5 In this talk… Introduction Inside the lock manager –Locking vs. latching –Lock acquire and release –Approaches for reducing overheads Speculative lock inheritance Conclusions
© 2009 Ryan Johnson 6 Overview of latching vs. locking Latches outnumber lock operations 5:1 or more LatchLock SerializesCode segmentsTransactions ProtectsData structuresDatabase records DurationShortLong # Held at once0-2Unbounded ImplementationStraightforwardComplex
© 2009 Ryan Johnson 7 Inside the lock manager - acquire Lock Manager L2 Lock Request Lock Head L1 L3 Lock ID Hash Table T1 Transaction Head Requirements Find/create many locks in parallel Each lock tracks many requests Each transaction tracks many locks
© 2009 Ryan Johnson 8 Inside the lock manager - release Intent locks => long request chains IS S IXIS release() upgrade(IX) … … B Process upgrades C Grant new requests A Compute new lock mode (supremum) Lock strengths IS < IX < S
© 2009 Ryan Johnson 9 In this talk… Introduction Inside the lock manager Speculative lock inheritance –Approach and implementation –Experimental results Conclusions
© 2009 Ryan Johnson 10 Speculative lock inheritance Lock Manager trx 1 trx 2 trx 3 Agent thread execution Hot locks bounce between agents and LM Hot lock Cold lock
© 2009 Ryan Johnson 11 Speculative lock inheritance Lock Manager trx 1 trx 2 trx 3 Agent thread keeps hot locks, bypasses lock manager Agent thread execution Hot lock Cold lock
© 2009 Ryan Johnson 12 Criteria for lock inheritance Hot (latch contention) Held in shared mode No other trx waiting (fairness) Not row-level (too many of those) Parent (if any) also eligible
© 2009 Ryan Johnson 13 Avoiding starvation Held Inactive Invalid eligible && !waiting waiter arrives inherit discard Speculation is lightweight, non-intrusive Update lock requests using atomic ops sidestep the lock manager clean up invalid requests lazily
© 2009 Ryan Johnson 14 Breakdown of lock behavior row-level 34% cold 27% unused 15% missed 10% invalidated 6% exclusive 3% used 4% A few locks cause 97% of contention
© 2009 Ryan Johnson 15 Experimental setup Hardware –Sun T5220 “Niagara II” (sparcv9-solaris10) –16 pipelines, 64 contexts, 64GB RAM Software –Shore-MT –Extended to include lock inheritance Benchmarks (mem-resident) –Telecom: Nokia Benchmark (NDBB) –Banking: TPC-B –Online Sales: TPC-C
© 2009 Ryan Johnson 16 Scalability comparison Eliminate contention with low overhead 0 20 40 60 80 100 016324864 Hardware Contexts Utilized Throughput (ktps) NDBB NDBB (SLI) TPC-B (SLI) TPC-B 234% (53%) 73% (19%)
© 2009 Ryan Johnson 17 Impact of lock inheritance Lock bottleneck gone (but others may arise) 0% 20% 40% 60% 80% 100% Benchmark (Baseline vs. SLI) NDBBTPC-BTPC-C SLI Overhead LM Contention Other Contention LM Overhead Computation CPU time breakdown
© 2009 Ryan Johnson 18 Reducing overheads of locking Rdb/VMS –Distributed DBMS –Lock “carry-over” reduces network traffic DB2 “keep table lock” setting –Connection holds all table locks until close –Leads to “poor concurrency” H-Store –Single-threaded, non-interleaved execution model –No locking or latching at all
© 2009 Ryan Johnson 19 Conclusions All latches are potential bottlenecks –Even “fine-grained” ones if there’s skew Best solutions may be indirect –Sidestep hard problems –Look to distributed databases Lock inheritance eliminates one bottleneck –Distribute accesses to hot locks –Improve throughput 20-50% today –Benefit increases with more cores
© 2009 Ryan Johnson 20 Thank you!
@ 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.
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.
Critical Sections: Re-emerging Concerns for DBMS Ryan JohnsonIppokratis Pandis Anastasia Ailamaki Carnegie Mellon University École Polytechnique Féderale.
Addition 1’s to 20.
The University of Adelaide, School of Computer Science
Year 6 mental test 10 second questions Numbers and number system Numbers and the number system, fractions, decimals, proportion & probability.
The Impact of Soft Resource Allocation on n-tier Application Scalability Qingyang Wang, Simon Malkowski, Yasuhiko Kanemasa, Deepal Jayasinghe, Pengcheng.
0 - 0.
Test B, 100 Subtraction Facts
$100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400.
Inferring Locks for Atomic Sections Cornell University (summer intern at Microsoft Research) Microsoft Research Sigmund CheremTrishul ChilimbiSumit Gulwani.
RTR: 1 Byte/Kilo-Instruction Race Recording Min Xu Rastislav BodikMark D. Hill.
Number bonds to 10,
OLTP on Hardware Islands Danica Porobic, Ippokratis Pandis*, Miguel Branco, Pınar Tözün, Anastasia Ailamaki Data-Intensive Application and Systems Lab,
Benjamin Banneker Charter Academy of Technology Making AYP Benjamin Banneker Charter Academy of Technology Making AYP.
L.N. Bhuyan Adapted from Patterson’s slides
To Share or Not to Share? Ryan Johnson Nikos Hardavellas, Ippokratis Pandis, Naju Mancheril, Stavros Harizopoulos**, Kivanc Sabirli, Anastasia Ailamaki,
© 2017 SlidePlayer.com Inc. All rights reserved.