Skip to main content
RunBook Academy

CephXII · BlueStoreBlueStore

BlueFS, DB, and WAL — the three pieces inside BlueStore

Intermediate⏱ ~16 mincephceph-volumeceph-bluestore-tool

What you'll learn

  • Describe the roles of block, block.db, and block.wal
  • Explain what BlueFS is and why it exists
  • Size a DB device for a given workload
  • Detect and respond to DB spillover

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

Almost every BlueStore performance decision comes down to which of three devices holds which data. Getting the split right transforms HDD OSDs; getting it wrong wastes NVMe.

The three roles

block       object data — the bulk. Raw device, no filesystem.
block.db    RocksDB: object metadata, allocation state, omap.
block.wal   RocksDB write-ahead log: durability ordering for metadata.

If block.db is not specified, RocksDB lives on block. If block.wal is not specified, the WAL lives wherever the DB is. So there are three practical layouts:

LayoutSuits
all on one deviceNVMe OSDs
block on HDD, db+wal on NVMeHDD OSDs — the important case
block on HDD, db on SSD, wal on NVMerare; only with a real measurement

The third layout is usually unnecessary complexity. Put DB and WAL on the same fast device.

What BlueFS is

RocksDB expects a filesystem. BlueStore does not have one, so it provides BlueFS: a minimal, append-oriented filesystem that supports exactly what RocksDB needs and nothing more.

BlueFS is why you cannot mount a BlueStore device with anything else, and why ceph-bluestore-tool exists.

ceph-bluestore-tool show-label --dev /dev/sdb1
ceph daemon osd.12 bluefs stats

Sizing the DB device

The long-standing guidance is roughly 4% of the block device as a starting point. That is a floor, not a target, and the right number depends on workload:

WorkloadDB per TB of data device
RBD (large objects, little omap)20-40 GB
CephFS data pool40 GB
RGW (large omap from bucket indexes)60-100 GB or more

RGW is the case that breaks naive sizing. Bucket indexes live in omap, omap lives in RocksDB, and a bucket with tens of millions of objects generates a great deal of it.

service_type: osd
service_id: hdd-with-nvme-db
placement:
  host_pattern: 'ceph-*'
spec:
  data_devices:
    rotational: true
  db_devices:
    rotational: false
  block_db_size: 64G

Verifying the layout

ceph-volume lvm list
ceph osd metadata 12 | jq '.bluestore_bdev_type, .bluefs_db_type, .bluefs_wal_type'
ceph daemon osd.12 bluefs stats

ceph osd metadata is the quickest way to confirm across a cluster that DB devices are where you think they are — a check worth running after any hardware change, because an OSD recreated without the db_devices filter comes back with everything on the slow device and nothing reports it as wrong.

Quiz

Knowledge check · 4 questions

  1. Q1. What happens when a BlueStore block.db device fills?

  2. Q2. A DB device sized at 4% of the data device is adequate for all workloads.

  3. Q3. After replacing several failed HDDs, the new OSDs perform noticeably worse than their neighbours. Investigate.

    Cluster of 60 HDD OSDs, originally built with NVMe DB devices at 64 GB per OSD. Six drives failed over recent months and were replaced. The replacements were created with ceph orch apply osd --all-available-devices as a quick action during each incident. The six replacement OSDs show commit latency around 5 times the others in ceph osd perf.

  4. Q4. Explain what BlueFS is and why BlueStore needs it.

Passing score: 75%. Answers are checked in this browser.

Production discipline

Size DB devices generously at build time, because spillover has no runtime fix and recreating an OSD is the only remedy. Use workload rather than a flat percentage: RGW omap from bucket indexes dwarfs what an RBD pool of the same size needs. Verify DB placement with ceph osd metadata after any hardware change, since an OSD recreated without the db_devices filter silently puts RocksDB on the spindle and nothing reports it as wrong.

Cross-course references

  • Ceph: Part XII lesson on the DB device for RocksDB in depth.
  • Ceph: Part III (Storage Hardware) for choosing the fast device.
  • Ceph: Part XLV (RADOS Gateway) for why RGW omap is large.