CephLXX · Network PerformanceNetwork Performance
Switch saturation and buffering
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
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
| Symptom | Mechanism |
|---|---|
| Latency spikes under load, not at rest | buffer fills only under load |
| Slow ops with no device correlation | frames dropped, TCP retransmits |
| OSDs flapping | heartbeats lost among dropped frames |
| Recovery far slower than link speed suggests | retransmission overhead |
| EC pools worse than replicated | wider 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
| Mitigation | Effect |
|---|---|
| Deeper-buffer switches | absorbs the burst |
| Priority flow control (PFC) | pauses senders instead of dropping |
| ECN with a congestion-aware TCP | signals before loss |
| Narrower EC profiles | fewer simultaneous senders |
Smaller osd_max_backfills | fewer concurrent bulk transfers |
| More uplink capacity | reduces 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
Q1. Why does a small percentage of incast loss produce disproportionately large latency spikes?
Q2. An EC pool performing far worse than a replicated pool on identical hardware is better evidence about the switch than about erasure coding.
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.
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