28
Bluestore: A new storage engine for Ceph Allen Samuels, Engineering Fellow March 4, 2017 3/4/2017 ©2017 Western Digital Corporation or its affiliates. All rights reserved.

Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Embed Size (px)

Citation preview

Page 1: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Bluestore: A new storage

engine for Ceph

Allen Samuels, Engineering Fellow

March 4, 2017

3/4/2017©2017 Western Digital Corporation or its affiliates. All rights reserved.

Page 2: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Semantics

Conceptual Ceph System Model

Gateway

OSD

Media

OSD

Media

OSD

Media

OSD

Media

Gateway Gateway

Client/gateway-specificBlock, File, Object, HDFS, etc.

RADOS

Raw Storage

Page 3: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Terminology

•Gateway – implements client protocol using RADOS

–LibRBD, KRBD, RGW, CephFS, etc.

•RADOS – cluster-wide storage protocol

–Transactional, Durable and Available storage

•OSD – Object Storage Daemon

–Raw object storage for RADOS

–Limited durability and availability

Page 4: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Inside the OSD

ObjectStore

FileStore

Client/Gateway OperationsPeer-to-Peer Cluster

Management

Network Interface

Write Ahead Log

XFS KeyValueDB

OSD

Page 5: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Ceph Deployment Options

•Ceph Journal on Flash

•Ceph Metadata on Flash

•All Flash

Page 6: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Ceph Journal on Flash

•Journal consumes only a tiny fraction of one SSD

–Constrained by spills to HDD through XFS

• Average SSD BW is much less than 100 MB/Sec

• Space consumption is much less than < 10GB

•Typical usage aggregates multiple OSDs / SSD

–Partitioning of SSD is straightforward

–New failure domain affects durability

–Resource planning is simple

Page 7: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

SSD Provisioning/Selection

•Multiplexing OSDs means random writes for SSD

–Journal write size is 4K + RADOS transaction size

–Overall rate still limited by background destage to HDD

•Right-size the SSD logs

–~1 minute of max throughput is only 6-8GB

–Small log wraparound is implicit “trim”

–SSD Garbage collection is minimized

•Should see best-case endurance for SSD

–Minimal write amplification due to garbage collection

Page 8: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Ceph Metadata on Flash

•Not much value for RBD

–Ceph xattrs generally stored in inode

•Will improve Object (S3/Swift) throughput

–But still have XFS metadata on HDD

–Difficult to estimate improvement

•Provisioning harder to estimate

–Bucket sharding can help with space allocation

Page 9: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Optimizing Ceph for the future

•With the vision of an all flash system, SanDisk engaged with the Ceph community in 2013

•Self-limited to no wire or storage format changes

•Result: Jewel release is up to 15x vs. Dumpling

–Read IOPS are decent, Write IOPS still suffering

•Further improvements require breaking storage format compatibility

Page 10: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

What’s wrong with FileStore?

•Metadata split into two disjoint environments

–Ugly logging required to meet transactional semantics

•Posix directories are poor indexes for objects

•Missing virtual copy and merge semantics

–Virtual copies become actual copies

•BTRFS hope didn’t pan out• Snapshot/rollback overhead too expensive for frequent use

• Transaction semantics aren’t crash proof

Page 11: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

What’s wrong with FileStore?

•Bad Write amplification

–Write ahead logging for everything

–levelDB (LSM)

–Journal on Journal

•Bad jitter due to unpredictable file system flushing

–Binge/purge cycle is very difficult to ameliorate

•Bad CPU utilization

–syncfs is VERY expensive

Page 12: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore a rethink of ObjectStore

•Original implementation written by Sage late in ‘15

•Tech preview available in Jewel Release

•First full release in Kraken Release

•Preserves wire compatibility

•Storage Format incompatible

•Target Write performance 2x FileStore

•Target Read performance FileStore

Page 13: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore a rethink of ObjectStore

•Efficiently Support current and future HW types

–SCM, Flash, PMR and SMR hard drives, standalone or hybrid combinations

•Improve performance

–Eliminate double write when unneeded

–Better CPU utilization through simplified structure and tailored algorithms

•Much better code stability

Page 14: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore a rethink of ObjectStore

•Wire compatible but not data format compatible

–Mixed FileStore/Bluestore nodes in a cluster transparently supported

–FileStore continues for legacy systems

–In place upgrade/conversion supported via node rebuild

Page 15: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore Enhanced Functionality

•Checksum on all read operations

–SW defined data integrity

•Inline Compression

–Pluggable, Snappy and Zlib initially

•Virtual clone

–Efficient implementation of snapshots and clones

•Virtual move

–Enables RBD/CephFS to directly use erasure coded pools

Page 16: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore

ObjectStore

BlueStore

KeyValueDB

DataMetaData

BlueFS

Operation Decoder

Journal

Client/Gateway Operations Peer-to-Peer Cluster Management

Network Interface

Page 17: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore Architecture

•One, Two or Three raw block devices

–Data, Metadata/WAL and KV Journaling

–When combined no fixed partitioning is needed

•Use a single transactional KV store for all metadata

–Semantics are well matched to ObjectStore transactions

