Parallel Execution for Conflicting Transactions
Neha Narula
1 ¡
Thesis Advisors: Robert Morris and Eddie Kohler
Parallel Execution for Conflicting Transactions Neha Narula Thesis - - PowerPoint PPT Presentation
Parallel Execution for Conflicting Transactions Neha Narula Thesis Advisors: Robert Morris and Eddie Kohler 1 Database-backed applications require good performance WhatsApp: 1M messages/sec Facebook: 1/5 of all page views in the US
1 ¡
Thesis Advisors: Robert Morris and Eddie Kohler
3 ¡
4 ¡
5 ¡
10 20 30 40 50 60 70 80 Throughput cores
6 ¡
10 20 30 40 50 60 70 80 Throughput cores
7 ¡
time
8 ¡
time
ADD(x,1) ADD(x,1) ADD(x,1)
9 ¡
time
ADD(x,1) ADD(x,1) ADD(x,1)
10 ¡
time
ADD(x,1) ADD(x,1)
11 ¡
time
x0:1 x1:1 x2:1 ADD(x,1) per-core values for record x x is split across cores x0:0 x1:0 x2:0 ADD(x,1) ADD(x,1) ADD(x,1) ADD(x,1) ADD(x,1) x0:3 x1:3 x2:2
12 ¡
time
x0:3 x1:3 x2:2 ADD(x,1) PUT(x,42) GET(x) x1:4 x2:42
ADD(x,1) ADD(x,1) ADD(x,1)
13 ¡
time GET(x) ADD(x,1) GET(x) ADD(x,1) GET(x) ADD(x,1)
Can execute in parallel Can execute in parallel
14 ¡
time
Conventional concurrency control
15 ¡
16 ¡
17 ¡
18 ¡
core 0 core 1 core 2 ADD(x0,1) ADD(x1,1) ADD(x2,1)
split phase
19 ¡
core 0 core 1 core 2
split phase
ADD(x1,1) GET(x) ADD(x0,1) ADD(x1,1) ADD(x2,1)
20 ¡
core 0 core 1 core 2
split phase
ADD(x1,1) ADD(x0,1) ADD(x1,1) ADD(x2,1) GET(x)
21 ¡
core 0 core 1 core 2
reconciliation
x = x + x0 x = x + x1 x = x + x2 GET(x)
joined phase
22 ¡
core 0 core 1 core 2 x = x + x0 x = x + x1 x = x + x2
reconciliation
GET(x)
joined phase
23 ¡
core 0 core 1 core 2
GET(x)
split phase
GET(x)
joined phase
ADD(x1,1) ADD(x2,1)
24 ¡
25 ¡
core 0 core 1 core 2 ADD(x0,1) ADD(x1,1) PUT(y,2) ADD(x3,1) PUT(y,2)
split phase
26 ¡
core 0 core 1 core 2 ADD(x0,1) ADD(x1,1) PUT(y,2) ADD(x3,1) PUT(y,2)
split phase
ADD(x,1)GET(x)
27 ¡
core 0 core 1 core 2 ADD(x0,1) ADD(x1,1) PUT(y,2) ADD(x3,1) PUT(y,2)
split phase
ADD(x,1)GET(x)
joined phase
ADD(x,1)GET(x)
28 ¡
core 0 core 1 core 2
split phase
ADD(x2,1)MULT(y2,2) ADD(x0,1) ADD(x1,1) MULT(y2,1)
29 ¡
core 0 core 1 core 2
reconciliation
x = x + x1 x = x + x2 y = y * y0 y = y * y1 y = y * y2 x = x + x0
joined phase
GET(x)GET(y)
30 ¡
core 0 core 1 core 2 ADD(x0,1) GET(x)
ADD(x1,1) ADD(x2,1) ADD(z,1) GET(x) GET(x) GET(x) GET(x)
split phase joined phase
GET(x) ADD(x2,1) ADD(x1,1) ADD(x0,1)
31 ¡
ns = # stashed ts = time in split phase
32 ¡
33 ¡
34 ¡
Operations on numeric values which modify the existing value
35 ¡
36 ¡
T1
37 ¡
T5
T2
T4
T3 T6
log: log: log:
T1
38 ¡
T5 T2 T4 T3 T6 log: log: log:
39 ¡
40 ¡
41 ¡
core 1
MAX(x,27)
x1:27
MAX(x,10)
x1:10
core 0
MAX(x,55) MAX(x,2)
x0:55
core 2
MAX(x,21)
x2:21
42 ¡
x = MAX(x,55) (55) x = MAX(x,27) (55) x = MAX(x,21) (55)
43 ¡
?
core 0
SHA1(x) SHA1(x) SHA1(x)
44 ¡
45 ¡
Ordered PUT and insert to an ordered list
46 ¡
Operations on numeric values which modify the existing value With timestamps, last writer wins Short indexes, top friends or follower lists
47 ¡
48 ¡
49 ¡
50 ¡
51 ¡
52 ¡
53 ¡
54 ¡
55 ¡
Throughput (millions txns/sec)
20 cores, 1M 16 byte keys, transaction: ADD(x,1) all on same key 5 10 15 20 25 30 35 Doppel OCC 2PL
56 ¡
1M 16 byte keys, transaction: ADD(x,1) all writing same key
57 ¡
0M 10M 20M 30M 40M 50M 60M 70M 80M 90M 100M 10 20 30 40 50 60 70 80 Throughput (txns/sec) number of cores Doppel OCC 2PL Synchronization of phase changing
58 ¡
0M 5M 10M 15M 20M 25M 30M 35M 20 40 60 80 100 Throughput (txns/sec) % of transactions with hot key Doppel OCC 2PL
59 ¡
20 cores, 1M 16 byte keys, transaction: ADD(x,1) on different keys
5% of writes to contended key
60 ¡
0M 5M 10M 15M 20M 25M 10 20 30 40 50 60 70 80 90 Throughput (txns/sec) time (seconds) Doppel OCC
61 ¡
20 cores, 1M 16 byte keys, transaction: ADD(x,1) 10% on same key
62 ¡
63 ¡
64 ¡
1 2 3 4 5 6 7 8 9 Doppel OCC
Throughput (millions txns/sec)
20 cores, transactions: 50% read, 50% write
20 cores, transactions: RW benchmark
65 ¡
0M 2M 4M 6M 8M 10M 12M 14M 16M 18M 20 40 60 80 100 Throughput (txns/sec) % of transactions that read Doppel OCC
Doppel does not split any data and performs the same as OCC
M
e s t a s h e d r e a d t r a n s a c t i
s
66 ¡
67 ¡
68 ¡
2 4 6 8 10 12 Uniform Skewed Doppel OCC
69 ¡
Throughput (millions txns/sec)
80 cores, 1M users 33K auctions, RUBiS bidding mix. 50% bids on top auction
Caused by StoreBid transactions (8%) 3.2x throughput improvement
70 ¡
71 ¡
72 ¡
73 ¡
74 ¡
75 ¡
Brian Allen, Neelam Narula, Arun Narula, Megan Narula, Adrienne Winans, Austin Clements, Yandong Mao, Adam Marcus, Alex Pesterev, Alex Yip, Max Krohn, Cody Cutler, Frank Wang, Xi Wang, Ramesh Chandra, Emily Stark, Priya Gupta, James Cowling, Dan Ports, Irene Zhang, Jean Yang, Grace Woo, Szymon Jakubczak, Omar Khan, Sharon Perl, Brad Chen, Ben Swanson, Ted Benson, Eugene Wu, Evan Jones, Vijay Pandurangan, Keith Winstein, Jonathan Perry, Stephen Tu, Vijay Boyapati, Ines Sombra, Tom Santero, Chris Meiklejohn, John Wards, Gergely Hodicska, Zeeshan Lakhani, Bryan Kate, Michael Kester, Aaron Elmore, Grant Schoenebeck, Matei Zaharia, Sam Madden, Mike Stonebraker, Frans Kaashoek, Nickolai Zeldovich
5000 10000 15000 20000 25000 30000 35000 10 20 30 40 50 60 70 80 90 100 Average Read Latency (µs) phase length (ms) Uniform Skewed Skewed Write Heavy
76 ¡