Disk read with io_uring
disk_read_io_uring · compared along a sweep · 50 Series on 8 machine types · AWS us-east-2
CPU
Access
Disk
Request
Queue depth
| Compare | Queue depth | Variant | Machine | P50 | P99 | Rate | Unit cost | Runs |
|---|---|---|---|---|---|---|---|---|
| i4g.2xlarge | ||||||||
| QD 64 | i4g.2xlarge | 505.9 µs | 610.3 µs | 512.8 MB/s | $0.0493 /10k IOPS·h | 4 | ||
| m6id.2xlarge | ||||||||
| QD 1 | m6id.2xlarge | 78.34 µs | 91.65 µs | 49.96 MB/s | $0.389 /10k IOPS·h | 1 | ||
| QD 4 | m6id.2xlarge | 84.48 µs | 110.1 µs | 188.9 MB/s | $0.103 /10k IOPS·h | 1 | ||
| QD 16 | m6id.2xlarge | 113.2 µs | 158.7 µs | 549.6 MB/s | $0.0354 /10k IOPS·h | 1 | ||
| QD 64 | m6id.2xlarge | 477.2 µs | 522.2 µs | 549.5 MB/s | $0.0354 /10k IOPS·h | 1 | ||
| QD 128 | m6id.2xlarge | 954.4 µs | 1.028 ms | 549.5 MB/s | $0.0354 /10k IOPS·h | 1 | ||
| QD 256 | m6id.2xlarge | 1.909 ms | 1.991 ms | 549.5 MB/s | $0.0354 /10k IOPS·h | 1 | ||
| i4i.2xlarge | ||||||||
| QD 1 | i4i.2xlarge | 107.0 µs | 144.4 µs | 37.89 MB/s | $0.742 /10k IOPS·h | 5 | ||
| QD 4 | i4i.2xlarge | 112.1 µs | 175.1 µs | 144.2 MB/s | $0.195 /10k IOPS·h | 5 | ||
| QD 16 | i4i.2xlarge | 136.2 µs | 240.6 µs | 470.9 MB/s | $0.0597 /10k IOPS·h | 5 | ||
| QD 64 | i4i.2xlarge | 317.4 µs | 477.2 µs | 819.2 MB/s | $0.0343 /10k IOPS·h | 5 +84 failed | ||
| QD 128 | i4i.2xlarge | 634.9 µs | 847.9 µs | 819.2 MB/s | $0.0343 /10k IOPS·h | 5 | ||
| QD 256 | i4i.2xlarge | 1.270 ms | 1.450 ms | 819.2 MB/s | $0.0343 /10k IOPS·h | 5 | ||
Compared:m6id.2xlargei4g.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 reads a disk completes when one thread keeps queue_depth of them submitted, O_DIRECT through io_uring. In the Runs examined on EC2 the counted samples sat on the provider's throughput or IOPS limit for the disk, not on the device's own; the binary does not require a limit to bind, and where the dumps took them, the device's counters show the time spent over each limit.
What it does not measure
- In the Runs examined, the counted samples sat on the provider's limit for the disk, not the device's own (see "Findings").
- Each sample gives its time divided by the completions it reaped; the Run's figure is the median of those.
queue_depthcounts reads submitted and not yet reaped, not reads the device held at any instant.
Code & config
Benchmark docsSeries JSONi4i.2xlarge · random · instance store · 4 KiB · QD 64
202 if (c->pending) {203 uint64_t now = lm_now_ns();204 for (unsigned i = 0; i < c->pending; i++) c->submit_ns[c->pending_slots[i]] = now;// …225static inline unsigned reap(ctx_t *c) {226 ring_t *r = &c->ring;227 unsigned head = atomic_load_explicit(r->cq_head, memory_order_relaxed);228 while (head == atomic_load_explicit(r->cq_tail, memory_order_acquire)) enter(c, true);229 uint64_t now = c->timing ? lm_now_ns() : 0;// …233 atomic_store_explicit(r->cq_head, head + 1, memory_order_release);234 if (c->timing) lm_hist_add(c->times[c->counted], now - c->submit_ns[slot]);// …248__attribute__((noinline))249static uint64_t complete_one(void *arg) {250 ctx_t *c = (ctx_t *)arg;251 unsigned slot = reap(c);252 prepare(c, slot);253 return c->sum;254}// …346 lm_deferred_measure(&samples, complete_one, &c, on_phase);
Configuration
- benchmarkdisk_read_io_uring
- buildstatic
- instancei4i.2xlarge
- regionus-east-2
- azuse2-az3
- params.accessrandom
- params.dir/mnt/lm/instance-store
- params.diskinstance_store
- params.queue_depth64
- params.request_bytes4096
- params.span_bytes34359738368