hn.today

Disk I/O profiling with eBPF

coroot.com3 points0 comments
Screenshot of Disk I/O profiling with eBPF

The profiling method measures disk activity at the Linux block layer rather than tracking every time a thread is switched off the CPU. eBPF hooks record a request’s submitting process and user-space stack, then match its completion to calculate I/O time. This captures synchronous and asynchronous operations, including libaio, io_uring, page-cache misses, direct I/O, and fsyncs. Each stack is associated with three measures: time spent on I/O, bytes read, and bytes written. Together, they distinguish a slower device from an application doing more disk work, and show which functions are responsible. Because the data uses the existing CPU-profile storage format, it adds little storage cost.

To limit overhead, the profiler takes at most one stack sample per CPU per millisecond and uses that sample to estimate nearby requests’ counts, bytes, and latency. Totals remain accurate, while attribution is approximate; kernel writeback performed on an application’s behalf is not attributed to the original writer. Tests found negligible impact on PostgreSQL workloads and high-rate fio, with roughly 1 MB of additional agent memory. A retention job on a MySQL cluster demonstrates the diagnostic value: deleting old rows increased disk activity, doubled query latency, and slowed a service by about 20%. Flame graphs separated the writer’s DELETE work from replica appliers and traced reads to cold pages fetched during index scans and row deletion. The profiles can be compared with a pre-incident period and linked to volume charts.

Read on coroot.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Shaun Thomas: Burnt Toast

Shaun Thomas: Burnt Toast

PostgreSQL’s TOAST storage made the table much smaller, and counting or scanning rows was faster than with the larger uncompressed table. But reading a field inside every toasted value required far more buffer reads, showing that TOAST can trade space savings for slower access to large values. (pgedge.com)

Jepsen: ParticleDB 1.1.4

Jepsen: ParticleDB 1.1.4

Jepsen found 96 bugs in ParticleDB versions 1.1.4 through 1.1.18.11.rc-22, including crashes, data loss, and serious transaction anomalies. Most issues were fixed, but committed writes could still disappear and serializable transactions still had anomalies; Orkes says a later release resolves the remaining problems. (jepsen.io)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.