Improving OLTP scalability using  speculative lock inheritance Ryan Johnson, Ippokratis Pandis, Anastasia Ailamaki

OLTP scalability limitations • Application: scalable • Hardware: scalable • Storage manager?

Throughput (ktps) 60 50 40

– Good at interleaving threads 30 – True concurrency is harder 20 => Increased latch contention  10 0 0

16 32 48 Hardware Contexts Utilized

64

Contention within storage manager limits scalability © 2009 Ryan Johnson

2

Contention in the lock manager  Per‐thread work breakdown LM Contention 400 Other Contention LM Overhead Computation 300

• Centralized service – Locks managed globally 

• Fine‐grained parallelism – Each lock has its own latch

• Skewed access

200

– Some hotter than others 100

0 2%

11%

48% 67% System load

86%

98%

Culprit: shared high‐level locks © 2009 Ryan Johnson

3

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

4

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

5

Overview of latching vs. locking Latch

Lock

Serializes

Code segments

Transactions

Protects

Data structures

Database records

Duration

Short

Long

# Held at once

0‐2

Unbounded

Implementation Straightforward Complex Latches outnumber lock operations 5:1 or more  © 2009 Ryan Johnson

6

Inside the lock manager ‐ acquire Lock ID Hash Table Lock Head

T1

Transaction Head

Requirements  Find/create many  locks in parallel

L1 Lock Request L2

 Each lock tracks  many requests

L3

 Each transaction  tracks many locks Lock Manager

© 2009 Ryan Johnson

7

Inside the lock manager ‐ release A Compute new lock mode (supremum) release()



IS

IS

S

IS

IX

IS C

upgrade(IX) B

IS



Grant new requests

Process upgrades

Lock strengths IS < IX < S

Intent locks => long request chains  © 2009 Ryan Johnson

8

In this talk… • Introduction • Inside the lock manager • Speculative lock inheritance – Approach and implementation – Experimental results

• Conclusions

© 2009 Ryan Johnson

9

Speculative lock inheritance Hot lock Cold lock

Agent thread execution trx1

trx2

trx3

Lock Manager

Hot locks bounce between agents and LM © 2009 Ryan Johnson

10

Speculative lock inheritance Hot lock Cold lock

Agent thread execution trx1

trx2

trx3

Lock Manager

Agent thread keeps hot locks, bypasses lock manager © 2009 Ryan Johnson

11

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

12

Avoiding starvation eligible &&  !waiting

Held

 sidestep the lock  manager

discard inherit Invalid

Update lock requests  using atomic ops

Inactive

 clean up invalid  requests lazily

waiter arrives

Speculation is lightweight, non‐intrusive © 2009 Ryan Johnson

13

Breakdown of lock behavior unused  15%

used  exclusive  4% 3% row‐level  34%

invalidated 6% missed  10% cold 27%

A few locks cause 97% of contention © 2009 Ryan Johnson

14

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

15

Scalability comparison Throughput (ktps) 100

NDBB (SLI)

80

234% (53%)

60

NDBB TPC‐B (SLI)

40

73% (19%)

TPC‐B

20 0 0

16 32 48 Hardware Contexts Utilized

64

Eliminate contention with low overhead © 2009 Ryan Johnson

16

Impact of lock inheritance CPU time breakdown 100%

SLI Overhead LM Contention Other Contention LM Overhead Computation

80% 60% 40% 20% 0% NDBB

TPC‐B

TPC‐C

Benchmark (Baseline vs. SLI)

Lock bottleneck gone (but others may arise) © 2009 Ryan Johnson

17

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

18

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

19

Thank you!

© 2009 Ryan Johnson

20

Improving OLTP scalability using speculative lock ...

Locks managed globally. • Fine-grained parallelism. – Each lock has its own .... Best solutions may be indirect. – Sidestep hard problems. – Look to distributed ...

169KB Sizes 5 Downloads 264 Views

Recommend Documents

Improving Scalability in Pub-Sub Knowledge-Based Networking by ...
Networking by Semantic Clustering. John Keeney, Dominic ... Knowledge-Based Network implementation was extended to support node clustering based on ...

Identifying Speculative Bubbles using an Infinite ...
This vector serves as a hierarchical parameter of all πjs. Conditional on π0 ..... speculative bubbles in german renewable energy stocks. Energy Economics.