•Use raw block device for data storage

–Support Flash, PMR and SMR HDD

Page 18: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Two Write Path Options

•Direct Write

–(1) Write data to unused space (Copy-on-write style)

• Trivially crash-proof

–(2) Modify metadata through single KV transaction

• Transaction semantics of KV store shine here!

–(3) Send client completion signal

Page 19: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

Two Write Path Options

•Write-ahead Log (WAL)

–(1) Commit data and metadata into single KV transaction

–(2) Send client completion signal

–<later>

–(3) Move data from KV into destination (Idempotent and crash restartable)

–(4) Update KV to remove data and WAL operation

Page 20: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore vs FileStore (HDD)

0

100

200

300

400

500

600

700

800

900

BluestoreHDD/HDD

Filestore

IOP

S

RBD 4K Random Writes

3X

EC42

EC51

0

500

1000

1500

2000

2500

3000

3500

4000

BluestoreHDD/HDD

Filestore

IOP

S

RBD 4K Random Reads

3X

EC42

EC51

* Mark Nelson (RedHat) email 3-3-17, Master, 4 nodes of: 2xE5-2650v3, 64GB, 40GbE, 4xP3700, 8x1TB Constellation ES.2

Page 21: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore vs FileStore (Hybrid)

0

200

400

600

800

1000

1200

BluestoreHDD/NVMe

Filestore

IOP

S

RBD 4K Random Writes

3X

EC42

EC51

0

500

1000

1500

2000

2500

3000

3500

4000

BluestoreHDD/NVMe

Filestore

IOP

S

RBD 4K Random Reads

3X

EC42

EC51

* Mark Nelson (RedHat) email 3-3-17, Master, 4 nodes of: 2xE5-2650v3, 64GB, 40GbE, 4xP3700, 8x1TB Constellation ES.2

Page 22: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore vs FileStore (Flash)

0

10000

20000

30000

40000

50000

60000

70000

BluestoreNVMe

Filestore

IOP

S

RBD 4K Random Writes

3X

EC42

EC51

0

20000

40000

60000

80000

100000

120000

140000

160000

BluestoreNVMe

Filestore

IOP

S

RBD 4K Random Reads

3X

EC42

EC51

* Mark Nelson (RedHat) email 3-3-17, Master, 4 nodes of: 2xE5-2650v3, 64GB, 40GbE, 4xP3700, 8x1TB Constellation ES.2

Page 23: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore vs FileStore

0

100

200

300

400

500

600

700

1 Bucket1 RGW Server

128 Buckets 4 Buckets4 RGW Servers

512 Buckets RadosBench

Th

rou

gh

pu

t (M

B/s

)

3X Replication RadosGW Write Tests

Filestore 512KB Chunks

Filestore 4MB Chunks

Bluestore 512KB Chunks

Bluestore 4MB Chunks

* Mark Nelson (RedHat) email 3-3-17, Master, 4 nodes of: 2xE5-2650v3, 64GB, 40GbE, 4xP3700, 8x1TB Constellation ES.2

Page 24: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore vs FileStore

0

200

400

600

800

1000

1200

1400

1 Bucket1 RGW Server

128 Buckets 4 Buckets4 RGW Servers

512 Buckets RadosBench

Th

rou

gh

pu

t (M

B/s

)

4+2 Erasure Coding RadosGW Write Tests

Filestore 512KB Chunks

Filestore 4MB Chunks

Bluestore 512KB Chunks

Bluestore 4MB Chunks

* Mark Nelson (RedHat) email 3-3-17, Master, 4 nodes of: 2xE5-2650v3, 64GB, 40GbE, 4xP3700, 8x1TB Constellation ES.2

Page 25: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

KV Store Options

•RocksDB is a Facebook extension of levelDB

–Log Structured Merge (LSM) based

–Ideal when metadata is on HDD

–Merge is effectively host-based GC when run on flash

•ZetaScale™ from SanDisk® now open sourced

–B-tree based

–Ideal when metadata is on Flash

–Uses device-based GC for max performance

Page 26: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore ZetaScale v RocksDB Performance

0.436

1.005

3.970

0.95

2.83

9.29

0.000

1.000

2.000

3.000

4.000

5.000

6.000

7.000

8.000

9.000

10.000

0/100 70/30 100/0

IO

Ps i

n K

s

Read/Write Ratio

Random Read/Write 4K IOPs per OSD

BlueStore(RocksDB)

BlueStore(ZetaScale)

Test Setup:1 OSD, 8TB SAS SSD, 10GB ram, Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz , fio, 32 thds, 64 iodepth, 6TB dataset, 30 min

Page 27: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

BlueStore Status

•Exceeding design goal of 2x write performance

•Available in Kraken Release

–Ready for experimentation

–Not ready for production

•Targeted as default in Luminous Release

–FileStore NOT going away

Page 28: Bluestore: A new storage engine for Ceph - SCALE 16x · Semantics Conceptual Ceph System Model Gateway OSD Media OSD Media OSD Media OSD Media … … Gateway Client/gateway-specific

3/4/2017©2017 Western Digital Corporation or its affiliates. All rights reserved. 28