Skip to main content
RunBook Academy

CephLXX · Network PerformanceNetwork Performance

Switch saturation and buffering

Advanced⏱ ~18 minethtoolnetstatiperf3

What you'll learn

  • Explain how switch buffering affects Ceph
  • Read switch and host counters for evidence
  • Recognise incast and its symptoms
  • Mitigate switch-level congestion

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

Ceph produces a traffic pattern — many senders to one receiver — that exhausts switch buffers more readily than most workloads, and the resulting loss degrades Ceph disproportionately.

Incast

a client reads an erasure-coded object
  → k OSDs respond simultaneously
  → all responses converge on one switch port
  → the port's buffer must absorb k × chunk size instantly
  → if it cannot, frames are dropped
flowchart LR
  A[OSD 1] --> S[Switch port buffer]
  B[OSD 2] --> S
  C[OSD 3] --> S
  D[OSD 4] --> S
  S --> E[Client port<br/>buffer overflows]

This pattern is called incast, and it is worse with wider erasure coding, larger objects, and shallower switch buffers.

Reading the evidence

# host side
IFACE=bond0
ethtool -S ${IFACE} | grep -iE 'drop|discard|missed|no_buffer|pause'
netstat -s | grep -iE 'retransmit|timeout|listen drops'
ip -s link show ${IFACE}
# TCP-level evidence of loss
ss -ti | grep -oE 'retrans:[0-9]+/[0-9]+' | head

On the switch, the counters that matter are output discards and buffer occupancy:

show interface ethernet 1/12 counters errors
show queuing interface ethernet 1/12
show hardware internal buffer info pkt-stats

Output discards on a port facing a Ceph client or OSD are direct evidence of incast.

Symptoms in Ceph

SymptomMechanism
Latency spikes under load, not at restbuffer fills only under load
Slow ops with no device correlationframes dropped, TCP retransmits
OSDs flappingheartbeats lost among dropped frames
Recovery far slower than link speed suggestsretransmission overhead
EC pools worse than replicatedwider fan-in per operation

The last is diagnostic: if an EC pool is disproportionately affected relative to a replicated one on the same hardware, incast is a strong candidate.

Mitigations

MitigationEffect
Deeper-buffer switchesabsorbs the burst
Priority flow control (PFC)pauses senders instead of dropping
ECN with a congestion-aware TCPsignals before loss
Narrower EC profilesfewer simultaneous senders
Smaller osd_max_backfillsfewer concurrent bulk transfers
More uplink capacityreduces oversubscription
# reduce the burst Ceph generates
ceph config set osd osd_max_backfills 2
ceph config set osd osd_recovery_max_active_hdd 3

Reducing what Ceph sends is the mitigation available without touching the network, and it is often enough during an incident while a fabric change is planned.

Quiz

Knowledge check · 4 questions

  1. Q1. Why does a small percentage of incast loss produce disproportionately large latency spikes?

  2. Q2. An EC pool performing far worse than a replicated pool on identical hardware is better evidence about the switch than about erasure coding.

  3. Q3. Mitigate switch congestion during an incident.

    Latency spikes correlate with recovery traffic. Host interface counters show discards and netstat shows retransmits. The switch fabric cannot be changed for at least a quarter.

  4. Q4. What is incast and why does Ceph produce it?

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

Production discipline

Check switch output discards and host retransmit counters before attributing latency to devices; incast loss produces spikes far larger than the loss rate suggests. Reducing recovery concurrency lowers the burst Ceph generates and is the only mitigation available on an incident timescale.

Cross-course references

  • Kubernetes: fan-out request patterns produce the same incast on node interfaces
  • Linux: TCP retransmission timeouts dominate tail latency in any lossy fan-in pattern