Skip to main content
RunBook Academy

CephLXVIII · OSD LatencyOSD Latency

The device latency floor

Intermediate⏱ ~17 mincephfio

What you'll learn

  • State the latency floor for each device class
  • Compute the achievable cluster latency from it
  • Set expectations against the floor
  • Identify when a device is below its class

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

A request for 1 ms write latency on an HDD-backed pool cannot be met by any configuration change. Knowing the floor turns that from an investigation into a conversation about hardware.

The floors

Device4k random read qd14k random write qd1Sustained random IOPS
HDD 7200 rpm5–15 ms5–15 ms80–180
SATA SSD0.1–0.5 ms0.05–0.3 ms20k–90k
SAS SSD0.1–0.3 ms0.05–0.2 ms50k–200k
NVMe TLC60–150 µs20–80 µs200k–800k
NVMe Optane10–30 µs10–20 µs500k+

HDD latency is mechanical: a seek plus rotational delay. No firmware, driver, or Ceph setting reduces it.

From device floor to cluster latency

client write latency ≥ network RTT
                     + OSD processing
                     + slowest replica's device write

For a size=3 pool on HDD with a 0.2 ms network RTT:

≈ 0.2 ms (network)
+ 0.5 ms (OSD processing)
+ 10  ms (slowest of three HDD writes)
≈ 11 ms, before any queueing

The device term dominates so completely that everything else is noise — which is precisely why HDD clusters are configured with NVMe for the DB and WAL.

What the DB device changes

ceph osd metadata 12 | python3 -c '
import sys,json; d=json.load(sys.stdin)
print("data:", d.get("bluestore_bdev_type"), d.get("bluestore_bdev_dev_node"))
print("db:  ", d.get("bluefs_db_type"), d.get("bluefs_db_dev_node"))'

BlueStore’s metadata operations — the RocksDB writes that record where data lives — go to the DB device. On an HDD OSD with an NVMe DB, those operations run at NVMe latency while the data writes run at HDD latency. For metadata-heavy workloads the improvement is substantial; for large-object streaming it is marginal.

Setting expectations

RequestAchievable on HDDAchievable on NVMe
p50 write under 1 msnoyes
p50 write under 15 msyesyes
50k IOPS per OSDnoyes
150 IOPS per OSDyestrivially
# measure your actual floor rather than assuming the table
fio --name=floor --filename=/dev/sdX --direct=1 --rw=randread \
    --bs=4k --iodepth=1 --runtime=30 --time_based --readonly

Identifying a device below its class

A device measuring well above its class range is failing or misconfigured:

smartctl -a /dev/sdX | grep -iE 'pending|reallocated|error'
smartctl -a /dev/sdX | grep -i 'rotation rate'   # confirm it is what you think
nvme smart-log /dev/nvme0n1 | grep -iE 'percentage_used|media_errors'
hdparm -W /dev/sdX                                # write cache state

A consumer SSD in a cluster is a common finding: it meets its class latency briefly and then collapses when its SLC cache is exhausted.

Quiz

Knowledge check · 4 questions

  1. Q1. Why do enterprise SSDs with power-loss protection outperform faster-specified consumer drives in Ceph?

  2. Q2. A short benchmark is sufficient to evaluate an SSD for OSD use.

  3. Q3. Respond to a latency requirement.

    An application team requires p50 write latency under 2 ms from an HDD-backed pool with size=3. The current p50 is 12 ms. They ask what tuning would achieve it.

  4. Q4. What does an NVMe DB device improve on an HDD-backed OSD, and what does it not?

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

Production discipline

Measure your devices’ actual floor with a queue-depth-1 test rather than assuming published figures, and run long enough to exhaust any SLC cache. When a latency requirement is below the device floor, present the decomposition — it converts an open-ended tuning request into a hardware decision.

Cross-course references

  • Kubernetes: node hardware sets a floor no scheduling policy can beat
  • Linux: fsync latency without write cache protection is the same order-of-magnitude effect