[Request]: Expose granular disk I/O statistics per container
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### Feature or enhancement request details
Hey all,
Currently, Apple Container does not expose detailed per-container filesystem performance statistics such as `IOPS`, latency, throughput, `fsync` frequency, dirty-page writeback, queue depth, or even which host storage backend is being used (`APFS`, native, `ext4`, `virtio`, etc.). The absence of this information makes it difficult to diagnose performance regressions or tune storage behavior for database workloads, build systems, or ML ingestion pipelines.
A useful feature would be a `container stats --io` mode—similar in spirit to `docker stats`, that reports per-container read and write operations per second, read and write throughput, average latency and `fsync` latency, as well as dirty-page and queue-depth metrics. This would allow container users to understand and debug the underlying I/O characteristics of their workloads without resorting to external instrumentation or guesswork.
Example UI:
```bash
container stats --io
CONTAINER READ/s WRITE/s LAT(ms) FSYNC(ms) QD DIRTY BACKEND
mydb 280MB 195MB 4.8 1.4 1 2.1% apfs
```
The benefits of this feature include helping diagnose `fsync` bottlenecks, providing valuable insight for database workloads such as `Postgres`, `Mongo`, and `MySQL`, supporting performance analysis in `Docker` CI build environments, enabling users to distinguish true disk behavior from virtualization overhead, and generally making it easier to identify, monitor, and track filesystem performance regressions over time.
Optionally you could expose Prometheus metrics:
```bash
container_io_read_bytes_total
container_io_write_bytes_total
container_io_latency_seconds
```
Michael
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.