storage latencyjarulraj/talks/2016.wbl.pdf · 2018-09-25 · storage engines 6x performance...

42
1

Upload: others

Post on 06-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

1

Page 2: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

2

STORAGE LATENCY2

RAMAC 350(600 ms)

1956

NAND SSD(60 us)

2016

105x

Page 3: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

3

COMPUTE LATENCY3

CORE I7(1 GHZ)

2016

RAMAC 305(100 Hz)

1956

108x1000x

Page 4: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

4

NON-VOLATILE MEMORY4

1000x faster than NAND

10x denser than DRAM

1000x endurance of NAND

2017

3D XPOINT(60 ns)

Page 5: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

5

NON-VOLATILE MEMORY5

3D XPOINT(60 ns)

2017

Support in Linux 4.3+

New assembly instructions

SNIA programming model

Page 6: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

6

• Option 1: Treat NVM like a faster SSD

6

DRAM

NVM

DBMS

Improves performance

Use NVM as a logging and backing store

WHAT NVM MEANS FOR DATABASES?

Page 7: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

7

WHAT NVM MEANS FOR DATABASES?

• Option 2: Treat NVM as extended memory

7

DRAM NVM

DBMS

Improves not only performance,but also availability

and device utilization

Redesign the key algorithms in a database system

Page 8: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

88

PAST:EXISTINGSYSTEMS

PRESENT:NVM-AWARE

DBMS

FUTURE:ANALYTICS

ON NVM

PAST:EXISTINGSYSTEMS

PRESENT:NVM-AWARE

DBMS

FUTURE:ANALYTICS

ON NVM

Page 9: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

9

PAST — EXISTING SYSTEMS• Investigate how existing systems perform on NVM– Option 1: Treat NVM like a faster SSD

• Evaluate two types of DBMSs– Disk-oriented DBMS– In-memory DBMS

9

A PROLEGOMENON ON OLTP DATABASE SYSTEMS FOR NON-VOLATILE MEMORYADMS 2014

Page 10: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

10

DBMS ARCHITECTURES10

DISK-ORIENTED DBMS IN-MEMORY DBMS

Table Heap

LogCheckpoints

Buffer Pool Table Heap

LogCheckpoints

DRAM

NVM

DRAM

NVM

Page 11: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

11

NVM HARDWARE EMULATOR

• Tunable DRAM latency for emulating NVM• Special assembly instructions for NVM– Cache line write-back

11

L1 Cache

L2 Cache

STORE CLWB

CPU NVMCACHE

Page 12: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

12

EVALUATION

• Compare existing DBMSs on NVM emulator– MySQL (Disk-oriented DBMS)– H-Store (In-memory DBMS)

• TPC-C benchmark– 1/8th of database fits in DRAM, rest on NVM

12

Page 13: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

13

0

20,000

40,000

Database systems

PERFORMANCE13

In-memory DBMSDisk-Oriented DBMS

Throughput(txn/sec)

8x DRAM Latency

12x

Page 14: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

14

0

20,000

40,000

Database systems

PERFORMANCE14

Throughput(txn/sec)

In-memory DBMSDisk-Oriented DBMS

2x DRAM Latency 4x

1x

1xLegacy database systems are not prepared for NVM

Page 15: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

1515

PAST:EXISTINGSYSTEMS

PRESENT:NVM-AWARE

DBMS

FUTURE:ANALYTICS

ON NVM

PRESENT:NVM-AWARE

DBMS

Page 16: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

16

PRESENT — NVM-AWARE DBMS16

• Understand changes required in DBMSs to leverage NVM– Option 2: Treat NVM as extended memory

• Rethink key algorithms in database systems– Logging and recovery protocol

• Designed for real-time analytics– Multi-versioned database

LET’S TALK ABOUT STORAGE AND RECOVERY METHODS FORNON-VOLATILE MEMORY DATABASE SYSTEMSSIGMOD 2015

Page 17: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

17

MULTI-VERSIONED DBMS17

BEGINTIMESTAMP

ENDTIMESTAMP

PREVIOUSVERSION

TUPLE ID

TUPLEDATA

10 ∞ —1 X

10 ∞ —2 Y

20 ∞ 23 Y’

10 20 —

Page 18: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

18

THOUGHT EXPERIMENT

• NVM-only storage hierarchy– No volatile DRAM

18

NVM

DBMS

Page 19: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

19

TRADITIONAL STORAGE ENGINE19

Table Heap

LogCheckpoints

1

2 3NVM

DataData

Page 20: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

20

NON-VOLATILE POINTER20

POINTER DATA

DRAM DRAM

POINTER DATA

NVM NVM

VOLATILE POINTER NON-VOLATILE POINTER

CRASH: DISAPPEARS CRASH: VALID

ü✗

Page 21: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

21

NVM-AWARE STORAGE ENGINE

• Instead of duplicating tuple data in log– Store non-volatile tuple pointers in log records

21

TRADITIONAL LOG

INSERT TUPLE 1 (DATA)

