caching on pmem: an iterative approach

20
Caching on PMEM: An Iterative Approach Yao Yue ( @thinkingfish ) Twitter 1

Upload: others

Post on 12-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Caching on PMEM: An Iterative Approach

Caching on PMEM:An Iterative Approach

Yao Yue (@thinkingfish)Twitter

1

Page 2: Caching on PMEM: An Iterative Approach

Caching at Twitter

Testing at Intel

Testing at Twitter

A New Design

2Santa Clara, CANovember 2020

Page 3: Caching on PMEM: An Iterative Approach

Caching at Twitter

3Santa Clara, CANovember 2020

Page 4: Caching on PMEM: An Iterative Approach

4

Caching at Twitter

Clusters>300 in prod

Hostsmany thousands

Instancestens of thousands

Job size2-6 core, 4-48 GiB

Provisioning

QPSmax 50M (single cluster)

SLOp999 < 5ms*

Performance

Maintainable Same codebase Retain high-level APIs

Operable Flexible configuration Predictable performance

ConstraintsSanta Clara, CANovember 2020

A large scale analysis of hundreds of in-memory cache clusters at Twitter [OSDI’20]

Page 5: Caching on PMEM: An Iterative Approach

Quick Cache Facts

5Santa Clara, CANovember 2020

Memory hungryThroughput bottleneck on host networking stack

Mission critical ⇒ availability

Large resource footprint ⇒ cost

Lots of instances ⇒ fast restart

Page 6: Caching on PMEM: An Iterative Approach

Why PMEM?

Cache more data per instance• Reduce TCO if memory bound• Improve hit rate

Take advantage of persistency• Graceful shutdown and faster rebuild• Improve data availability during maintenance

6Santa Clara, CANovember 2020

availability

cost

fast restart

Page 7: Caching on PMEM: An Iterative Approach

Master Plan

Use a modular framework

Test• Intel’s equipment• Twitter’s equipment

A New Design7

Santa Clara, CANovember 2020

Pelikan: A Modular Cache

Page 8: Caching on PMEM: An Iterative Approach

8

Test Setup

Instance density18-30 instances / host

Object size64 - 2048 bytes

Dataset size4GiB - 32 GiB / instance

# of Connection / instance100 / 1000

Focus on… Latency first, throughput second PMEM vs. DRAM Memory mode vs. AppDirect

Understand… Scalability with dataset size Bottleneck analysis

Santa Clara, CANovember 2020

Page 9: Caching on PMEM: An Iterative Approach

Testing at Intel

9Santa Clara, CANovember 2020

Page 10: Caching on PMEM: An Iterative Approach

Intel: Memory Mode, Unmodified Code

10Santa Clara, CANovember 2020

Test Config· 30 jobs/host· key size 32B· 100 conn/job· 90R:10W

Hardware Config (Intel lab)· 2 X Intel Xeon 8160 (24)· 12 X 32GB DIMM· 12 X 128GB AEP· 2-2-2 config· 1 X 25Gb NIC

Page 11: Caching on PMEM: An Iterative Approach

Intel: AppDirect Mode, Slightly Modified Code

11Santa Clara, CANovember 2020

Datapool Abstraction with PMDK

~300 LOC in C

Page 12: Caching on PMEM: An Iterative Approach

Intel: AppDirect Mode, Slightly Modified Code

12Santa Clara, CANovember 2020

Test Config· 24 jobs/host· key size 32B· 100 conn/job· 90R:10W

Hardware Config (Intel lab)· 2 X Intel Xeon 8160 (24)· 12 X 32GB DIMM· 12 X 128GB AEP· 2-2-2 config· 1 X 25Gb NIC

Page 13: Caching on PMEM: An Iterative Approach

Testing at Twitter

13Santa Clara, CANovember 2020

Page 14: Caching on PMEM: An Iterative Approach

Twitter: memory mode, SLO

14Santa Clara, CANovember 2020

p999 max = 16msp9999 max = 148ms

throughput 1.08M QPS

Hardware Config (Twitter prod)· 2 X Intel Xeon 8160 (20)· 12 X 16GB DIMM· 4 X 512GB AEP· 2-1-1 config· 1 X 25Gb NIC

Test Config· 20 jobs/host· key size 64B· 1000 conn/job· Read-only

Page 15: Caching on PMEM: An Iterative Approach

Twitter: AppDirect mode, SLO

15Santa Clara, CANovember 2020

p999 max = 1.4msp9999 max = 2.5ms

throughput 1.08M QPS

Hardware Config (Twitter prod)· 2 X Intel Xeon 8160 (20)· 12 X 16GB DIMM· 4 X 512GB AEP· 2-1-1 config· 1 X 25Gb NIC

Test Config· 20 jobs/host· key size 64B· 1000 conn/job· Read-only

Page 16: Caching on PMEM: An Iterative Approach

A New Design

16Santa Clara, CANovember 2020

Page 17: Caching on PMEM: An Iterative Approach

Segcache: Log-like storage, compact hash table

Segment-based storage (inspired by log structure) Hash table: multi-occupancy block, chained

17Santa Clara, CANovember 2020

Goals Minimize random reads Minimize random writes Minimize metadata overhead

Page 18: Caching on PMEM: An Iterative Approach

Segcache: AppDirect mode, Microbenchmark

18Santa Clara, CANovember 2020

Hardware Config (Twitter prod)· 2 X Intel Xeon 8160 (20)· 12 X 16GB DIMM· 4 X 512GB AEP· 2-1-1 config· 1 X 25Gb NIC

Page 19: Caching on PMEM: An Iterative Approach

Caching on PMEM: Takeaways

19Santa Clara, CANovember 2020

Avoid turning PMEM into new bottleneck AppDirect is a clear winner

• But Memory Mode served its purpose along the way Due diligence pays off Innovate as needed

Future work: graceful shutdown and fast rebuild

Page 20: Caching on PMEM: An Iterative Approach

Thank You!

https://pelican.io@pelican_cache

20Santa Clara, CANovember 2020