Boosting the Scalability of Botnet Detection Using ...
can then be forwarded to DPI-based botnet detection sys- tems for fine-grained .... proposed to reduce the amount of data the network devices have to process in.

Boosting the Scalability of Botnet Detection Using ...
permission and/or a fee. ASIACCS '11, March 22–24, 2011, Hong Kong, China. ..... algorithm, which we call B-Sampling. .... with size L, if |L−bi.center| ≤ R, we insert this track- flow into bi .... per hour), ppf (the number of packets per flow

Improving IMAGE matting USING COMPREHENSIVE ... - GitHub
Mar 25, 2014 - ... full and partial pixel coverage (alpha-channel) ... Choose best pair among all possible pairs ... confidence have higher smoothing weights) ...

Improving Statistical Machine Translation Using ...
5http://www.fjoch.com/GIZA++.html. We select and annotate 33000 phrase pairs ran- ..... In AI '01: Proceedings of the 14th Biennial Conference of the Canadian ...

Improving Dependency Parsers using Combinatory ...
[email protected], 1tdeoskar,[email protected] ... Dependency parsers can recover much of the .... sues, as the data for Hindi is small. We provided.

Small-sample Reinforcement Learning - Improving Policies Using ...
Small-sample Reinforcement Learning - Improving Policies Using Synthetic Data - preprint.pdf. Small-sample Reinforcement Learning - Improving Policies ...

{ Download } Lock Down Pro - App Lock v2.5 ...
been locked. Lock Down Pro Lock screen: This feature will replace your default lock screen. ... You can also Hide app icon (Remove Lock down Pro icon on App Draw & Home screen). Also try: ... Supported fingerprint for android Marshmallow.

Reducing OLTP Instruction Misses with Thread Migration
Transactions Running Parallel. 6. T1. T2. T3. Instruction parts that can fit into L1-I. Threads. Transaction. T123. Common instructions among concurrent threads ...

LOCK DOWN LOCK OUT (2).pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. LOCK DOWN LOCK OUT (2).pdf. LOCK DOWN LOCK OUT (2).pdf. Open. Extract. Open with. Sign In. Main menu.

Towards Improving Fuzzy Clustering using Support ...
Apr 11, 2009 - Key words: Microarray gene expression data, fuzzy clustering, cluster validity indices .... by some visualization tools for expression data.

Using Syntactic Information for Improving why-Question ...
Improving the QA system. – Better retrieval technique (search engine). – Better ranking system. • Syntactic knowledge between question and answer helps?

Improving query focused summarization using look ...
Department of Computer Science and Automation,. Indian Institute of Science, Bangalore, India. {ramab,vsuresh,cevm}@csa.iisc.ernet.in. Abstract. Query focused summarization is the task of producing a com- pressed text of original set of documents bas

Improving Physical Layer Secrecy Using Full-Duplex ...
design the optimal jamming covariance matrix that maximizes the secrecy rate and ..... D employs a linear receiver, r, on its received signal, yD = hsds +. √.

Improving Location Prediction using a Social Historical ...
of social media where users are able to check-in to loca- tions they ... these predicted locations. Permission to ... [10] pro- posed the Order-k Markov model, which considers the fre- ... more recently visited places), and demonstrating how it can.

Improving Throughput and Maintaining Fairness using ...
We compared our approach with standard parallel TCP over a wide-area network, and found that our approach preserves effectiveness and is fairer to competing traffic than standard parallel TCP. Index Terms—System design, Network measurements, Exper-

Improving Automatic Model Creation using Ontologies
software development process prevents numerous mistakes [2] .... meaning of each word, only certain UML concepts of these n-ary relations are suitable and sensible. Having the phrase. “user A uses an interface B in the application” implies a.

Improving Automatic Model Creation using Ontologies
state-charts, sequence-diagrams and so forth. Every thematic relation can be ..... [22] Meystre and Haug, “Natural language processing to extract medical problems from electronic clinical documents: Performance evaluation,”. J. of Biomedical ...

Improving FPGA Performance and Area Using an ... - Springer Link
input sharing and fracturability we are able to get the advantages of larger LUT sizes ... ther improvements built on the ALM we can actually show an area benefit. 2 Logic ..... results comparing production software and timing models in both cases an

Improving the Evolvability of Digital Multipliers using ...
ECGP and CGP share the same structure and represent a program as a directed graph. (that for ..... pp 719-736, MIT Press, Cambridge. [9] Spector, L. (1996) ...