UPDATE TUPLE 1 (DATA)

NVM-AWARE LOG

INSERT TUPLE 1 (POINTER)

UPDATE TUPLE 1 (POINTER)

Page 22: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

22

NVM-AWARE STORAGE ENGINE22

Table Heap

Log

1

2NVM

MetaData

Checkpoints✗

Page 23: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

23

EVALUATION

• Compare storage engines on NVM emulator– Traditional engine– NVM-aware engine

• Yahoo! Cloud Serving Benchmark– Database fits in NVM

23

Page 24: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

24

PERFORMANCE24

Throughput(txn/sec)

0

300,000

600,000

Storage Engines

3x

NVM-Aware EngineTraditional Engine

8x DRAM Latency

Page 25: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

2525

Throughput(txn/sec)

0

750,000

1,500,000

Storage Engines

6x

PERFORMANCENVM-Aware EngineTraditional Engine

2x DRAM Latency 4x

1x

NVM latency has a significant impact on the performance of NVM-aware storage engine

Page 26: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

26

DEVICE LIFETIME26

NVM Stores(M)

0

50

100

Storage Engines

2x

NVM-Aware EngineTraditional Engine

Page 27: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

27

THE PELOTON DBMS

• A new database system for NVM research – Designed for a two-tier storage hierarchy

27

DRAM NVM

DBMS

WRITE-BEHIND LOGGINGUNDER REVIEW

Page 28: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

28

WRITE-BEHIND LOGGING

• Write-ahead log serves two purposes– Transform random database writes into sequential log writes– Support transaction rollback

• NVM supports fast random writes– Directly write data to the database– Later, record metadata in write-behind log

28

Page 29: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

29

WRITE-BEHIND LOGGING29

Database2

Database

Log

1

3

DRAM

NVM

MetaData Data

Page 30: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

30

METADATA FOR INSTANT RECOVERY

• Record failed timestamp ranges in log– Use it to ignore effects of uncommitted transactions

30

Group Commit

Time

(T1, T2) (T1, T2)

Garbage Collection

Dirty Ranges

T1 T4T3T2

Page 31: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

31

EVALUATION

• Compare logging protocols in Peloton– Write-Ahead logging– Write-Behind logging

• Storage devices in Intel’s NVM hardware emulator– Hard-disk drive– Solid-state drive– Non-volatile memory emulator

• TPC-C benchmark

31

Page 32: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

32

APPLICATION AVAILABILITY32

1

100

10,000

Hard Disk Drive

Solid State Drive

Non-Volatile Memory

Write-Behind LoggingWrite-Ahead Logging

Recovery Time(sec)

1000x

Page 33: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

33

PERFORMANCE33

Write-Behind LoggingWrite-Ahead Logging

Throughput(txn/sec)

1

100

10,000

Hard Disk Drive

Solid State Drive

Non-Volatile Memory

10x

1.3x

Page 34: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

3434

PAST:EXISTINGSYSTEMS

PRESENT:NVM-AWARE

DBMS

FUTURE:ANALYTICS

ON NVM

FUTURE:ANALYTICS

ON NVM

Page 35: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

35

FUTURE — REAL-TIME ANALYTICS

• Support analytics on larger-than-NVM databases– Cost of first-generation NVM devices

• Three-tier storage hierarchy– DRAM + NVM + SSD

• When to migrate data between different layers?

35

REAL-TIME ANALYTICS IN NON-VOLATILE MEMORY DATABASE SYSTEMS WORK IN PROGRESS

Page 36: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

36

THREE-TIER STORAGE HIERARCHY36

Database2

Database

Log

1

3

DRAM

NVM

Database4

SSD

Data

Data

MetaData

Page 37: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

37

DATA MIGRATION

• Can directly read warm data from NVM– No need to copy data over to DRAM for reading

• Keep hottest data in DRAM• Dynamically migrate cold data to SSD

37

Page 38: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

38

THREE-TIER STORAGE HIERARCHY38

0

60,000

120,000

Read-Heavy Workload

Balanced Workload

Write-Heavy Workload

Throughput(txn/sec)

50% on NVM10% on NVM 90% on NVM

8x3x 4x

Page 39: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

3939

PAST:EXISTINGSYSTEMS

PRESENT:NVM-ORIENTED

DBMS

FUTURE:ANALYTICS

ON NVM

PAST:EXISTINGSYSTEMS

PRESENT:NVM-AWARE

DBMS

FUTURE:ANALYTICS

ON NVM

Page 40: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

40

LESSONS LEARNED

• NVM outperforms SSD when correctly used • Rethink key algorithms in database systems– Write-behind logging enables instant recovery– Improves device utilization and extends its lifetime

• Ongoing work– Data placement policy– Replication

40

Page 41: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

4141

Page 42: STORAGE LATENCYjarulraj/talks/2016.wbl.pdf · 2018-09-25 · Storage Engines 6x PERFORMANCE Traditional Engine NVM-Aware Engine 2x DRAM Latency 4x 1x NVM latency has a significant

4242