Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application...

37
Sangwook Kim 1 , Hwanju Kim 2 , Sang-Hoon Kim 3 , Joonwon Lee 1 , and Jinkyu Jeong 1 Sungkyunkwan University 1 University of Cambridge 2 Korea Advanced Institute of Science and Technology (KAIST) 3 Request-Oriented Durable Write Caching for Application Performance

Transcript of Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application...

Page 1: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Sangwook Kim1, Hwanju Kim2, Sang-Hoon Kim3, Joonwon Lee1,

and Jinkyu Jeong1

Sungkyunkwan University1

University of Cambridge2

Korea Advanced Institute of Science and Technology (KAIST)3

Request-Oriented Durable Write Caching for Application Performance

Page 2: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Non-volatile Write Cache

• Volatile DRAM cache is ineffective for write • Writes are dominant I/Os [FAST’09, FAST’10, FAST’14]

• Non-volatile write cache (NVWC) provides • Fast response for write w/o loss of durability

• NVWC candidates

Performance GB/$

NV-DRAM PCM MRAM Flash

[Bhadkamkar et al., FAST’09] BORG: Block-reORGanization for self-optimizing storage systems [Koller et al., FAST’10] I/O deduplication: Utilizing content similarity to improve I/O performance [Harter et al., FAST’14] Analysis of HDFS under HBase: a Facebook messages case study

Page 3: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Non-volatile Write Cache

• Simple caching policy

Backing Storage

Operating System

P1 P2

Write

P3

Write Write

Application

NVWC Blindly caching all writes

Lazily writing back to storage

Page 4: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Non-volatile Write Cache

• Simple caching policy

Backing Storage

Operating System

P1 P2

Write

P3

Write Write

Application

NVWC Blindly caching all writes

Lazily writing back to storage

No consideration for application performance

Page 5: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Impact on Application Performance

• Illustrative experiment

• TPC-C workload

• PostgreSQL database

• 2 NVWC devices

• 32MB NV-DRAM (emulated via ramdisk)

• 4GB flash SSD

Page 6: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Impact on Application Performance

• Experimental result

2.1X 1.7X

* System perf.

- ~ 2.1X improved

Page 7: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Impact on Application Performance

• Experimental result

Marginal gain

Performance drop by 50%!

* System perf.

- ~ 2.1X improved

* Application perf.

- ~ 50% degraded

Page 8: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

What’s the Problem?

• Criticality-agnostic contention

Page 9: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

• Different write criticality

Backing Storage

Operating System

P1

Client

P2

Request Response Application

Application performance

NVWC

P3

Page 10: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

• Different write criticality

Backing Storage

Operating System

P1

Client

P2

Request Response Application

NVWC

P3 Background

process/thread

Page 11: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

• Different write criticality

Backing Storage

Operating System

P1

Client

P2

Request Response Application

NVWC

Critical Non-critical

P3

Page 12: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

• Different write criticality

Backing Storage

Operating System

P1

Client

P2

Request Response Application

NVWC

Critical Non-critical

P3

* Contentions

- Capacity contention

- Bandwidth contention

Page 13: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

Backing Storage

Operating System

P1

Client

P2

Request Response Application

Bounded writeback throughput

Critical Non-critical

P3

Frequent write stalls

• Capacity contention

Page 14: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Criticality-Agnostic Contention

Backing Storage

P1

Client

P2

Request Response Application

Sufficient free blocks

Critical Non-critical

P3

Excessive queueing delay

C Head NC NC NC NC NC WB WB WB WB

• Bandwidth contention

Page 15: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Request-oriented caching policy

Our Approach

Backing Storage

Operating System

P1 P2

Application

NVWC

Critical Non-critical

P3

Caching critical writes only

* Definitions

- Critical process (CP): a

process handling request

- Critical write: a write

awaited by a critical proc.

Client

CP NCP NCP

Page 16: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Challenge

• How to accurately detect critical writes

• Types of critical write • Sync. writes from critical processes

• Dependency-induced critical writes

• Process dependency-induced

• I/O dependency-induced

Page 17: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Process dependency

B3 B4 B5

Dependency Problem

NCP

CP

Lock

Wake

Wait for B1

