Durable disk write with io_uring
disk_write_io_uring · compared along a sweep · 46 Series on 8 machine types · AWS us-east-2
CPU
Disk
Queue depth
| Compare | Queue depth | Variant | Machine | P50 | P99 | Rate | Unit cost | Runs |
|---|---|---|---|---|---|---|---|---|
| m6id.2xlarge | ||||||||
| QD 1 | m6id.2xlarge | 30.34 µs | 45.31 µs | 133.3 MB/s | $0.146 /10k IOPS·h | 1 | ||
| QD 4 | m6id.2xlarge | 59.14 µs | 64.77 µs | 274.8 MB/s | $0.0708 /10k IOPS·h | 1 | ||
| QD 16 | m6id.2xlarge | 236.5 µs | 244.7 µs | 278.3 MB/s | $0.0699 /10k IOPS·h | 1 | ||
| QD 64 | m6id.2xlarge | 946.2 µs | 970.8 µs | 278.3 MB/s | $0.0699 /10k IOPS·h | 1 | ||
| QD 128 | m6id.2xlarge | 1.892 ms | 2.703 ms | 278.3 MB/s | $0.0699 /10k IOPS·h | 1 | ||
| QD 256 | m6id.2xlarge | 3.686 ms | 5.341 ms | 278.3 MB/s | $0.0699 /10k IOPS·h | 1 | ||
| i4i.2xlarge | ||||||||
| QD 1 | i4i.2xlarge | 25.98 µs | 38.66 µs | 153.8 MB/s | $0.184 /10k IOPS·h | 5 | ||
| QD 4 | i4i.2xlarge | 41.22 µs | 114.2 µs | 377.5 MB/s | $0.0747 /10k IOPS·h | 5 | ||
| QD 16 | i4i.2xlarge | 144.4 µs | 226.3 µs | 451.1 MB/s | $0.0623 /10k IOPS·h | 5 | ||
| QD 64 | i4i.2xlarge | 577.5 µs | 667.6 µs | 451.1 MB/s | $0.0623 /10k IOPS·h | 5 | ||
| QD 128 | i4i.2xlarge | 1.155 ms | 1.270 ms | 451.1 MB/s | $0.0623 /10k IOPS·h | 5 | ||
| QD 256 | i4i.2xlarge | 2.310 ms | 3.457 ms | 451.1 MB/s | $0.0623 /10k IOPS·h | 5 | ||
Compared:m6id.2xlargei4i.2xlarge
Saturation: throughput against P99
one line per disk and machine, a point per queue depth; log scalesTail: P50 → P99.9
per operation, log scaleLatency histograms
pooled across counted Runs, each to its own peak
(one request each to the data API)
Over time
newest counted Runs, each Run's P50(one request each to the data API)
What this measures
How many writes a disk completes when one thread keeps queue_depth of them submitted, O_DIRECT through io_uring, each durable when it completes (RWF_DSYNC) or not, with the time of each write from submission to reap binned in an op_histogram.
What it does not measure
queue_depthcounts writes submitted and not yet reaped, not writes the device held at any instant (as indisk_read_io_uring).- A histogram time is submission to reap: it includes any time a completion waited in the ring while the thread handled another. It is not the device's own service time.
- Timing each write costs two clock reads per repetition inside the measured loop (
clock_read_nsinstartedeach).
Code & config
Benchmark docsSeries JSONi4i.2xlarge · instance store · QD 4
223 sqe->rw_flags = c->dsync ? RWF_DSYNC : 0;// …235 if (c->pending) {236 uint64_t now = lm_now_ns();237 for (unsigned i = 0; i < c->pending; i++) c->submit_ns[c->pending_slots[i]] = now;// …258static inline unsigned reap(ctx_t *c) {259 ring_t *r = &c->ring;260 unsigned head = atomic_load_explicit(r->cq_head, memory_order_relaxed);261 while (head == atomic_load_explicit(r->cq_tail, memory_order_acquire)) enter(c, true);262 uint64_t now = c->timing ? lm_now_ns() : 0;// …266 atomic_store_explicit(r->cq_head, head + 1, memory_order_release);267 if (c->timing) lm_hist_add(c->times[c->counted], now - c->submit_ns[slot]);// …280__attribute__((noinline))281static uint64_t complete_one(void *arg) {282 ctx_t *c = (ctx_t *)arg;283 unsigned slot = reap(c);284 prepare(c, slot);285 return c->sum;286}// …427 lm_deferred_measure(&samples, complete_one, &c, on_phase);
Configuration
- benchmarkdisk_write_io_uring
- buildstatic
- instancei4i.2xlarge
- regionus-east-2
- azuse2-az3
- params.accessrandom
- params.dir/mnt/lm/instance-store
- params.diskinstance_store
- params.file_bytes1073741824
- params.queue_depth4
- params.request_bytes4096
- params.syncdsync