Improving OLTP scalability using speculative lock ... - Google Sites

5 downloads 229 Views 169KB Size Report
Locks managed globally. • Fine-grained parallelism. – Each lock has its own .... Best solutions may be indirect. –
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 

Suggest Documents