Durable disk write, idle
disk_write_latency · compared across machine types · 14 Series on 8 machine types · AWS us-east-2
CPU
Disk
Order
| Compare | Machine | Variant | P50 | P99 | Rate | Unit cost | Runs |
|---|---|---|---|---|---|---|---|
| i4i.2xlarge | 30.34 µs | 47.38 µs | 269.1 MB/s | $0.209 /10k IOPS·h | 5 | ||
| i4g.2xlarge | 32.38 µs | 46.35 µs | 253.8 MB/s | $0.202 /10k IOPS·h | 4 | ||
| m6id.2xlarge | 32.64 µs | 39.18 µs | 250.5 MB/s | $0.155 /10k IOPS·h | 1 |
Compared:m6id.2xlargei4g.2xlargei4i.2xlarge
Tail: 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
The time of one durable write to a disk: a buffered pwrite followed by fdatasync, one at a time, with every write timed on its own: each counted sample is exactly one write, so a Run gives the spread of single-write latencies (its op_histogram) as well as their median.
What it does not measure
- With
syncnonethe figure is the page cache's, not the device's:device_countersshows how few writes reached the device. - Throughput at depth: one write is outstanding at a time.
disk_write_io_uringkeeps many. - A tail beyond the counted samples: a Run times
LM_SAMPLESwrites.
Code & config
Benchmark docsSeries JSONi4i.2xlarge · instance store
107__attribute__((noinline))108static uint64_t write_next(void *arg) {109 ctx_t *c = (ctx_t *)arg;110 uint64_t t = tag(c->offset);111 c->buf[0] = t;112 ssize_t n = pwrite(c->fd, c->buf, c->request, (off_t)c->offset);// …117 if (c->sync) {118 if (__builtin_expect(fdatasync(c->fd) != 0, 0)) lm_die("fdatasync: %s", strerror(errno));119 c->syncs++;120 }121 c->sum += t;122 c->writes++;123 c->offset += c->request;// …128 return c->sum;129}// …220 lm_hist_measure(write_next, &c, WARMUP_WRITES, QUICK_SAMPLES, &latency);
Configuration
- benchmarkdisk_write_latency
- buildstatic
- instancei4i.2xlarge
- regionus-east-2
- azuse2-az3
- params.dir/mnt/lm/instance-store
- params.diskinstance_store
- params.file_bytes268435456
- params.request_bytes8192
- params.syncfdatasync