Process Dep.

B1

Page 18: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

B1 B2

Dependency Problem

• I/O dependency

NCP

CP

Sync Complete

I/O Dep.

Wait for B2

B3 B4 B5

* Example scenarios: - CP fsync() to a block under writeback issued by NCP - CP tries to overwrite fs journal buffer under writeback

Page 19: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Critical Write Detection

• Critical process identification • Application-guided identification

Page 20: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Critical Process Identification

• Application-guided identification

NCP NCP CP CP

Operating System

NVWC

API

Backing Storage

Client 1 Client 2

Application

NCP

Page 21: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Critical Write Detection

• Critical process identification • Application-guided identification

• Dependency resolution • Criticality inheritance protocols

• Process criticality inheritance

• I/O criticality inheritance

• Blocking object tracking

Page 22: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Critical Write Detection

• Critical process identification • Application-guided identification

• Dependency resolution • Criticality inheritance protocols

• Process criticality inheritance

• I/O criticality inheritance

• Blocking object tracking

Page 23: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

B1 B1

Criticality Inheritance Protocols

• Process criticality inheritance

Lock Wake

Inherit

B2 B3 B4

NCP

CP

Page 24: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

B2

Criticality Inheritance Protocols

• I/O criticality inheritance

Sync

Complete Reissue

Discard B3 B4 B5

B1 B2

Key issue: caching the dependent write outstanding to disk w/o side effects

NCP

CP

Page 25: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Evaluation

• Implementation on Linux 3.13 w/ FlashCache 3.1

• Application studies • PostgreSQL database

• Redis key-value store

Client 1

Backend1

Backend2

Client 2

Log writer

Writer Check pointer

Backend1

Backend2

Client 1,2,3,…

Master Log

rewriter Snap

shotter Master

Page 26: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

FlashCache

Server Machine

TPC-C / YCSB

Client Machine

1Gbps

Page 27: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default)

FlashCache

Server Machine

No discretion

TPC-C / YCSB

Client Machine

1Gbps

Page 28: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default) - SYNC

FlashCache

Server Machine

Sync. writes

TPC-C / YCSB

Client Machine

1Gbps

Page 29: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default) - SYNC - CP

FlashCache

Server Machine

CP sync. writes

TPC-C / YCSB

Client Machine

1Gbps

Page 30: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default) - SYNC - CP - CP+PI

FlashCache

Server Machine

+ Process criticality

inheritance

TPC-C / YCSB

Client Machine

1Gbps

Page 31: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default) - SYNC - CP - CP+PI - CP+PI+IOI FlashCache

Server Machine

+ I/O criticality

inheritance

TPC-C / YCSB

Client Machine

1Gbps

Page 32: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

• Experimental setup

Evaluation

PostgreSQL / Redis

4GB ramdisk / 256GB SSD

10K RPM HDD x2

* Caching policies - ALL (default) - SYNC - CP - CP+PI - CP+PI+IOI - WAL (PostgreSQL)

FlashCache

TPC-C / YCSB

Client Machine Server Machine

1Gbps

Trx log writes

Page 33: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

PostgreSQL Performance

• TPC-C workload w/ ramdisk

Sufficient Scarce

80% Same performance w/ 72% less cached writes

Our scheme resolves capacity contention & runtime dependencies

Page 34: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

PostgreSQL Performance

• TPC-C workload w/ SSD

Sufficient Sufficient

2.2X

Our scheme resolves bandwidth contention & runtime dependencies

Page 35: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Redis Performance

• Update-heavy workload w/ 16GB SSD

47% better throughput Improved tail latency

13X better @ 99.9th %ile

(50ms vs. 649ms)

Our scheme improves request throughput & request latency

Page 36: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Conclusions

• Key observation • Each write has different performance-criticality

• Request-oriented caching policy • Solely utilizes NVWC for application performance

• Improves performance while reducing cached writes

• Future work • System-level critical process identification

• Application to user-interactive environments

Page 37: Request-Oriented Durable Write Caching for …Request-Oriented Durable Write Caching for Application Performance Non-volatile Write Cache • Volatile DRAM cache is ineffective for

Thank You!

• Questions and comments

• Contact

[email protected]